]> git.pld-linux.org Git - packages/rtl8812au.git/blob - update-cfg80211-support.patch
- uppdated kernel modules build system
[packages/rtl8812au.git] / update-cfg80211-support.patch
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)
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)
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;
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,11 @@ 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 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0))
97 +                                   const u8 *mac, struct station_info *sinfo)
98 +#else
99                                     u8 *mac, struct station_info *sinfo)
100 +#endif
101  {
102         int ret = 0;
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))
106  
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)
110 +#else
111                                u8 *mac, struct station_parameters *params)
112 +#endif
113  {
114         DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
115         
116 @@ -4078,7 +4104,11 @@ static int       cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev
117  }
118  
119  static int     cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev,
120 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0))
121 +                              const u8 *mac)
122 +#else
123                                u8 *mac)
124 +#endif
125  {
126         int ret=0;      
127         _irqL irqL;
128 @@ -4169,7 +4195,11 @@ static int       cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev
129  }
130  
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)
134 +#else
135                                   u8 *mac, struct station_parameters *params)
136 +#endif
137  {
138         DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
139         
140 @@ -4997,6 +5023,9 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
141  #else
142         struct net_device *ndev,
143  #endif
144 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
145 +       struct cfg80211_mgmt_tx_params *params,
146 +#else
147         struct ieee80211_channel *chan,
148  #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) || defined(COMPAT_KERNEL_RELEASE)
149         bool offchan,
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,
153  #endif
154 +#endif
155         u64 *cookie)
156  {
157  #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
158         struct net_device *ndev = wdev_to_ndev(wdev);
159  #endif
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;
164 +#endif
165         int ret = 0;
166         int tx_ret;
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)
169  #endif
170  
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;
174 +#else
175         wiphy->wowlan = wowlan_stub;
176 +#endif
177  #endif
178  
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)
185  #ifdef CONFIG_DFS
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;
190 +#else
191                             IEEE80211_CHAN_NO_IBSS;
192  #endif
193  
194 +#endif
195 +
196  #if 0
197                 /*
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);
201                 if (ch) {
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;
205 +#else
206                                 ch->flags = IEEE80211_CHAN_PASSIVE_SCAN;
207 +#endif
208                         else
209                                 ch->flags = 0;
210                 }
211 @@ -484,9 +493,16 @@ static void _rtw_regd_init_wiphy(struct rtw_regulatory *reg,
212  
213         wiphy->reg_notifier = reg_notifier;
214  
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;
219 +
220 +#else
221         wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
222         wiphy->flags &= ~WIPHY_FLAG_STRICT_REGULATORY;
223         wiphy->flags &= ~WIPHY_FLAG_DISABLE_BEACON_HINTS;
224 +#endif
225  
226         regd = _rtw_regdomain_select(reg);
227         wiphy_apply_custom_regulatory(wiphy, regd);
This page took 0.072304 seconds and 3 git commands to generate.