external/kernel-drivers
修订版 | 2fa6455211d41eb586da726ff16885de9fa86539 (tree) |
---|---|
时间 | 2020-01-21 13:18:40 |
作者 | Chih-Wei Huang <cwhuang@open...> |
Commiter | Chih-Wei Huang |
Update patches of wl driver
From https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/broadcom-wl-dkms
@@ -0,0 +1,22 @@ | ||
1 | +Since Linux 4.3, rdtscl() is no longer available and native_read_tsc() | |
2 | +is renamed to rdtsc(). Move the macro contents in-line and call the | |
3 | +new function. References: | |
4 | + | |
5 | +https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=fe47ae6e1a5005b2e82f7eab57b5c3820453293a | |
6 | +https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=4ea1636b04dbd66536fa387bae2eea463efc705b | |
7 | + | |
8 | +diff -ru a/src/shared/linux_osl.c b/src/shared/linux_osl.c | |
9 | +--- a/src/shared/linux_osl.c 2015-09-19 01:47:15.000000000 +0300 | |
10 | ++++ b/src/shared/linux_osl.c 2015-11-21 15:20:30.585902518 +0200 | |
11 | +@@ -932,7 +932,11 @@ | |
12 | + uint cycles; | |
13 | + | |
14 | + #if defined(__i386__) | |
15 | ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) | |
16 | ++ cycles = (u32)rdtsc(); | |
17 | ++#else | |
18 | + rdtscl(cycles); | |
19 | ++#endif | |
20 | + #else | |
21 | + cycles = 0; | |
22 | + #endif |
@@ -0,0 +1,109 @@ | ||
1 | +Since Linux 4.7, the enum ieee80211_band is no longer used | |
2 | + | |
3 | +This shall cause no problem's since both enums ieee80211_band | |
4 | +and nl80211_band were added in the same commit: | |
5 | +https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=13ae75b103e07304a34ab40c9136e9f53e06475c | |
6 | + | |
7 | +This patch refactors the references of IEEE80211_BAND_* to NL80211_BAND_* | |
8 | + | |
9 | +Reference: | |
10 | +https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=57fbcce37be7c1d2622b56587c10ade00e96afa3 | |
11 | + | |
12 | +--- a/src/wl/sys/wl_cfg80211_hybrid.c 2016-06-13 11:57:36.159340297 -0500 | |
13 | ++++ b/src/wl/sys/wl_cfg80211_hybrid.c 2016-06-13 11:58:18.442323435 -0500 | |
14 | +@@ -236,7 +236,7 @@ | |
15 | + #endif | |
16 | + | |
17 | + #define CHAN2G(_channel, _freq, _flags) { \ | |
18 | +- .band = IEEE80211_BAND_2GHZ, \ | |
19 | ++ .band = NL80211_BAND_2GHZ, \ | |
20 | + .center_freq = (_freq), \ | |
21 | + .hw_value = (_channel), \ | |
22 | + .flags = (_flags), \ | |
23 | +@@ -245,7 +245,7 @@ | |
24 | + } | |
25 | + | |
26 | + #define CHAN5G(_channel, _flags) { \ | |
27 | +- .band = IEEE80211_BAND_5GHZ, \ | |
28 | ++ .band = NL80211_BAND_5GHZ, \ | |
29 | + .center_freq = 5000 + (5 * (_channel)), \ | |
30 | + .hw_value = (_channel), \ | |
31 | + .flags = (_flags), \ | |
32 | +@@ -379,7 +379,7 @@ | |
33 | + }; | |
34 | + | |
35 | + static struct ieee80211_supported_band __wl_band_2ghz = { | |
36 | +- .band = IEEE80211_BAND_2GHZ, | |
37 | ++ .band = NL80211_BAND_2GHZ, | |
38 | + .channels = __wl_2ghz_channels, | |
39 | + .n_channels = ARRAY_SIZE(__wl_2ghz_channels), | |
40 | + .bitrates = wl_g_rates, | |
41 | +@@ -387,7 +387,7 @@ | |
42 | + }; | |
43 | + | |
44 | + static struct ieee80211_supported_band __wl_band_5ghz_a = { | |
45 | +- .band = IEEE80211_BAND_5GHZ, | |
46 | ++ .band = NL80211_BAND_5GHZ, | |
47 | + .channels = __wl_5ghz_a_channels, | |
48 | + .n_channels = ARRAY_SIZE(__wl_5ghz_a_channels), | |
49 | + .bitrates = wl_a_rates, | |
50 | +@@ -395,7 +395,7 @@ | |
51 | + }; | |
52 | + | |
53 | + static struct ieee80211_supported_band __wl_band_5ghz_n = { | |
54 | +- .band = IEEE80211_BAND_5GHZ, | |
55 | ++ .band = NL80211_BAND_5GHZ, | |
56 | + .channels = __wl_5ghz_n_channels, | |
57 | + .n_channels = ARRAY_SIZE(__wl_5ghz_n_channels), | |
58 | + .bitrates = wl_a_rates, | |
59 | +@@ -1876,8 +1876,8 @@ | |
60 | + wdev->wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX; | |
61 | + #endif | |
62 | + wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC); | |
63 | +- wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = &__wl_band_2ghz; | |
64 | +- wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_a; | |
65 | ++ wdev->wiphy->bands[NL80211_BAND_2GHZ] = &__wl_band_2ghz; | |
66 | ++ wdev->wiphy->bands[NL80211_BAND_5GHZ] = &__wl_band_5ghz_a; | |
67 | + wdev->wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; | |
68 | + wdev->wiphy->cipher_suites = __wl_cipher_suites; | |
69 | + wdev->wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites); | |
70 | +@@ -2000,7 +2000,7 @@ | |
71 | + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39) | |
72 | + freq = ieee80211_channel_to_frequency(notif_bss_info->channel, | |
73 | + (notif_bss_info->channel <= CH_MAX_2G_CHANNEL) ? | |
74 | +- IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ); | |
75 | ++ NL80211_BAND_2GHZ : NL80211_BAND_5GHZ); | |
76 | + #else | |
77 | + freq = ieee80211_channel_to_frequency(notif_bss_info->channel); | |
78 | + #endif | |
79 | +@@ -2116,7 +2116,7 @@ | |
80 | + return err; | |
81 | + } | |
82 | + chan = wf_chspec_ctlchan(chanspec); | |
83 | +- band = (chan <= CH_MAX_2G_CHANNEL) ? IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ; | |
84 | ++ band = (chan <= CH_MAX_2G_CHANNEL) ? NL80211_BAND_2GHZ : NL80211_BAND_5GHZ; | |
85 | + freq = ieee80211_channel_to_frequency(chan, band); | |
86 | + channel = ieee80211_get_channel(wiphy, freq); | |
87 | + cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, channel, GFP_KERNEL); | |
88 | +@@ -2250,10 +2250,10 @@ | |
89 | + join_params->params.chanspec_list[0] = | |
90 | + ieee80211_frequency_to_channel(chan->center_freq); | |
91 | + | |
92 | +- if (chan->band == IEEE80211_BAND_2GHZ) { | |
93 | ++ if (chan->band == NL80211_BAND_2GHZ) { | |
94 | + chanspec |= WL_CHANSPEC_BAND_2G; | |
95 | + } | |
96 | +- else if (chan->band == IEEE80211_BAND_5GHZ) { | |
97 | ++ else if (chan->band == NL80211_BAND_5GHZ) { | |
98 | + chanspec |= WL_CHANSPEC_BAND_5G; | |
99 | + } | |
100 | + else { | |
101 | +@@ -2885,7 +2885,7 @@ | |
102 | + | |
103 | + if (phy == 'n' || phy == 'a' || phy == 'v') { | |
104 | + wiphy = wl_to_wiphy(wl); | |
105 | +- wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_n; | |
106 | ++ wiphy->bands[NL80211_BAND_5GHZ] = &__wl_band_5ghz_n; | |
107 | + } | |
108 | + | |
109 | + return err; |
@@ -0,0 +1,64 @@ | ||
1 | +From d3f93542326a06d920c6eb89b703384290d37b8b Mon Sep 17 00:00:00 2001 | |
2 | +From: Alberto Milone <alberto.milone@canonical.com> | |
3 | +Date: Fri, 2 Sep 2016 17:35:34 +0200 | |
4 | +Subject: [PATCH 1/1] Add support for Linux 4.8 | |
5 | + | |
6 | +Orginal author: Krzysztof Kolasa | |
7 | +--- | |
8 | + src/wl/sys/wl_cfg80211_hybrid.c | 22 ++++++++++++++++++++++ | |
9 | + 1 file changed, 22 insertions(+) | |
10 | + | |
11 | +diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c | |
12 | +index 2fc71fe..ec5e472 100644 | |
13 | +--- a/src/wl/sys/wl_cfg80211_hybrid.c | |
14 | ++++ b/src/wl/sys/wl_cfg80211_hybrid.c | |
15 | +@@ -2388,8 +2388,16 @@ wl_bss_connect_done(struct wl_cfg80211_priv *wl, struct net_device *ndev, | |
16 | + s32 err = 0; | |
17 | + | |
18 | + if (wl->scan_request) { | |
19 | ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) | |
20 | ++ struct cfg80211_scan_info info = { | |
21 | ++ .aborted = true, | |
22 | ++ }; | |
23 | ++ WL_DBG(("%s: Aborting scan\n", __FUNCTION__)); | |
24 | ++ cfg80211_scan_done(wl->scan_request, &info); | |
25 | ++#else | |
26 | + WL_DBG(("%s: Aborting scan\n", __FUNCTION__)); | |
27 | + cfg80211_scan_done(wl->scan_request, true); | |
28 | ++#endif | |
29 | + wl->scan_request = NULL; | |
30 | + } | |
31 | + | |
32 | +@@ -2490,7 +2498,14 @@ wl_notify_scan_status(struct wl_cfg80211_priv *wl, struct net_device *ndev, | |
33 | + | |
34 | + scan_done_out: | |
35 | + if (wl->scan_request) { | |
36 | ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) | |
37 | ++ struct cfg80211_scan_info info = { | |
38 | ++ .aborted = false, | |
39 | ++ }; | |
40 | ++ cfg80211_scan_done(wl->scan_request, &info); | |
41 | ++#else | |
42 | + cfg80211_scan_done(wl->scan_request, false); | |
43 | ++#endif | |
44 | + wl->scan_request = NULL; | |
45 | + } | |
46 | + rtnl_unlock(); | |
47 | +@@ -2909,7 +2924,14 @@ s32 wl_cfg80211_down(struct net_device *ndev) | |
48 | + s32 err = 0; | |
49 | + | |
50 | + if (wl->scan_request) { | |
51 | ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) | |
52 | ++ struct cfg80211_scan_info info = { | |
53 | ++ .aborted = true, | |
54 | ++ }; | |
55 | ++ cfg80211_scan_done(wl->scan_request, &info); | |
56 | ++#else | |
57 | + cfg80211_scan_done(wl->scan_request, true); | |
58 | ++#endif | |
59 | + wl->scan_request = NULL; | |
60 | + } | |
61 | + | |
62 | +-- | |
63 | +2.7.4 | |
64 | + |
@@ -0,0 +1,161 @@ | ||
1 | +--- a/src/wl/sys/wl_cfg80211_hybrid.c | |
2 | ++++ b/src/wl/sys/wl_cfg80211_hybrid.c | |
3 | +@@ -1968,7 +1968,7 @@ | |
4 | + | |
5 | + if (dtoh32(bi->length) > WL_BSS_INFO_MAX) { | |
6 | + WL_DBG(("Beacon is larger than buffer. Discarding\n")); | |
7 | +- return err; | |
8 | ++ return -E2BIG; | |
9 | + } | |
10 | + notif_bss_info = kzalloc(sizeof(*notif_bss_info) + sizeof(*mgmt) - sizeof(u8) + | |
11 | + WL_BSS_INFO_MAX, GFP_KERNEL); | |
12 | +@@ -1992,9 +1992,15 @@ | |
13 | + beacon_proberesp->capab_info = cpu_to_le16(bi->capability); | |
14 | + wl_rst_ie(wl); | |
15 | + | |
16 | +- wl_mrg_ie(wl, ((u8 *) bi) + bi->ie_offset, bi->ie_length); | |
17 | +- wl_cp_ie(wl, beacon_proberesp->variable, WL_BSS_INFO_MAX - | |
18 | ++ err = wl_mrg_ie(wl, ((u8 *) bi) + bi->ie_offset, bi->ie_length); | |
19 | ++ if (err) | |
20 | ++ goto inform_single_bss_out; | |
21 | ++ | |
22 | ++ err = wl_cp_ie(wl, beacon_proberesp->variable, WL_BSS_INFO_MAX - | |
23 | + offsetof(struct wl_cfg80211_bss_info, frame_buf)); | |
24 | ++ if (err) | |
25 | ++ goto inform_single_bss_out; | |
26 | ++ | |
27 | + notif_bss_info->frame_len = offsetof(struct ieee80211_mgmt, u.beacon.variable) + | |
28 | + wl_get_ielen(wl); | |
29 | + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39) | |
30 | +@@ -2006,14 +2012,14 @@ | |
31 | + #endif | |
32 | + if (freq == 0) { | |
33 | + WL_ERR(("Invalid channel, fail to chcnage channel to freq\n")); | |
34 | +- kfree(notif_bss_info); | |
35 | +- return -EINVAL; | |
36 | ++ err = -EINVAL; | |
37 | ++ goto inform_single_bss_out; | |
38 | + } | |
39 | + channel = ieee80211_get_channel(wiphy, freq); | |
40 | + if (unlikely(!channel)) { | |
41 | + WL_ERR(("ieee80211_get_channel error\n")); | |
42 | +- kfree(notif_bss_info); | |
43 | +- return -EINVAL; | |
44 | ++ err = -EINVAL; | |
45 | ++ goto inform_single_bss_out; | |
46 | + } | |
47 | + | |
48 | + WL_DBG(("SSID : \"%s\", rssi %d, channel %d, capability : 0x04%x, bssid %pM\n", | |
49 | +@@ -2021,28 +2027,37 @@ | |
50 | + mgmt->u.beacon.capab_info, &bi->BSSID)); | |
51 | + | |
52 | + signal = notif_bss_info->rssi * 100; | |
53 | +- cbss = cfg80211_inform_bss_frame(wiphy, channel, mgmt, | |
54 | +- le16_to_cpu(notif_bss_info->frame_len), signal, GFP_KERNEL); | |
55 | +- if (unlikely(!cbss)) { | |
56 | +- WL_ERR(("cfg80211_inform_bss_frame error\n")); | |
57 | +- kfree(notif_bss_info); | |
58 | +- return -EINVAL; | |
59 | +- } | |
60 | + | |
61 | +- notify_ie = (u8 *)bi + le16_to_cpu(bi->ie_offset); | |
62 | +- notify_ielen = le32_to_cpu(bi->ie_length); | |
63 | ++ if (!wl->scan_request) { | |
64 | ++ cbss = cfg80211_inform_bss_frame(wiphy, channel, mgmt, | |
65 | ++ le16_to_cpu(notif_bss_info->frame_len), signal, GFP_KERNEL); | |
66 | ++ if (unlikely(!cbss)) { | |
67 | ++ WL_ERR(("cfg80211_inform_bss_frame error\n")); | |
68 | ++ err = -ENOMEM; | |
69 | ++ goto inform_single_bss_out; | |
70 | ++ } | |
71 | ++ } else { | |
72 | ++ notify_ie = (u8 *)bi + le16_to_cpu(bi->ie_offset); | |
73 | ++ notify_ielen = le32_to_cpu(bi->ie_length); | |
74 | + #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) | |
75 | +- cbss = cfg80211_inform_bss(wiphy, channel, (const u8 *)(bi->BSSID.octet), | |
76 | +- 0, beacon_proberesp->capab_info, beacon_proberesp->beacon_int, | |
77 | +- (const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL); | |
78 | ++ cbss = cfg80211_inform_bss(wiphy, channel, (const u8 *)(bi->BSSID.octet), | |
79 | ++ 0, beacon_proberesp->capab_info, beacon_proberesp->beacon_int, | |
80 | ++ (const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL); | |
81 | + #else | |
82 | +- cbss = cfg80211_inform_bss(wiphy, channel, CFG80211_BSS_FTYPE_UNKNOWN, (const u8 *)(bi->BSSID.octet), | |
83 | +- 0, beacon_proberesp->capab_info, beacon_proberesp->beacon_int, | |
84 | +- (const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL); | |
85 | ++ cbss = cfg80211_inform_bss(wiphy, channel, | |
86 | ++ wl->active_scan ? | |
87 | ++ CFG80211_BSS_FTYPE_PRESP : CFG80211_BSS_FTYPE_BEACON, | |
88 | ++ (const u8 *)(bi->BSSID.octet), 0, | |
89 | ++ beacon_proberesp->capab_info, | |
90 | ++ beacon_proberesp->beacon_int, | |
91 | ++ (const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL); | |
92 | + #endif | |
93 | +- | |
94 | +- if (unlikely(!cbss)) | |
95 | +- return -ENOMEM; | |
96 | ++ if (unlikely(!cbss)) { | |
97 | ++ WL_ERR(("cfg80211_inform_bss error\n")); | |
98 | ++ err = -ENOMEM; | |
99 | ++ goto inform_single_bss_out; | |
100 | ++ } | |
101 | ++ } | |
102 | + | |
103 | + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) | |
104 | + cfg80211_put_bss(wiphy, cbss); | |
105 | +@@ -2050,6 +2065,7 @@ | |
106 | + cfg80211_put_bss(cbss); | |
107 | + #endif | |
108 | + | |
109 | ++inform_single_bss_out: | |
110 | + kfree(notif_bss_info); | |
111 | + | |
112 | + return err; | |
113 | +@@ -2316,6 +2332,9 @@ | |
114 | + if (err) | |
115 | + goto update_bss_info_out; | |
116 | + | |
117 | ++ bss = cfg80211_get_bss(wl_to_wiphy(wl), NULL, (s8 *)&wl->bssid, | |
118 | ++ ssid->SSID, ssid->SSID_len, WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); | |
119 | ++ | |
120 | + ie = ((u8 *)bi) + bi->ie_offset; | |
121 | + ie_len = bi->ie_length; | |
122 | + } else { | |
123 | +@@ -2328,11 +2347,18 @@ | |
124 | + ie_len = bss->len_information_elements; | |
125 | + #endif | |
126 | + wl->conf->channel = *bss->channel; | |
127 | ++ } | |
128 | ++ | |
129 | ++ if (bss) { | |
130 | + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) | |
131 | + cfg80211_put_bss(wiphy, bss); | |
132 | + #else | |
133 | + cfg80211_put_bss(bss); | |
134 | + #endif | |
135 | ++ } else { | |
136 | ++ WL_DBG(("Could not update BSS\n")); | |
137 | ++ err = -EINVAL; | |
138 | ++ goto update_bss_info_out; | |
139 | + } | |
140 | + | |
141 | + tim = bcm_parse_tlvs(ie, ie_len, WLAN_EID_TIM); | |
142 | +@@ -2360,10 +2386,17 @@ | |
143 | + struct wl_cfg80211_connect_info *conn_info = wl_to_conn(wl); | |
144 | + s32 err = 0; | |
145 | + | |
146 | +- wl_get_assoc_ies(wl); | |
147 | ++ err = wl_get_assoc_ies(wl); | |
148 | ++ if (err) | |
149 | ++ return err; | |
150 | ++ | |
151 | + memcpy(wl->profile->bssid, &e->addr, ETHER_ADDR_LEN); | |
152 | + memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN); | |
153 | +- wl_update_bss_info(wl); | |
154 | ++ | |
155 | ++ err = wl_update_bss_info(wl); | |
156 | ++ if (err) | |
157 | ++ return err; | |
158 | ++ | |
159 | + cfg80211_roamed(ndev, | |
160 | + #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) | |
161 | + &wl->conf->channel, |
@@ -0,0 +1,27 @@ | ||
1 | +diff -u sys0/wl_cfg80211_hybrid.c sys/wl_cfg80211_hybrid.c | |
2 | +--- a/src/wl/sys/wl_cfg80211_hybrid.c | |
3 | ++++ b/src/wl/sys/wl_cfg80211_hybrid.c | |
4 | +@@ -39,6 +39,10 @@ | |
5 | + #include <proto/802.11.h> | |
6 | + #include <wl_cfg80211_hybrid.h> | |
7 | + | |
8 | ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) | |
9 | ++#include <linux/sched/signal.h> | |
10 | ++#endif | |
11 | ++ | |
12 | + #define EVENT_TYPE(e) dtoh32((e)->event_type) | |
13 | + #define EVENT_FLAGS(e) dtoh16((e)->flags) | |
14 | + #define EVENT_STATUS(e) dtoh32((e)->status) | |
15 | +diff -u sys0/wl_linux.c sys/wl_linux.c | |
16 | +--- a/src/wl/sys/wl_linux.c | |
17 | ++++ b/src/wl/sys/wl_linux.c | |
18 | +@@ -2915,7 +2915,9 @@ | |
19 | + if (skb == NULL) return; | |
20 | + | |
21 | + skb->dev = wl->monitor_dev; | |
22 | ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) | |
23 | + skb->dev->last_rx = jiffies; | |
24 | ++#endif | |
25 | + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) | |
26 | + skb_reset_mac_header(skb); | |
27 | + #else |
@@ -2,7 +2,7 @@ diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c | ||
2 | 2 | index da36405..d3741eb 100644 |
3 | 3 | --- a/src/wl/sys/wl_cfg80211_hybrid.c |
4 | 4 | +++ b/src/wl/sys/wl_cfg80211_hybrid.c |
5 | -@@ -53,7 +53,11 @@ | |
5 | +@@ -53,7 +53,11 @@ u32 wl_dbg_level = WL_DBG_ERR; | |
6 | 6 | #endif |
7 | 7 | |
8 | 8 | static s32 wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, |
@@ -14,7 +14,7 @@ index da36405..d3741eb 100644 | ||
14 | 14 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) |
15 | 15 | static s32 |
16 | 16 | wl_cfg80211_scan(struct wiphy *wiphy, |
17 | -@@ -473,7 +477,11 @@ | |
17 | +@@ -466,7 +470,11 @@ wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len) | |
18 | 18 | |
19 | 19 | static s32 |
20 | 20 | wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, |
@@ -26,7 +26,7 @@ index da36405..d3741eb 100644 | ||
26 | 26 | struct vif_params *params) |
27 | 27 | { |
28 | 28 | struct wl_cfg80211_priv *wl = wiphy_to_wl(wiphy); |
29 | -@@ -2369,6 +2377,20 @@ | |
29 | +@@ -2361,6 +2369,20 @@ wl_bss_roaming_done(struct wl_cfg80211_priv *wl, struct net_device *ndev, | |
30 | 30 | const wl_event_msg_t *e, void *data) |
31 | 31 | { |
32 | 32 | struct wl_cfg80211_connect_info *conn_info = wl_to_conn(wl); |
@@ -47,7 +47,7 @@ index da36405..d3741eb 100644 | ||
47 | 47 | s32 err = 0; |
48 | 48 | |
49 | 49 | wl_get_assoc_ies(wl); |
50 | -@@ -2376,12 +2398,17 @@ | |
50 | +@@ -2368,12 +2390,17 @@ wl_bss_roaming_done(struct wl_cfg80211_priv *wl, struct net_device *ndev, | |
51 | 51 | memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN); |
52 | 52 | wl_update_bss_info(wl); |
53 | 53 | cfg80211_roamed(ndev, |
@@ -1,7 +1,5 @@ | ||
1 | -diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c | |
2 | -index 1270d6da22ba..ec120cf7d74c 100644 | |
3 | ---- a/src/wl/sys/wl_linux.c | |
4 | -+++ b/src/wl/sys/wl_linux.c | |
1 | +--- a/src/wl/sys/wl_linux.c 2017-07-17 00:11:24.000000000 +0100 | |
2 | ++++ b/src/wl/sys/wl_linux.c 2018-01-27 09:49:47.057799596 +0000 | |
5 | 3 | @@ -93,7 +93,11 @@ |
6 | 4 | |
7 | 5 | #include <wlc_wowl.h> |
@@ -14,7 +12,7 @@ index 1270d6da22ba..ec120cf7d74c 100644 | ||
14 | 12 | static void _wl_timer(wl_timer_t *t); |
15 | 13 | static struct net_device *wl_alloc_linux_if(wl_if_t *wlif); |
16 | 14 | |
17 | -@@ -2300,10 +2304,17 @@ | |
15 | +@@ -2297,10 +2301,17 @@ | |
18 | 16 | atomic_dec(&t->wl->callbacks); |
19 | 17 | } |
20 | 18 |
@@ -32,7 +30,7 @@ index 1270d6da22ba..ec120cf7d74c 100644 | ||
32 | 30 | |
33 | 31 | if (!WL_ALL_PASSIVE_ENAB(t->wl)) |
34 | 32 | _wl_timer(t); |
35 | -@@ -2355,9 +2366,13 @@ | |
33 | +@@ -2352,9 +2363,13 @@ | |
36 | 34 | |
37 | 35 | bzero(t, sizeof(wl_timer_t)); |
38 | 36 |
@@ -0,0 +1,10 @@ | ||
1 | +--- a/src/wl/sys/wl_cfg80211_hybrid.c 2015-09-19 00:47:30.000000000 +0200 | |
2 | ++++ b/src/wl/sys/wl_cfg80211_hybrid.c 2018-11-14 14:06:03.313487995 +0100 | |
3 | +@@ -1458,7 +1458,6 @@ | |
4 | + | |
5 | + if (memcmp(mac, wl->profile->bssid, ETHER_ADDR_LEN)) { | |
6 | + WL_ERR(("Wrong Mac address, mac = %pM profile =%pM\n", mac, wl->profile->bssid)); | |
7 | +- return -ENOENT; | |
8 | + } | |
9 | + | |
10 | + err = wl_dev_ioctl(dev, WLC_GET_RATE, &rate, sizeof(rate)); |
@@ -21,11 +21,14 @@ WL_LIB := $(WL_PATH)/lib$(if $(filter x86,$(TARGET_KERNEL_ARCH)),32,64) | ||
21 | 21 | |
22 | 22 | WL_PATCHES := \ |
23 | 23 | wl.patch \ |
24 | - linux-recent.patch \ | |
25 | - linux-48.patch \ | |
26 | - linux-411.patch \ | |
27 | - linux-412.patch \ | |
28 | - linux-415.patch \ | |
24 | + 002-rdtscl.patch \ | |
25 | + 003-linux47.patch \ | |
26 | + 004-linux48.patch \ | |
27 | + 005-debian-fix-kernel-warnings.patch \ | |
28 | + 006-linux411.patch \ | |
29 | + 007-linux412.patch \ | |
30 | + 008-linux415.patch \ | |
31 | + 009-fix_mac_profile_discrepancy.patch \ | |
29 | 32 | |
30 | 33 | $(WL_SRC): |
31 | 34 | @echo Downloading $(@F)... |
@@ -1,52 +0,0 @@ | ||
1 | -diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c | |
2 | -index a9671e2..da36405 100644 | |
3 | ---- a/src/wl/sys/wl_cfg80211_hybrid.c | |
4 | -+++ b/src/wl/sys/wl_cfg80211_hybrid.c | |
5 | -@@ -30,6 +30,9 @@ | |
6 | - #include <linux/kthread.h> | |
7 | - #include <linux/netdevice.h> | |
8 | - #include <linux/ieee80211.h> | |
9 | -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) | |
10 | -+#include <linux/sched/signal.h> | |
11 | -+#endif | |
12 | - #include <net/cfg80211.h> | |
13 | - #include <linux/nl80211.h> | |
14 | - #include <net/rtnetlink.h> | |
15 | -diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c | |
16 | -index 489c9f5..f8278ad 100644 | |
17 | ---- a/src/wl/sys/wl_linux.c | |
18 | -+++ b/src/wl/sys/wl_linux.c | |
19 | -@@ -117,6 +117,9 @@ | |
20 | - | |
21 | - typedef struct priv_link { | |
22 | - wl_if_t *wlif; | |
23 | -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) | |
24 | -+ unsigned long last_rx; | |
25 | -+#endif | |
26 | - } priv_link_t; | |
27 | - | |
28 | - #define WL_DEV_IF(dev) ((wl_if_t*)((priv_link_t*)DEV_PRIV(dev))->wlif) | |
29 | -@@ -2449,6 +2452,9 @@ | |
30 | - { | |
31 | - struct sk_buff *oskb = (struct sk_buff *)p; | |
32 | - struct sk_buff *skb; | |
33 | -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) | |
34 | -+ priv_link_t *priv_link; | |
35 | -+#endif | |
36 | - uchar *pdata; | |
37 | - uint len; | |
38 | - | |
39 | -@@ -2915,7 +2921,13 @@ | |
40 | - if (skb == NULL) return; | |
41 | - | |
42 | - skb->dev = wl->monitor_dev; | |
43 | -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) | |
44 | -+ priv_link = MALLOC(wl->osh, sizeof(priv_link_t)); | |
45 | -+ priv_link = netdev_priv(skb->dev); | |
46 | -+ priv_link->last_rx = jiffies; | |
47 | -+#else | |
48 | - skb->dev->last_rx = jiffies; | |
49 | -+#endif | |
50 | - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) | |
51 | - skb_reset_mac_header(skb); | |
52 | - #else |
@@ -1,52 +0,0 @@ | ||
1 | -Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=839629 | |
2 | - | |
3 | ---- a/src/wl/sys/wl_cfg80211_hybrid.c 2016-10-03 10:53:55.588036464 +0200 | |
4 | -+++ b/src/wl/sys/wl_cfg80211_hybrid.c 2016-10-03 10:54:11.911695944 +0200 | |
5 | -@@ -2394,8 +2394,15 @@ | |
6 | - s32 err = 0; | |
7 | - | |
8 | - if (wl->scan_request) { | |
9 | -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) | |
10 | -+ struct cfg80211_scan_info info = { | |
11 | -+ .aborted = true | |
12 | -+ }; | |
13 | - WL_DBG(("%s: Aborting scan\n", __FUNCTION__)); | |
14 | -- cfg80211_scan_done(wl->scan_request, true); | |
15 | -+ cfg80211_scan_done(wl->scan_request, &info); | |
16 | -+#else | |
17 | -+ cfg80211_scan_done(wl->scan_request, true); | |
18 | -+#endif | |
19 | - wl->scan_request = NULL; | |
20 | - } | |
21 | - | |
22 | -@@ -2496,7 +2503,14 @@ | |
23 | - | |
24 | - scan_done_out: | |
25 | - if (wl->scan_request) { | |
26 | -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) | |
27 | -+ struct cfg80211_scan_info info = { | |
28 | -+ .aborted = false | |
29 | -+ }; | |
30 | -+ cfg80211_scan_done(wl->scan_request, &info); | |
31 | -+#else | |
32 | - cfg80211_scan_done(wl->scan_request, false); | |
33 | -+#endif | |
34 | - wl->scan_request = NULL; | |
35 | - } | |
36 | - rtnl_unlock(); | |
37 | -@@ -2921,7 +2935,14 @@ | |
38 | - s32 err = 0; | |
39 | - | |
40 | - if (wl->scan_request) { | |
41 | -- cfg80211_scan_done(wl->scan_request, true); | |
42 | -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) | |
43 | -+ struct cfg80211_scan_info info = { | |
44 | -+ .aborted = true | |
45 | -+ }; | |
46 | -+ cfg80211_scan_done(wl->scan_request, &info); | |
47 | -+#else | |
48 | -+ cfg80211_scan_done(wl->scan_request, true); | |
49 | -+#endif | |
50 | - wl->scan_request = NULL; | |
51 | - } | |
52 | - |
@@ -1,38 +0,0 @@ | ||
1 | ---- a/src/shared/linux_osl.c | |
2 | -+++ b/src/shared/linux_osl.c | |
3 | -@@ -932,7 +932,11 @@ | |
4 | - uint cycles; | |
5 | - | |
6 | - #if defined(__i386__) | |
7 | -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) | |
8 | -+ cycles = (u32)rdtsc(); | |
9 | -+#else | |
10 | - rdtscl(cycles); | |
11 | -+#endif | |
12 | - #else | |
13 | - cycles = 0; | |
14 | - #endif | |
15 | ---- a/src/wl/sys/wl_cfg80211_hybrid.c | |
16 | -+++ b/src/wl/sys/wl_cfg80211_hybrid.c | |
17 | -@@ -235,6 +235,13 @@ | |
18 | - }; | |
19 | - #endif | |
20 | - | |
21 | -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)) | |
22 | -+#define ieee80211_band nl80211_band | |
23 | -+#define IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ | |
24 | -+#define IEEE80211_BAND_5GHZ NL80211_BAND_5GHZ | |
25 | -+#define IEEE80211_NUM_BANDS NUM_NL80211_BANDS | |
26 | -+#endif | |
27 | -+ | |
28 | - #define CHAN2G(_channel, _freq, _flags) { \ | |
29 | - .band = IEEE80211_BAND_2GHZ, \ | |
30 | - .center_freq = (_freq), \ | |
31 | -@@ -1872,6 +1879,7 @@ | |
32 | - } | |
33 | - set_wiphy_dev(wdev->wiphy, dev); | |
34 | - wdev->wiphy->max_scan_ssids = WL_NUM_SCAN_MAX; | |
35 | -+ wdev->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN; | |
36 | - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33) | |
37 | - wdev->wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX; | |
38 | - #endif |