]> git.pld-linux.org Git - packages/rtl8812au.git/blame - update-cfg80211-support.patch
- rel 16
[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
7e5222bd 74@@ -1666,7 +1692,11 @@ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
e46e556c
JR
75
76 static int cfg80211_rtw_get_station(struct wiphy *wiphy,
77 struct net_device *ndev,
7e5222bd 78+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0))
e46e556c 79+ const u8 *mac, struct station_info *sinfo)
7e5222bd
JR
80+#else
81 u8 *mac, struct station_info *sinfo)
82+#endif
e46e556c
JR
83 {
84 int ret = 0;
85 _adapter *padapter = (_adapter *)rtw_netdev_priv(ndev);
7e5222bd 86@@ -4070,7 +4096,11 @@ static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
e46e556c
JR
87 #endif //(LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
88
89 static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev,
7e5222bd 90+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0))
e46e556c 91+ const u8 *mac, struct station_parameters *params)
7e5222bd
JR
92+#else
93 u8 *mac, struct station_parameters *params)
94+#endif
e46e556c
JR
95 {
96 DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
97
7e5222bd 98@@ -4078,7 +4104,11 @@ static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev
e46e556c
JR
99 }
100
101 static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev,
7e5222bd 102+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0))
e46e556c 103+ const u8 *mac)
7e5222bd
JR
104+#else
105 u8 *mac)
106+#endif
e46e556c
JR
107 {
108 int ret=0;
109 _irqL irqL;
7e5222bd 110@@ -4169,7 +4195,11 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev
e46e556c
JR
111 }
112
113 static int cfg80211_rtw_change_station(struct wiphy *wiphy, struct net_device *ndev,
7e5222bd 114+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0))
e46e556c 115+ const u8 *mac, struct station_parameters *params)
7e5222bd
JR
116+#else
117 u8 *mac, struct station_parameters *params)
118+#endif
e46e556c
JR
119 {
120 DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
121
122@@ -4997,6 +5023,9 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
123 #else
124 struct net_device *ndev,
125 #endif
126+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
127+ struct cfg80211_mgmt_tx_params *params,
128+#else
129 struct ieee80211_channel *chan,
130 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) || defined(COMPAT_KERNEL_RELEASE)
131 bool offchan,
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,
135 #endif
136+#endif
137 u64 *cookie)
138 {
139 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
140 struct net_device *ndev = wdev_to_ndev(wdev);
141 #endif
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;
146+#endif
147 int ret = 0;
148 int tx_ret;
149 u32 dump_limit = RTW_MAX_MGMT_TX_CNT;
7e5222bd 150@@ -5897,7 +5932,11 @@ static void rtw_cfg80211_preinit_wiphy(_adapter *padapter, struct wiphy *wiphy)
e46e556c
JR
151 #endif
152
153 #if defined(CONFIG_PM) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0))
7e5222bd 154+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
e46e556c 155+ wiphy->wowlan = &wowlan_stub;
7e5222bd
JR
156+#else
157 wiphy->wowlan = wowlan_stub;
158+#endif
e46e556c
JR
159 #endif
160
161 #if defined(CONFIG_TDLS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
162diff --git a/os_dep/linux/wifi_regd.c b/os_dep/linux/wifi_regd.c
163index 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)
167 #ifdef CONFIG_DFS
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;
172+#else
173 IEEE80211_CHAN_NO_IBSS;
174 #endif
175
176+#endif
177+
178 #if 0
179 /*
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);
183 if (ch) {
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;
187+#else
188 ch->flags = IEEE80211_CHAN_PASSIVE_SCAN;
189+#endif
190 else
191 ch->flags = 0;
192 }
193@@ -484,9 +493,16 @@ static void _rtw_regd_init_wiphy(struct rtw_regulatory *reg,
194
195 wiphy->reg_notifier = reg_notifier;
196
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;
201+
202+#else
203 wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
204 wiphy->flags &= ~WIPHY_FLAG_STRICT_REGULATORY;
205 wiphy->flags &= ~WIPHY_FLAG_DISABLE_BEACON_HINTS;
206+#endif
207
208 regd = _rtw_regdomain_select(reg);
209 wiphy_apply_custom_regulatory(wiphy, regd);
This page took 0.062685 seconds and 4 git commands to generate.