1 diff --git a/include/ioctl_cfg80211.h b/include/ioctl_cfg80211.h
2 index df878ea..b3431c3 100644
3 --- a/include/ioctl_cfg80211.h
4 +++ b/include/ioctl_cfg80211.h
5 @@ -143,8 +143,11 @@ bool rtw_cfg80211_pwr_mgmt(_adapter *adapter);
6 #define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->pnetdev, freq, buf, len, gfp)
7 #elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0))
8 #define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->pnetdev, freq, sig_dbm, buf, len, gfp)
10 +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0))
11 #define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->rtw_wdev, freq, sig_dbm, buf, len, gfp)
13 +// 3.12 added a flags argument which is just set to zero
14 +#define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->rtw_wdev, freq, sig_dbm, buf, len, 0, gfp)
17 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) && !defined(COMPAT_KERNEL_RELEASE)
18 diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c
19 index 3abcad9..3a5f667 100644
20 --- a/os_dep/linux/ioctl_cfg80211.c
21 +++ b/os_dep/linux/ioctl_cfg80211.c
22 @@ -642,6 +642,11 @@ void rtw_cfg80211_ibss_indicate_connect(_adapter *padapter)
23 struct wlan_network *cur_network = &(pmlmepriv->cur_network);
24 struct wireless_dev *pwdev = padapter->rtw_wdev;
25 struct cfg80211_bss *bss = NULL;
26 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
27 + WLAN_BSSID_EX *pnetwork = &(padapter->mlmeextpriv.mlmext_info.network);
28 + struct ieee80211_channel *chan = NULL;
32 DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter));
33 if (pwdev->iftype != NL80211_IFTYPE_ADHOC)
34 @@ -693,7 +698,20 @@ void rtw_cfg80211_ibss_indicate_connect(_adapter *padapter)
35 DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" BSS not found !!\n", FUNC_ADPT_ARG(padapter));
37 //notify cfg80211 that device joined an IBSS
38 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
39 + if (!(pnetwork) || !(padapter->rtw_wdev))
42 + if (pnetwork->Configuration.DSConfig <= RTW_CH_MAX_2G_CHANNEL)
43 + freq = rtw_ieee80211_channel_to_frequency(pnetwork->Configuration.DSConfig, IEEE80211_BAND_2GHZ);
45 + freq = rtw_ieee80211_channel_to_frequency(pnetwork->Configuration.DSConfig, IEEE80211_BAND_5GHZ);
47 + chan = ieee80211_get_channel(padapter->rtw_wdev->wiphy, freq);
48 + cfg80211_ibss_joined(padapter->pnetdev, cur_network->network.MacAddress, chan, GFP_ATOMIC);
50 cfg80211_ibss_joined(padapter->pnetdev, cur_network->network.MacAddress, GFP_ATOMIC);
54 void rtw_cfg80211_indicate_connect(_adapter *padapter)
55 @@ -792,14 +810,18 @@ check_bss:
59 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)
60 DBG_8192C("pwdev->sme_state(b)=%d\n", pwdev->sme_state);
62 cfg80211_connect_result(padapter->pnetdev, cur_network->network.MacAddress
63 , pmlmepriv->assoc_req+sizeof(struct rtw_ieee80211_hdr_3addr)+2
64 , pmlmepriv->assoc_req_len-sizeof(struct rtw_ieee80211_hdr_3addr)-2
65 , pmlmepriv->assoc_rsp+sizeof(struct rtw_ieee80211_hdr_3addr)+6
66 , pmlmepriv->assoc_rsp_len-sizeof(struct rtw_ieee80211_hdr_3addr)-6
67 , WLAN_STATUS_SUCCESS, GFP_ATOMIC);
68 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)
69 DBG_8192C("pwdev->sme_state(a)=%d\n", pwdev->sme_state);
74 @@ -1666,7 +1692,11 @@ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
76 static int cfg80211_rtw_get_station(struct wiphy *wiphy,
77 struct net_device *ndev,
78 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0))
79 + const u8 *mac, struct station_info *sinfo)
81 u8 *mac, struct station_info *sinfo)
85 _adapter *padapter = (_adapter *)rtw_netdev_priv(ndev);
86 @@ -4070,7 +4096,11 @@ static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
87 #endif //(LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
89 static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev,
90 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0))
91 + const u8 *mac, struct station_parameters *params)
93 u8 *mac, struct station_parameters *params)
96 DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
98 @@ -4078,7 +4104,11 @@ static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev
101 static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev,
102 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0))
110 @@ -4169,7 +4195,11 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev
113 static int cfg80211_rtw_change_station(struct wiphy *wiphy, struct net_device *ndev,
114 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0))
115 + const u8 *mac, struct station_parameters *params)
117 u8 *mac, struct station_parameters *params)
120 DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
122 @@ -4997,6 +5023,9 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
124 struct net_device *ndev,
126 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
127 + struct cfg80211_mgmt_tx_params *params,
129 struct ieee80211_channel *chan,
130 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) || defined(COMPAT_KERNEL_RELEASE)
132 @@ -5017,11 +5046,17 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
133 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
134 bool dont_wait_for_ack,
139 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
140 struct net_device *ndev = wdev_to_ndev(wdev);
142 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
143 + struct ieee80211_channel *chan = params->chan;
144 + const u8 *buf = params->buf;
145 + size_t len = params->len;
149 u32 dump_limit = RTW_MAX_MGMT_TX_CNT;
150 @@ -5897,7 +5932,11 @@ static void rtw_cfg80211_preinit_wiphy(_adapter *padapter, struct wiphy *wiphy)
153 #if defined(CONFIG_PM) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0))
154 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
155 + wiphy->wowlan = &wowlan_stub;
157 wiphy->wowlan = wowlan_stub;
161 #if defined(CONFIG_TDLS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
162 diff --git a/os_dep/linux/wifi_regd.c b/os_dep/linux/wifi_regd.c
163 index faa2c14..6c1b90d 100644
164 --- a/os_dep/linux/wifi_regd.c
165 +++ b/os_dep/linux/wifi_regd.c
166 @@ -270,9 +270,14 @@ static void _rtw_reg_apply_radar_flags(struct wiphy *wiphy)
168 if (!(ch->flags & IEEE80211_CHAN_DISABLED))
169 ch->flags |= IEEE80211_CHAN_RADAR |
170 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)
171 + IEEE80211_CHAN_NO_IR;
173 IEEE80211_CHAN_NO_IBSS;
180 * We always enable radar detection/DFS on this
181 @@ -357,7 +362,11 @@ static void _rtw_reg_apply_flags(struct wiphy *wiphy)
182 ch = ieee80211_get_channel(wiphy, freq);
184 if (channel_set[i].ScanType == SCAN_PASSIVE)
185 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)
186 + ch->flags = IEEE80211_CHAN_NO_IR;
188 ch->flags = IEEE80211_CHAN_PASSIVE_SCAN;
193 @@ -484,9 +493,16 @@ static void _rtw_regd_init_wiphy(struct rtw_regulatory *reg,
195 wiphy->reg_notifier = reg_notifier;
197 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)
198 + wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
199 + wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS;
200 + wiphy->regulatory_flags &= ~REGULATORY_STRICT_REG;
203 wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
204 wiphy->flags &= ~WIPHY_FLAG_STRICT_REGULATORY;
205 wiphy->flags &= ~WIPHY_FLAG_DISABLE_BEACON_HINTS;
208 regd = _rtw_regdomain_select(reg);
209 wiphy_apply_custom_regulatory(wiphy, regd);