]>
Commit | Line | Data |
---|---|---|
c399f954 JR |
1 | From 1d3af1e8e931f6fee3ceb26cee4c8b214bb8384c Mon Sep 17 00:00:00 2001 |
2 | From: Mauro Rossi <issor.oruam@gmail.com> | |
3 | Date: Sat, 13 May 2017 22:30:17 +0200 | |
4 | Subject: [PATCH] rtl8812au: add support for kernel 4.12 | |
5 | ||
6 | /home/utente/nougat-x86_kernel_49/kernel/os_dep/linux/ioctl_cfg80211.c:803:3: | |
7 | error: too many arguments to function 'cfg80211_roamed' | |
8 | cfg80211_roamed(padapter->pnetdev | |
9 | ^ | |
10 | ||
11 | /home/utente/nougat-x86_kernel_49/kernel/os_dep/linux/ioctl_cfg80211.c:6580:18: | |
12 | error: 'WIPHY_FLAG_SUPPORTS_SCHED_SCAN' undeclared (first use in this function) | |
13 | wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN; | |
14 | ^ | |
15 | --- | |
16 | os_dep/linux/ioctl_cfg80211.c | 21 +++++++++++++++++++++ | |
17 | 1 file changed, 21 insertions(+) | |
18 | ||
19 | diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c | |
20 | index e040059..1cca0dd 100755 | |
21 | --- a/os_dep/linux/ioctl_cfg80211.c | |
22 | +++ b/os_dep/linux/ioctl_cfg80211.c | |
23 | @@ -794,16 +794,32 @@ void rtw_cfg80211_indicate_connect(_adapter *padapter) | |
24 | struct ieee80211_channel *notify_channel; | |
25 | u32 freq; | |
26 | u16 channel = cur_network->network.Configuration.DSConfig; | |
27 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) | |
28 | + struct cfg80211_roam_info roam_info = {}; | |
29 | +#endif | |
30 | ||
31 | if (channel <= RTW_CH_MAX_2G_CHANNEL) | |
32 | freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_2GHZ); | |
33 | else | |
34 | freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_5GHZ); | |
35 | ||
36 | notify_channel = ieee80211_get_channel(wiphy, freq); | |
37 | #endif | |
38 | ||
39 | DBG_871X(FUNC_ADPT_FMT" call cfg80211_roamed\n", FUNC_ADPT_ARG(padapter)); | |
40 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) | |
41 | + roam_info.channel = notify_channel; | |
42 | + roam_info.bssid = cur_network->network.MacAddress; | |
43 | + roam_info.req_ie = | |
44 | + pmlmepriv->assoc_req+sizeof(struct rtw_ieee80211_hdr_3addr)+2; | |
45 | + roam_info.req_ie_len = | |
46 | + pmlmepriv->assoc_req_len-sizeof(struct rtw_ieee80211_hdr_3addr)-2; | |
47 | + roam_info.resp_ie = | |
48 | + pmlmepriv->assoc_rsp+sizeof(struct rtw_ieee80211_hdr_3addr)+6; | |
49 | + roam_info.resp_ie_len = | |
50 | + pmlmepriv->assoc_rsp_len-sizeof(struct rtw_ieee80211_hdr_3addr)-6; | |
51 | + cfg80211_roamed(padapter->pnetdev, &roam_info, GFP_ATOMIC); | |
52 | +#else | |
53 | cfg80211_roamed(padapter->pnetdev | |
54 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) || defined(COMPAT_KERNEL_RELEASE) | |
55 | , notify_channel | |
56 | @@ -810,6 +826,7 @@ void rtw_cfg80211_indicate_connect(_adapter *padapter) | |
57 | , pmlmepriv->assoc_rsp+sizeof(struct rtw_ieee80211_hdr_3addr)+6 | |
58 | , pmlmepriv->assoc_rsp_len-sizeof(struct rtw_ieee80211_hdr_3addr)-6 | |
59 | , GFP_ATOMIC); | |
60 | +#endif | |
61 | } | |
62 | else | |
63 | { | |
64 | @@ -6577,7 +6594,11 @@ static void rtw_cfg80211_preinit_wiphy(_adapter *adapter, struct wiphy *wiphy) | |
f28b7c49 JR |
65 | #endif |
66 | ||
67 | #if defined(CONFIG_PM) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)) | |
c399f954 | 68 | +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0)) |
f28b7c49 | 69 | wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN; |
c399f954 JR |
70 | +#else // kernel >= 4.12 |
71 | + wiphy->max_sched_scan_reqs = 1; | |
f28b7c49 JR |
72 | +#endif |
73 | #ifdef CONFIG_PNO_SUPPORT | |
74 | wiphy->max_sched_scan_ssids = MAX_PNO_LIST_COUNT; | |
75 | #endif | |
c399f954 JR |
76 | --- rtl8812au_linux-master/os_dep/linux/ioctl_cfg80211.c~ 2017-08-01 11:09:27.000000000 +0200 |
77 | +++ rtl8812au_linux-master/os_dep/linux/ioctl_cfg80211.c 2017-08-01 11:11:56.007409963 +0200 | |
78 | @@ -1824,7 +1824,11 @@ | |
79 | */ | |
80 | static int cfg80211_rtw_change_iface(struct wiphy *wiphy, | |
81 | struct net_device *ndev, | |
82 | +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0)) | |
83 | enum nl80211_iftype type, u32 *flags, | |
84 | +#else | |
85 | + enum nl80211_iftype type, | |
86 | +#endif | |
87 | struct vif_params *params) | |
88 | { | |
89 | enum nl80211_iftype old_type; | |
90 | @@ -3882,7 +3882,11 @@ | |
91 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)) | |
92 | unsigned char name_assign_type, | |
93 | #endif | |
94 | +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0)) | |
95 | enum nl80211_iftype type, u32 *flags, struct vif_params *params) | |
96 | +#else | |
97 | + enum nl80211_iftype type, struct vif_params *params) | |
98 | +#endif | |
99 | { | |
100 | int ret = 0; | |
101 | struct net_device* ndev = NULL; |