]> git.pld-linux.org Git - packages/rtl8812au.git/blame - update-cfg80211-support.patch
- enable cfg80211 use in driver and update code to 3.15+
[packages/rtl8812au.git] / update-cfg80211-support.patch
CommitLineData
e46e556c
JR
1diff --git a/include/ioctl_cfg80211.h b/include/ioctl_cfg80211.h
2index 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)
9-#else
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)
12+#else
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)
15 #endif
16
17 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) && !defined(COMPAT_KERNEL_RELEASE)
18diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c
19index 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;
29+ u32 freq;
30+#endif
31
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));
36 }
37 //notify cfg80211 that device joined an IBSS
38+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
39+ if (!(pnetwork) || !(padapter->rtw_wdev))
40+ return;
41+
42+ if (pnetwork->Configuration.DSConfig <= RTW_CH_MAX_2G_CHANNEL)
43+ freq = rtw_ieee80211_channel_to_frequency(pnetwork->Configuration.DSConfig, IEEE80211_BAND_2GHZ);
44+ else
45+ freq = rtw_ieee80211_channel_to_frequency(pnetwork->Configuration.DSConfig, IEEE80211_BAND_5GHZ);
46+
47+ chan = ieee80211_get_channel(padapter->rtw_wdev->wiphy, freq);
48+ cfg80211_ibss_joined(padapter->pnetdev, cur_network->network.MacAddress, chan, GFP_ATOMIC);
49+#else
50 cfg80211_ibss_joined(padapter->pnetdev, cur_network->network.MacAddress, GFP_ATOMIC);
51+#endif
52 }
53
54 void rtw_cfg80211_indicate_connect(_adapter *padapter)
55@@ -792,14 +810,18 @@ check_bss:
56 }
57 else
58 {
59+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)
60 DBG_8192C("pwdev->sme_state(b)=%d\n", pwdev->sme_state);
61+#endif
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);
70+#endif
71 }
72 }
73
74@@ -838,6 +860,7 @@ void rtw_cfg80211_indicate_disconnect(_adapter *padapter)
75 #endif //CONFIG_P2P
76
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);
80
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);
84
85 DBG_8192C("pwdev->sme_state(a)=%d\n", pwdev->sme_state);
86+#else
87+ cfg80211_disconnected(padapter->pnetdev, 0, NULL, 0, GFP_ATOMIC);
88+#endif
89 }
90 }
91
92@@ -1666,7 +1692,7 @@ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
93
94 static int cfg80211_rtw_get_station(struct wiphy *wiphy,
95 struct net_device *ndev,
96- u8 *mac, struct station_info *sinfo)
97+ const u8 *mac, struct station_info *sinfo)
98 {
99 int ret = 0;
100 _adapter *padapter = (_adapter *)rtw_netdev_priv(ndev);
101@@ -4070,7 +4096,7 @@ static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
102 #endif //(LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
103
104 static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev,
105- u8 *mac, struct station_parameters *params)
106+ const u8 *mac, struct station_parameters *params)
107 {
108 DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
109
110@@ -4078,7 +4104,7 @@ static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev
111 }
112
113 static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev,
114- u8 *mac)
115+ const u8 *mac)
116 {
117 int ret=0;
118 _irqL irqL;
119@@ -4169,7 +4195,7 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev
120 }
121
122 static int cfg80211_rtw_change_station(struct wiphy *wiphy, struct net_device *ndev,
123- u8 *mac, struct station_parameters *params)
124+ const u8 *mac, struct station_parameters *params)
125 {
126 DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
127
128@@ -4997,6 +5023,9 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
129 #else
130 struct net_device *ndev,
131 #endif
132+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
133+ struct cfg80211_mgmt_tx_params *params,
134+#else
135 struct ieee80211_channel *chan,
136 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) || defined(COMPAT_KERNEL_RELEASE)
137 bool offchan,
138@@ -5017,11 +5046,17 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
139 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
140 bool dont_wait_for_ack,
141 #endif
142+#endif
143 u64 *cookie)
144 {
145 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
146 struct net_device *ndev = wdev_to_ndev(wdev);
147 #endif
148+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
149+ struct ieee80211_channel *chan = params->chan;
150+ const u8 *buf = params->buf;
151+ size_t len = params->len;
152+#endif
153 int ret = 0;
154 int tx_ret;
155 u32 dump_limit = RTW_MAX_MGMT_TX_CNT;
156@@ -5897,7 +5932,7 @@ static void rtw_cfg80211_preinit_wiphy(_adapter *padapter, struct wiphy *wiphy)
157 #endif
158
159 #if defined(CONFIG_PM) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0))
160- wiphy->wowlan = wowlan_stub;
161+ wiphy->wowlan = &wowlan_stub;
162 #endif
163
164 #if defined(CONFIG_TDLS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
165diff --git a/os_dep/linux/wifi_regd.c b/os_dep/linux/wifi_regd.c
166index faa2c14..6c1b90d 100644
167--- a/os_dep/linux/wifi_regd.c
168+++ b/os_dep/linux/wifi_regd.c
169@@ -270,9 +270,14 @@ static void _rtw_reg_apply_radar_flags(struct wiphy *wiphy)
170 #ifdef CONFIG_DFS
171 if (!(ch->flags & IEEE80211_CHAN_DISABLED))
172 ch->flags |= IEEE80211_CHAN_RADAR |
173+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)
174+ IEEE80211_CHAN_NO_IR;
175+#else
176 IEEE80211_CHAN_NO_IBSS;
177 #endif
178
179+#endif
180+
181 #if 0
182 /*
183 * We always enable radar detection/DFS on this
184@@ -357,7 +362,11 @@ static void _rtw_reg_apply_flags(struct wiphy *wiphy)
185 ch = ieee80211_get_channel(wiphy, freq);
186 if (ch) {
187 if (channel_set[i].ScanType == SCAN_PASSIVE)
188+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)
189+ ch->flags = IEEE80211_CHAN_NO_IR;
190+#else
191 ch->flags = IEEE80211_CHAN_PASSIVE_SCAN;
192+#endif
193 else
194 ch->flags = 0;
195 }
196@@ -484,9 +493,16 @@ static void _rtw_regd_init_wiphy(struct rtw_regulatory *reg,
197
198 wiphy->reg_notifier = reg_notifier;
199
200+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)
201+ wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
202+ wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS;
203+ wiphy->regulatory_flags &= ~REGULATORY_STRICT_REG;
204+
205+#else
206 wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
207 wiphy->flags &= ~WIPHY_FLAG_STRICT_REGULATORY;
208 wiphy->flags &= ~WIPHY_FLAG_DISABLE_BEACON_HINTS;
209+#endif
210
211 regd = _rtw_regdomain_select(reg);
212 wiphy_apply_custom_regulatory(wiphy, regd);
This page took 0.942507 seconds and 4 git commands to generate.