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 @@ -838,6 +860,7 @@ void rtw_cfg80211_indicate_disconnect(_adapter *padapter)
77 if (!padapter->mlmepriv.not_indic_disco) {
78 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)
79 DBG_8192C("pwdev->sme_state(b)=%d\n", pwdev->sme_state);
81 if(pwdev->sme_state==CFG80211_SME_CONNECTING)
82 @@ -849,6 +872,9 @@ void rtw_cfg80211_indicate_disconnect(_adapter *padapter)
83 //DBG_8192C("pwdev->sme_state=%d\n", pwdev->sme_state);
85 DBG_8192C("pwdev->sme_state(a)=%d\n", pwdev->sme_state);
87 + cfg80211_disconnected(padapter->pnetdev, 0, NULL, 0, GFP_ATOMIC);
92 @@ -1666,7 +1692,11 @@ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
94 static int cfg80211_rtw_get_station(struct wiphy *wiphy,
95 struct net_device *ndev,
96 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0))
97 + const u8 *mac, struct station_info *sinfo)
99 u8 *mac, struct station_info *sinfo)
103 _adapter *padapter = (_adapter *)rtw_netdev_priv(ndev);
104 @@ -4070,7 +4096,11 @@ static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
105 #endif //(LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
107 static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev,
108 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0))
109 + const u8 *mac, struct station_parameters *params)
111 u8 *mac, struct station_parameters *params)
114 DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
116 @@ -4078,7 +4104,11 @@ static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev
119 static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev,
120 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0))
128 @@ -4169,7 +4195,11 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev
131 static int cfg80211_rtw_change_station(struct wiphy *wiphy, struct net_device *ndev,
132 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0))
133 + const u8 *mac, struct station_parameters *params)
135 u8 *mac, struct station_parameters *params)
138 DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
140 @@ -4997,6 +5023,9 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
142 struct net_device *ndev,
144 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
145 + struct cfg80211_mgmt_tx_params *params,
147 struct ieee80211_channel *chan,
148 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) || defined(COMPAT_KERNEL_RELEASE)
150 @@ -5017,11 +5046,17 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
151 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
152 bool dont_wait_for_ack,
157 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
158 struct net_device *ndev = wdev_to_ndev(wdev);
160 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
161 + struct ieee80211_channel *chan = params->chan;
162 + const u8 *buf = params->buf;
163 + size_t len = params->len;
167 u32 dump_limit = RTW_MAX_MGMT_TX_CNT;
168 @@ -5897,7 +5932,11 @@ static void rtw_cfg80211_preinit_wiphy(_adapter *padapter, struct wiphy *wiphy)
171 #if defined(CONFIG_PM) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0))
172 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
173 + wiphy->wowlan = &wowlan_stub;
175 wiphy->wowlan = wowlan_stub;
179 #if defined(CONFIG_TDLS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
180 diff --git a/os_dep/linux/wifi_regd.c b/os_dep/linux/wifi_regd.c
181 index faa2c14..6c1b90d 100644
182 --- a/os_dep/linux/wifi_regd.c
183 +++ b/os_dep/linux/wifi_regd.c
184 @@ -270,9 +270,14 @@ static void _rtw_reg_apply_radar_flags(struct wiphy *wiphy)
186 if (!(ch->flags & IEEE80211_CHAN_DISABLED))
187 ch->flags |= IEEE80211_CHAN_RADAR |
188 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)
189 + IEEE80211_CHAN_NO_IR;
191 IEEE80211_CHAN_NO_IBSS;
198 * We always enable radar detection/DFS on this
199 @@ -357,7 +362,11 @@ static void _rtw_reg_apply_flags(struct wiphy *wiphy)
200 ch = ieee80211_get_channel(wiphy, freq);
202 if (channel_set[i].ScanType == SCAN_PASSIVE)
203 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)
204 + ch->flags = IEEE80211_CHAN_NO_IR;
206 ch->flags = IEEE80211_CHAN_PASSIVE_SCAN;
211 @@ -484,9 +493,16 @@ static void _rtw_regd_init_wiphy(struct rtw_regulatory *reg,
213 wiphy->reg_notifier = reg_notifier;
215 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)
216 + wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
217 + wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS;
218 + wiphy->regulatory_flags &= ~REGULATORY_STRICT_REG;
221 wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
222 wiphy->flags &= ~WIPHY_FLAG_STRICT_REGULATORY;
223 wiphy->flags &= ~WIPHY_FLAG_DISABLE_BEACON_HINTS;
226 regd = _rtw_regdomain_select(reg);
227 wiphy_apply_custom_regulatory(wiphy, regd);