From a524c290c2f657b241780d70b7026fbe4096fa61 Mon Sep 17 00:00:00 2001 From: Andreas Voegele Date: Wed, 23 May 2018 00:38:22 +0100 Subject: network/broadcom-sta: Updated for Linux kernel 4.16. Older kernel versions are still supported. Signed-off-by: David Spencer --- network/broadcom-sta/001-null-pointer-fix.patch | 27 ---- network/broadcom-sta/002-rdtscl.patch | 18 --- network/broadcom-sta/README | 25 +-- network/broadcom-sta/broadcom-sta.SlackBuild | 18 ++- network/broadcom-sta/linux48.patch | 52 ------- network/broadcom-sta/patches/04-user_ioctl.patch | 22 +++ .../patches/05-remove-time-and-date-macros.patch | 29 ++++ ....30.223.248-linux-3.18-null-pointer-crash.patch | 19 +++ network/broadcom-sta/patches/14-rdtscl.patch | 22 +++ network/broadcom-sta/patches/15-linux47.patch | 122 +++++++++++++++ network/broadcom-sta/patches/16-linux48.patch | 66 ++++++++ .../patches/17-fix-kernel-warnings.patch | 172 +++++++++++++++++++++ network/broadcom-sta/patches/18-linux411.patch | 49 ++++++ network/broadcom-sta/patches/19-linux412.patch | 75 +++++++++ network/broadcom-sta/patches/20-linux414.patch | 38 +++++ network/broadcom-sta/patches/21-linux415.patch | 67 ++++++++ 16 files changed, 709 insertions(+), 112 deletions(-) delete mode 100644 network/broadcom-sta/001-null-pointer-fix.patch delete mode 100644 network/broadcom-sta/002-rdtscl.patch delete mode 100644 network/broadcom-sta/linux48.patch create mode 100644 network/broadcom-sta/patches/04-user_ioctl.patch create mode 100644 network/broadcom-sta/patches/05-remove-time-and-date-macros.patch create mode 100644 network/broadcom-sta/patches/13-broadcom-sta-6.30.223.248-linux-3.18-null-pointer-crash.patch create mode 100644 network/broadcom-sta/patches/14-rdtscl.patch create mode 100644 network/broadcom-sta/patches/15-linux47.patch create mode 100644 network/broadcom-sta/patches/16-linux48.patch create mode 100644 network/broadcom-sta/patches/17-fix-kernel-warnings.patch create mode 100644 network/broadcom-sta/patches/18-linux411.patch create mode 100644 network/broadcom-sta/patches/19-linux412.patch create mode 100644 network/broadcom-sta/patches/20-linux414.patch create mode 100644 network/broadcom-sta/patches/21-linux415.patch diff --git a/network/broadcom-sta/001-null-pointer-fix.patch b/network/broadcom-sta/001-null-pointer-fix.patch deleted file mode 100644 index adef19f30a..0000000000 --- a/network/broadcom-sta/001-null-pointer-fix.patch +++ /dev/null @@ -1,27 +0,0 @@ -Description: Fixing null pointer crash - -Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=773713 -Bug-Ubuntu: https://launchpad.net/bugs/1415880 -Last-Update: 2015-08-18 - ---- - src/wl/sys/wl_linux.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c -index 860b935..295156f 100644 ---- a/src/wl/sys/wl_linux.c -+++ b/src/wl/sys/wl_linux.c -@@ -2157,8 +2157,8 @@ wl_start(struct sk_buff *skb, struct net_device *dev) - wlif = WL_DEV_IF(dev); - wl = WL_INFO(dev); - -+ skb->prev = NULL; - if (WL_ALL_PASSIVE_ENAB(wl) || (WL_RTR() && WL_CONFIG_SMP())) { -- skb->prev = NULL; - - TXQ_LOCK(wl); - --- -1.9.1 - diff --git a/network/broadcom-sta/002-rdtscl.patch b/network/broadcom-sta/002-rdtscl.patch deleted file mode 100644 index cfa1607540..0000000000 --- a/network/broadcom-sta/002-rdtscl.patch +++ /dev/null @@ -1,18 +0,0 @@ -https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=fe47ae6e1a5005b2e82f7eab57b5c3820453293a -https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=4ea1636b04dbd66536fa387bae2eea463efc705b - -diff -ru a/src/shared/linux_osl.c b/src/shared/linux_osl.c ---- a/src/shared/linux_osl.c 2015-09-19 01:47:15.000000000 +0300 -+++ b/src/shared/linux_osl.c 2015-11-21 15:20:30.585902518 +0200 -@@ -932,7 +932,11 @@ - uint cycles; - - #if defined(__i386__) -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) -+ cycles = (u32)rdtsc(); -+#else - rdtscl(cycles); -+#endif - #else - cycles = 0; - #endif diff --git a/network/broadcom-sta/README b/network/broadcom-sta/README index 1658fab2a4..c14eef70a7 100644 --- a/network/broadcom-sta/README +++ b/network/broadcom-sta/README @@ -1,20 +1,20 @@ The broadcom-sta package includes the kernel module 'wl', which contains -the Broadcom-provided proprietary kernel driver that supports a number of -their cards. Known supported model numbers include the listed chipsets. +a Broadcom-provided proprietary kernel driver known to support the +listed chipsets. -BCM4311 (PCI IDs 14e4:4311, 14e4:4312, 14e4:4313) -BCM4312 (PCI ID 14e4:4315) -BCM4313 (PCI ID 14e4:4727) -BCM4321 (PCI IDs 14e4:4328, 14e4:4329, 14e4:432a) -BCM4322 (PCI IDs 14e4:432b, 14e4:432c, 14e4:432d) +BCM4311 (PCI ID 14e4:4311, 14e4:4312, 14e4:4313) +BCM4312 (PCI ID 14e4:4315) +BCM4313 (PCI ID 14e4:4727) +BCM4321 (PCI ID 14e4:4328, 14e4:4329, 14e4:432a) +BCM4322 (PCI ID 14e4:432b, 14e4:432c, 14e4:432d) BCM43142 (PCI ID 14e4:4365) BCM43224 (PCI ID 14e4:4353) BCM43225 (PCI ID 14e4:4357) BCM43227 (PCI ID 14e4:4358) BCM43228 (PCI ID 14e4:4359) -BCM4331 (PCI ID 14e4:4331) -BCM4360 (PCI ID 14e4:43a0) -BCM4352 (PCI ID 14e4:43b1) +BCM4331 (PCI ID 14e4:4331) +BCM4360 (PCI ID 14e4:43a0) +BCM4352 (PCI ID 14e4:43b1) Some of these devices are also supported by the free b43 and brcm80211 drivers. In order to avoid conflicts /etc/modprobe.d/b43_blacklist.conf @@ -23,6 +23,11 @@ disables these drivers. Read the included LICENSE.txt file (placed in /usr/doc) before using the proprietary driver. +To build the module for a kernel that isn't currently running on the +system, pass that kernel's "uname -r" output such as: + + KERNEL=4.4.67 ./broadcom-sta.SlackBuild + If you would like to name your interface wlan0 instead of eth1, either rename the device in /etc/udev/rules.d/70-persistent-net.rules or build the package with: diff --git a/network/broadcom-sta/broadcom-sta.SlackBuild b/network/broadcom-sta/broadcom-sta.SlackBuild index 954f22759e..dc29347d46 100644 --- a/network/broadcom-sta/broadcom-sta.SlackBuild +++ b/network/broadcom-sta/broadcom-sta.SlackBuild @@ -2,7 +2,7 @@ # Slackware build script for broadcom-sta -# Copyright 2015-2017 Andreas Voegele +# Copyright 2015-2018 Andreas Voegele # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -18,7 +18,7 @@ PRGNAM=broadcom-sta VERSION=${VERSION:-6.30.223.271} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} KERNEL=${KERNEL:-$( uname -r )} @@ -70,13 +70,21 @@ if [ "$IFNAME" != "eth" ]; then sed -i "/BRCM_WLAN_IFNAME/s/eth/$IFNAME/" src/wl/sys/wl_linux.c fi -patch -p1 < $CWD/001-null-pointer-fix.patch -patch -p1 < $CWD/002-rdtscl.patch +patch -p2 < $CWD/patches/04-user_ioctl.patch +patch -p2 < $CWD/patches/05-remove-time-and-date-macros.patch +patch -p2 < $CWD/patches/13-broadcom-sta-6.30.223.248-linux-3.18-null-pointer-crash.patch +patch -p2 < $CWD/patches/14-rdtscl.patch +#patch -p2 < $CWD/patches/15-linux47.patch if [ -n "${KERNEL##[23].*}" -a -n "${KERNEL##4.[0-6].*}" ]; then sed -i.orig 's/IEEE80211_BAND_\([25]\)GHZ/NL80211_BAND_\1GHZ/g' \ src/wl/sys/wl_cfg80211_hybrid.c fi -patch -p1 < $CWD/linux48.patch +patch -p2 < $CWD/patches/16-linux48.patch +patch -p2 < $CWD/patches/17-fix-kernel-warnings.patch +patch -p2 < $CWD/patches/18-linux411.patch +patch -p2 < $CWD/patches/19-linux412.patch +patch -p2 < $CWD/patches/20-linux414.patch +patch -p2 < $CWD/patches/21-linux415.patch env -u ARCH make -C /lib/modules/$KERNEL/build M=$(pwd) clean env -u ARCH make -C /lib/modules/$KERNEL/build M=$(pwd) diff --git a/network/broadcom-sta/linux48.patch b/network/broadcom-sta/linux48.patch deleted file mode 100644 index 0f3e819062..0000000000 --- a/network/broadcom-sta/linux48.patch +++ /dev/null @@ -1,52 +0,0 @@ -Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=839629 - ---- a/src/wl/sys/wl_cfg80211_hybrid.c 2016-10-03 10:53:55.588036464 +0200 -+++ b/src/wl/sys/wl_cfg80211_hybrid.c 2016-10-03 10:54:11.911695944 +0200 -@@ -2386,8 +2386,15 @@ - s32 err = 0; - - if (wl->scan_request) { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) -+ struct cfg80211_scan_info info = { -+ .aborted = true -+ }; - WL_DBG(("%s: Aborting scan\n", __FUNCTION__)); -- cfg80211_scan_done(wl->scan_request, true); -+ cfg80211_scan_done(wl->scan_request, &info); -+#else -+ cfg80211_scan_done(wl->scan_request, true); -+#endif - wl->scan_request = NULL; - } - -@@ -2488,7 +2495,14 @@ - - scan_done_out: - if (wl->scan_request) { -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) -+ struct cfg80211_scan_info info = { -+ .aborted = false -+ }; -+ cfg80211_scan_done(wl->scan_request, &info); -+#else - cfg80211_scan_done(wl->scan_request, false); -+#endif - wl->scan_request = NULL; - } - rtnl_unlock(); -@@ -2913,7 +2927,14 @@ - s32 err = 0; - - if (wl->scan_request) { -- cfg80211_scan_done(wl->scan_request, true); -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) -+ struct cfg80211_scan_info info = { -+ .aborted = true -+ }; -+ cfg80211_scan_done(wl->scan_request, &info); -+#else -+ cfg80211_scan_done(wl->scan_request, true); -+#endif - wl->scan_request = NULL; - } - diff --git a/network/broadcom-sta/patches/04-user_ioctl.patch b/network/broadcom-sta/patches/04-user_ioctl.patch new file mode 100644 index 0000000000..902a7d9f7d --- /dev/null +++ b/network/broadcom-sta/patches/04-user_ioctl.patch @@ -0,0 +1,22 @@ +Description: Allow normal users to send ioctl requests +Author: Cyril Lacoux +Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=672677 +Last-Update: 2012-11-19 + +Index: broadcom-sta/amd64/src/wl/sys/wl_linux.c +=================================================================== +--- broadcom-sta.orig/amd64/src/wl/sys/wl_linux.c ++++ broadcom-sta/amd64/src/wl/sys/wl_linux.c +@@ -1661,11 +1661,7 @@ wl_ioctl(struct net_device *dev, struct + } + + WL_LOCK(wl); +- if (!capable(CAP_NET_ADMIN)) { +- bcmerror = BCME_EPERM; +- } else { +- bcmerror = wlc_ioctl(wl->wlc, ioc.cmd, buf, ioc.len, wlif->wlcif); +- } ++ bcmerror = wlc_ioctl(wl->wlc, ioc.cmd, buf, ioc.len, wlif->wlcif); + WL_UNLOCK(wl); + + done1: diff --git a/network/broadcom-sta/patches/05-remove-time-and-date-macros.patch b/network/broadcom-sta/patches/05-remove-time-and-date-macros.patch new file mode 100644 index 0000000000..3cd3fc845b --- /dev/null +++ b/network/broadcom-sta/patches/05-remove-time-and-date-macros.patch @@ -0,0 +1,29 @@ +Description: Remove __TIME__ and __DATE__ macros from code +Author: Cyril Lacoux +Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=752864 +Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=754434 +Last-Update: 2014-08-13 + +Index: broadcom-sta/amd64/src/wl/sys/wl_linux.c +=================================================================== +--- broadcom-sta.orig/amd64/src/wl/sys/wl_linux.c ++++ broadcom-sta/amd64/src/wl/sys/wl_linux.c +@@ -726,7 +726,7 @@ wl_attach(uint16 vendor, uint16 device, + WL_ALL_PASSIVE_ENAB(wl) ? ", Passive Mode" : "", EPI_VERSION_STR); + + #ifdef BCMDBG +- printf(" (Compiled in " SRCBASE " at " __TIME__ " on " __DATE__ ")"); ++ printf(" (Compiled in " SRCBASE); + #endif + printf("\n"); + +@@ -2051,8 +2051,7 @@ wl_osl_pcie_rc(struct wl_info *wl, uint + void + wl_dump_ver(wl_info_t *wl, struct bcmstrbuf *b) + { +- bcm_bprintf(b, "wl%d: %s %s version %s\n", wl->pub->unit, +- __DATE__, __TIME__, EPI_VERSION_STR); ++ bcm_bprintf(b, "wl%d: version %s\n", wl->pub->unit, EPI_VERSION_STR); + } + + #if defined(BCMDBG) diff --git a/network/broadcom-sta/patches/13-broadcom-sta-6.30.223.248-linux-3.18-null-pointer-crash.patch b/network/broadcom-sta/patches/13-broadcom-sta-6.30.223.248-linux-3.18-null-pointer-crash.patch new file mode 100644 index 0000000000..9e7e811308 --- /dev/null +++ b/network/broadcom-sta/patches/13-broadcom-sta-6.30.223.248-linux-3.18-null-pointer-crash.patch @@ -0,0 +1,19 @@ +From: Hugo Osvaldo Barrera + +Downloaded from https://gist.github.com/hobarrera/ac0e6225210ac5bb13f6#file-broadcom-sta-6-30-223-248-linux-3-18-null-pointer-crash-patch + +-- +Index: broadcom-sta/amd64/src/wl/sys/wl_linux.c +=================================================================== +--- broadcom-sta.orig/amd64/src/wl/sys/wl_linux.c ++++ broadcom-sta/amd64/src/wl/sys/wl_linux.c +@@ -2162,8 +2162,8 @@ wl_start(struct sk_buff *skb, struct net + wlif = WL_DEV_IF(dev); + wl = WL_INFO(dev); + ++ skb->prev = NULL; + if (WL_ALL_PASSIVE_ENAB(wl) || (WL_RTR() && WL_CONFIG_SMP())) { +- skb->prev = NULL; + + TXQ_LOCK(wl); + diff --git a/network/broadcom-sta/patches/14-rdtscl.patch b/network/broadcom-sta/patches/14-rdtscl.patch new file mode 100644 index 0000000000..0558e98402 --- /dev/null +++ b/network/broadcom-sta/patches/14-rdtscl.patch @@ -0,0 +1,22 @@ +Since Linux 4.3, rdtscl() is no longer available and native_read_tsc() +is renamed to rdtsc(). Move the macro contents in-line and call the +new function. References: + +https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=fe47ae6e1a5005b2e82f7eab57b5c3820453293a +https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=4ea1636b04dbd66536fa387bae2eea463efc705b + +diff -ru a/src/shared/linux_osl.c b/src/shared/linux_osl.c +--- a/amd64/src/shared/linux_osl.c 2015-09-19 01:47:15.000000000 +0300 ++++ b/amd64/src/shared/linux_osl.c 2015-11-21 15:20:30.585902518 +0200 +@@ -932,7 +932,11 @@ + uint cycles; + + #if defined(__i386__) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) ++ cycles = (u32)rdtsc(); ++#else + rdtscl(cycles); ++#endif + #else + cycles = 0; + #endif diff --git a/network/broadcom-sta/patches/15-linux47.patch b/network/broadcom-sta/patches/15-linux47.patch new file mode 100644 index 0000000000..af0d04eb13 --- /dev/null +++ b/network/broadcom-sta/patches/15-linux47.patch @@ -0,0 +1,122 @@ +From: Felix Yan +Date: Mon, 20 Jun 2016 11:18:00 +0800 +Subject: linux47 +Origin: https://github.com/archlinuxcn/repo/tree/f4d6cff1cacf8dad13006fade5f96bc2cf020a9b/broadcom-wl-dkms + +Since Linux 4.7, the enum ieee80211_band is no longer used + +This shall cause no problem's since both enums ieee80211_band +and nl80211_band were added in the same commit: +https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=13ae75b103e07304a34ab40c9136e9f53e06475c + +This patch refactors the references of IEEE80211_BAND_* to NL80211_BAND_* + +Reference: +https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=57fbcce37be7c1d2622b56587c10ade00e96afa3 + +This patch is based on +https://github.com/archlinuxcn/repo/tree/f4d6cff1cacf8dad13006fade5f96bc2cf020a9b/broadcom-wl-dkms . +--- + amd64/src/wl/sys/wl_cfg80211_hybrid.c | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +diff --git a/amd64/src/wl/sys/wl_cfg80211_hybrid.c b/amd64/src/wl/sys/wl_cfg80211_hybrid.c +index 7b606e0..cc5422d 100644 +--- a/amd64/src/wl/sys/wl_cfg80211_hybrid.c ++++ b/amd64/src/wl/sys/wl_cfg80211_hybrid.c +@@ -236,7 +236,7 @@ static s8 wl_dbg_estr[][WL_DBG_ESTR_MAX] = { + #endif + + #define CHAN2G(_channel, _freq, _flags) { \ +- .band = IEEE80211_BAND_2GHZ, \ ++ .band = NL80211_BAND_2GHZ, \ + .center_freq = (_freq), \ + .hw_value = (_channel), \ + .flags = (_flags), \ +@@ -245,7 +245,7 @@ static s8 wl_dbg_estr[][WL_DBG_ESTR_MAX] = { + } + + #define CHAN5G(_channel, _flags) { \ +- .band = IEEE80211_BAND_5GHZ, \ ++ .band = NL80211_BAND_5GHZ, \ + .center_freq = 5000 + (5 * (_channel)), \ + .hw_value = (_channel), \ + .flags = (_flags), \ +@@ -379,7 +379,7 @@ static struct ieee80211_channel __wl_5ghz_n_channels[] = { + }; + + static struct ieee80211_supported_band __wl_band_2ghz = { +- .band = IEEE80211_BAND_2GHZ, ++ .band = NL80211_BAND_2GHZ, + .channels = __wl_2ghz_channels, + .n_channels = ARRAY_SIZE(__wl_2ghz_channels), + .bitrates = wl_g_rates, +@@ -387,7 +387,7 @@ static struct ieee80211_supported_band __wl_band_2ghz = { + }; + + static struct ieee80211_supported_band __wl_band_5ghz_a = { +- .band = IEEE80211_BAND_5GHZ, ++ .band = NL80211_BAND_5GHZ, + .channels = __wl_5ghz_a_channels, + .n_channels = ARRAY_SIZE(__wl_5ghz_a_channels), + .bitrates = wl_a_rates, +@@ -395,7 +395,7 @@ static struct ieee80211_supported_band __wl_band_5ghz_a = { + }; + + static struct ieee80211_supported_band __wl_band_5ghz_n = { +- .band = IEEE80211_BAND_5GHZ, ++ .band = NL80211_BAND_5GHZ, + .channels = __wl_5ghz_n_channels, + .n_channels = ARRAY_SIZE(__wl_5ghz_n_channels), + .bitrates = wl_a_rates, +@@ -1876,8 +1876,8 @@ static s32 wl_alloc_wdev(struct device *dev, struct wireless_dev **rwdev) + wdev->wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX; + #endif + wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC); +- wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = &__wl_band_2ghz; +- wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_a; ++ wdev->wiphy->bands[NL80211_BAND_2GHZ] = &__wl_band_2ghz; ++ wdev->wiphy->bands[NL80211_BAND_5GHZ] = &__wl_band_5ghz_a; + wdev->wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; + wdev->wiphy->cipher_suites = __wl_cipher_suites; + wdev->wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites); +@@ -2000,7 +2000,7 @@ static s32 wl_inform_single_bss(struct wl_cfg80211_priv *wl, struct wl_bss_info + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39) + freq = ieee80211_channel_to_frequency(notif_bss_info->channel, + (notif_bss_info->channel <= CH_MAX_2G_CHANNEL) ? +- IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ); ++ NL80211_BAND_2GHZ : NL80211_BAND_5GHZ); + #else + freq = ieee80211_channel_to_frequency(notif_bss_info->channel); + #endif +@@ -2116,7 +2116,7 @@ wl_notify_connect_status(struct wl_cfg80211_priv *wl, struct net_device *ndev, + return err; + } + chan = wf_chspec_ctlchan(chanspec); +- band = (chan <= CH_MAX_2G_CHANNEL) ? IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ; ++ band = (chan <= CH_MAX_2G_CHANNEL) ? NL80211_BAND_2GHZ : NL80211_BAND_5GHZ; + freq = ieee80211_channel_to_frequency(chan, band); + channel = ieee80211_get_channel(wiphy, freq); + cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, channel, GFP_KERNEL); +@@ -2250,10 +2250,10 @@ static void wl_ch_to_chanspec(struct ieee80211_channel *chan, struct wl_join_par + join_params->params.chanspec_list[0] = + ieee80211_frequency_to_channel(chan->center_freq); + +- if (chan->band == IEEE80211_BAND_2GHZ) { ++ if ( (int) chan->band == (int) NL80211_BAND_2GHZ) { + chanspec |= WL_CHANSPEC_BAND_2G; + } +- else if (chan->band == IEEE80211_BAND_5GHZ) { ++ else if ( (int) chan->band == (int) NL80211_BAND_5GHZ) { + chanspec |= WL_CHANSPEC_BAND_5G; + } + else { +@@ -2885,7 +2885,7 @@ static s32 wl_update_wiphybands(struct wl_cfg80211_priv *wl) + + if (phy == 'n' || phy == 'a' || phy == 'v') { + wiphy = wl_to_wiphy(wl); +- wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_n; ++ wiphy->bands[NL80211_BAND_5GHZ] = &__wl_band_5ghz_n; + } + + return err; diff --git a/network/broadcom-sta/patches/16-linux48.patch b/network/broadcom-sta/patches/16-linux48.patch new file mode 100644 index 0000000000..63bdc56e3e --- /dev/null +++ b/network/broadcom-sta/patches/16-linux48.patch @@ -0,0 +1,66 @@ +From: koos vriezen +Date: Mon, 3 Oct 2016 10:54:11 +0200 +Subject: linux48 +Origin: https://bugs.debian.org/ + +Looking at the patch for kernel 4.8, I came up with the attached patch +(and I send this mail while running it :) + +Thanks, +Koos Vriezen +--- + amd64/src/wl/sys/wl_cfg80211_hybrid.c | 25 +++++++++++++++++++++++-- + 1 file changed, 23 insertions(+), 2 deletions(-) + +diff --git a/amd64/src/wl/sys/wl_cfg80211_hybrid.c b/amd64/src/wl/sys/wl_cfg80211_hybrid.c +index cc5422d..05b9fd3 100644 +--- a/amd64/src/wl/sys/wl_cfg80211_hybrid.c ++++ b/amd64/src/wl/sys/wl_cfg80211_hybrid.c +@@ -2386,8 +2386,15 @@ wl_bss_connect_done(struct wl_cfg80211_priv *wl, struct net_device *ndev, + s32 err = 0; + + if (wl->scan_request) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) ++ struct cfg80211_scan_info info = { ++ .aborted = true ++ }; + WL_DBG(("%s: Aborting scan\n", __FUNCTION__)); +- cfg80211_scan_done(wl->scan_request, true); ++ cfg80211_scan_done(wl->scan_request, &info); ++#else ++ cfg80211_scan_done(wl->scan_request, true); ++#endif + wl->scan_request = NULL; + } + +@@ -2488,7 +2495,14 @@ wl_notify_scan_status(struct wl_cfg80211_priv *wl, struct net_device *ndev, + + scan_done_out: + if (wl->scan_request) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) ++ struct cfg80211_scan_info info = { ++ .aborted = false ++ }; ++ cfg80211_scan_done(wl->scan_request, &info); ++#else + cfg80211_scan_done(wl->scan_request, false); ++#endif + wl->scan_request = NULL; + } + rtnl_unlock(); +@@ -2913,7 +2927,14 @@ s32 wl_cfg80211_down(struct net_device *ndev) + s32 err = 0; + + if (wl->scan_request) { +- cfg80211_scan_done(wl->scan_request, true); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) ++ struct cfg80211_scan_info info = { ++ .aborted = true ++ }; ++ cfg80211_scan_done(wl->scan_request, &info); ++#else ++ cfg80211_scan_done(wl->scan_request, true); ++#endif + wl->scan_request = NULL; + } + diff --git a/network/broadcom-sta/patches/17-fix-kernel-warnings.patch b/network/broadcom-sta/patches/17-fix-kernel-warnings.patch new file mode 100644 index 0000000000..c8a2ae8199 --- /dev/null +++ b/network/broadcom-sta/patches/17-fix-kernel-warnings.patch @@ -0,0 +1,172 @@ +From: Luis Ortega +Date: Sun, 6 Nov 2016 12:15:10 +0100 +Subject: fix-kernel-warnings +Origin: https://bugs.debian.org/843387 + +--- + amd64/src/wl/sys/wl_cfg80211_hybrid.c | 87 ++++++++++++++++++++++++----------- + 1 file changed, 60 insertions(+), 27 deletions(-) + +diff --git a/amd64/src/wl/sys/wl_cfg80211_hybrid.c b/amd64/src/wl/sys/wl_cfg80211_hybrid.c +index 05b9fd3..551fe1f 100644 +--- a/amd64/src/wl/sys/wl_cfg80211_hybrid.c ++++ b/amd64/src/wl/sys/wl_cfg80211_hybrid.c +@@ -1968,7 +1968,7 @@ static s32 wl_inform_single_bss(struct wl_cfg80211_priv *wl, struct wl_bss_info + + if (dtoh32(bi->length) > WL_BSS_INFO_MAX) { + WL_DBG(("Beacon is larger than buffer. Discarding\n")); +- return err; ++ return -E2BIG; + } + notif_bss_info = kzalloc(sizeof(*notif_bss_info) + sizeof(*mgmt) - sizeof(u8) + + WL_BSS_INFO_MAX, GFP_KERNEL); +@@ -1992,9 +1992,15 @@ static s32 wl_inform_single_bss(struct wl_cfg80211_priv *wl, struct wl_bss_info + beacon_proberesp->capab_info = cpu_to_le16(bi->capability); + wl_rst_ie(wl); + +- wl_mrg_ie(wl, ((u8 *) bi) + bi->ie_offset, bi->ie_length); +- wl_cp_ie(wl, beacon_proberesp->variable, WL_BSS_INFO_MAX - ++ err = wl_mrg_ie(wl, ((u8 *) bi) + bi->ie_offset, bi->ie_length); ++ if (err) ++ goto inform_single_bss_out; ++ ++ err = wl_cp_ie(wl, beacon_proberesp->variable, WL_BSS_INFO_MAX - + offsetof(struct wl_cfg80211_bss_info, frame_buf)); ++ if (err) ++ goto inform_single_bss_out; ++ + notif_bss_info->frame_len = offsetof(struct ieee80211_mgmt, u.beacon.variable) + + wl_get_ielen(wl); + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39) +@@ -2006,14 +2012,14 @@ static s32 wl_inform_single_bss(struct wl_cfg80211_priv *wl, struct wl_bss_info + #endif + if (freq == 0) { + WL_ERR(("Invalid channel, fail to chcnage channel to freq\n")); +- kfree(notif_bss_info); +- return -EINVAL; ++ err = -EINVAL; ++ goto inform_single_bss_out; + } + channel = ieee80211_get_channel(wiphy, freq); + if (unlikely(!channel)) { + WL_ERR(("ieee80211_get_channel error\n")); +- kfree(notif_bss_info); +- return -EINVAL; ++ err = -EINVAL; ++ goto inform_single_bss_out; + } + + WL_DBG(("SSID : \"%s\", rssi %d, channel %d, capability : 0x04%x, bssid %pM\n", +@@ -2021,28 +2027,37 @@ static s32 wl_inform_single_bss(struct wl_cfg80211_priv *wl, struct wl_bss_info + mgmt->u.beacon.capab_info, &bi->BSSID)); + + signal = notif_bss_info->rssi * 100; +- cbss = cfg80211_inform_bss_frame(wiphy, channel, mgmt, +- le16_to_cpu(notif_bss_info->frame_len), signal, GFP_KERNEL); +- if (unlikely(!cbss)) { +- WL_ERR(("cfg80211_inform_bss_frame error\n")); +- kfree(notif_bss_info); +- return -EINVAL; +- } + +- notify_ie = (u8 *)bi + le16_to_cpu(bi->ie_offset); +- notify_ielen = le32_to_cpu(bi->ie_length); ++ if (!wl->scan_request) { ++ cbss = cfg80211_inform_bss_frame(wiphy, channel, mgmt, ++ le16_to_cpu(notif_bss_info->frame_len), signal, GFP_KERNEL); ++ if (unlikely(!cbss)) { ++ WL_ERR(("cfg80211_inform_bss_frame error\n")); ++ err = -ENOMEM; ++ goto inform_single_bss_out; ++ } ++ } else { ++ notify_ie = (u8 *)bi + le16_to_cpu(bi->ie_offset); ++ notify_ielen = le32_to_cpu(bi->ie_length); + #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) +- cbss = cfg80211_inform_bss(wiphy, channel, (const u8 *)(bi->BSSID.octet), +- 0, beacon_proberesp->capab_info, beacon_proberesp->beacon_int, +- (const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL); ++ cbss = cfg80211_inform_bss(wiphy, channel, (const u8 *)(bi->BSSID.octet), ++ 0, beacon_proberesp->capab_info, beacon_proberesp->beacon_int, ++ (const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL); + #else +- cbss = cfg80211_inform_bss(wiphy, channel, CFG80211_BSS_FTYPE_UNKNOWN, (const u8 *)(bi->BSSID.octet), +- 0, beacon_proberesp->capab_info, beacon_proberesp->beacon_int, +- (const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL); ++ cbss = cfg80211_inform_bss(wiphy, channel, ++ wl->active_scan ? ++ CFG80211_BSS_FTYPE_PRESP : CFG80211_BSS_FTYPE_BEACON, ++ (const u8 *)(bi->BSSID.octet), 0, ++ beacon_proberesp->capab_info, ++ beacon_proberesp->beacon_int, ++ (const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL); + #endif +- +- if (unlikely(!cbss)) +- return -ENOMEM; ++ if (unlikely(!cbss)) { ++ WL_ERR(("cfg80211_inform_bss error\n")); ++ err = -ENOMEM; ++ goto inform_single_bss_out; ++ } ++ } + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) + cfg80211_put_bss(wiphy, cbss); +@@ -2050,6 +2065,7 @@ static s32 wl_inform_single_bss(struct wl_cfg80211_priv *wl, struct wl_bss_info + cfg80211_put_bss(cbss); + #endif + ++inform_single_bss_out: + kfree(notif_bss_info); + + return err; +@@ -2316,6 +2332,9 @@ static s32 wl_update_bss_info(struct wl_cfg80211_priv *wl) + if (err) + goto update_bss_info_out; + ++ bss = cfg80211_get_bss(wl_to_wiphy(wl), NULL, (s8 *)&wl->bssid, ++ ssid->SSID, ssid->SSID_len, WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); ++ + ie = ((u8 *)bi) + bi->ie_offset; + ie_len = bi->ie_length; + } else { +@@ -2328,11 +2347,18 @@ static s32 wl_update_bss_info(struct wl_cfg80211_priv *wl) + ie_len = bss->len_information_elements; + #endif + wl->conf->channel = *bss->channel; ++ } ++ ++ if (bss) { + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) + cfg80211_put_bss(wiphy, bss); + #else + cfg80211_put_bss(bss); + #endif ++ } else { ++ WL_DBG(("Could not update BSS\n")); ++ err = -EINVAL; ++ goto update_bss_info_out; + } + + tim = bcm_parse_tlvs(ie, ie_len, WLAN_EID_TIM); +@@ -2360,10 +2386,17 @@ wl_bss_roaming_done(struct wl_cfg80211_priv *wl, struct net_device *ndev, + struct wl_cfg80211_connect_info *conn_info = wl_to_conn(wl); + s32 err = 0; + +- wl_get_assoc_ies(wl); ++ err = wl_get_assoc_ies(wl); ++ if (err) ++ return err; ++ + memcpy(wl->profile->bssid, &e->addr, ETHER_ADDR_LEN); + memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN); +- wl_update_bss_info(wl); ++ ++ err = wl_update_bss_info(wl); ++ if (err) ++ return err; ++ + cfg80211_roamed(ndev, + #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) + &wl->conf->channel, diff --git a/network/broadcom-sta/patches/18-linux411.patch b/network/broadcom-sta/patches/18-linux411.patch new file mode 100644 index 0000000000..bc9a9508be --- /dev/null +++ b/network/broadcom-sta/patches/18-linux411.patch @@ -0,0 +1,49 @@ +From: koos vriezen +Date: Mon, 1 May 2017 18:28:01 +0200 +Subject: Compile fix with kernel 4.11 +Origin: http://bugs.debian.org/861807 +Forwarded: no +Reviewed-By: Eduard Bloch +Last-Update: 2017-05-04 + + I use the attached patch to get this module compiled with 4.11. Works + for me since last sunday. + Apparently https://aur.archlinux.org/cgit/aur.git/tree/linux411.patch?h=broadcom-wl + has come with a different patch for the removed last_rx field in + netdevice. But judging the commit log + https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/include/linux/netdevice.h?id=4a7c972644c1151f6dd34ff4b5f7eacb239e22ee + and the fact that last_rx isn't used elsewhere I came up with just + ifdef it out. +--- + amd64/src/wl/sys/wl_cfg80211_hybrid.c | 3 +++ + amd64/src/wl/sys/wl_linux.c | 2 ++ + 2 files changed, 5 insertions(+) + +diff --git a/amd64/src/wl/sys/wl_cfg80211_hybrid.c b/amd64/src/wl/sys/wl_cfg80211_hybrid.c +index 551fe1f..83930ec 100644 +--- a/amd64/src/wl/sys/wl_cfg80211_hybrid.c ++++ b/amd64/src/wl/sys/wl_cfg80211_hybrid.c +@@ -30,6 +30,9 @@ + #include + #include + #include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) ++#include ++#endif + #include + #include + #include +diff --git a/amd64/src/wl/sys/wl_linux.c b/amd64/src/wl/sys/wl_linux.c +index b7fbe28..77dc327 100644 +--- a/amd64/src/wl/sys/wl_linux.c ++++ b/amd64/src/wl/sys/wl_linux.c +@@ -2912,7 +2912,9 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rxsts, void *p) + if (skb == NULL) return; + + skb->dev = wl->monitor_dev; ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) + skb->dev->last_rx = jiffies; ++#endif + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) + skb_reset_mac_header(skb); + #else diff --git a/network/broadcom-sta/patches/19-linux412.patch b/network/broadcom-sta/patches/19-linux412.patch new file mode 100644 index 0000000000..c88b9e1023 --- /dev/null +++ b/network/broadcom-sta/patches/19-linux412.patch @@ -0,0 +1,75 @@ +From: koos vriezen +Date: Mon, 3 Jul 2017 09:57:21 +0200 +Subject: linux412 +Origin: https://bugs.debian.org/867258 + +--- + amd64/src/wl/sys/wl_cfg80211_hybrid.c | 29 +++++++++++++++++++++++++---- + 1 file changed, 25 insertions(+), 4 deletions(-) + +diff --git a/amd64/src/wl/sys/wl_cfg80211_hybrid.c b/amd64/src/wl/sys/wl_cfg80211_hybrid.c +index 83930ec..1ec2ef3 100644 +--- a/amd64/src/wl/sys/wl_cfg80211_hybrid.c ++++ b/amd64/src/wl/sys/wl_cfg80211_hybrid.c +@@ -53,7 +53,11 @@ u32 wl_dbg_level = WL_DBG_ERR; + #endif + + static s32 wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, +- enum nl80211_iftype type, u32 *flags, struct vif_params *params); ++ enum nl80211_iftype type, ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0) ++ u32 *flags, ++#endif ++ struct vif_params *params); + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) + static s32 + wl_cfg80211_scan(struct wiphy *wiphy, +@@ -466,8 +470,11 @@ wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len) + + static s32 + wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, +- enum nl80211_iftype type, u32 *flags, +- struct vif_params *params) ++ enum nl80211_iftype type, ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0) ++ u32 *flags, ++#endif ++ struct vif_params *params) + { + struct wl_cfg80211_priv *wl = wiphy_to_wl(wiphy); + struct wireless_dev *wdev; +@@ -2387,6 +2394,15 @@ wl_bss_roaming_done(struct wl_cfg80211_priv *wl, struct net_device *ndev, + const wl_event_msg_t *e, void *data) + { + struct wl_cfg80211_connect_info *conn_info = wl_to_conn(wl); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++ struct cfg80211_roam_info roam_info = { ++ .bssid = wl->profile->bssid, ++ .req_ie = conn_info->req_ie, ++ .req_ie_len = conn_info->req_ie_len, ++ .resp_ie = conn_info->resp_ie, ++ .resp_ie_len = conn_info->resp_ie_len, ++ }; ++#endif + s32 err = 0; + + err = wl_get_assoc_ies(wl); +@@ -2401,12 +2417,17 @@ wl_bss_roaming_done(struct wl_cfg80211_priv *wl, struct net_device *ndev, + return err; + + cfg80211_roamed(ndev, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++ &roam_info, ++#else + #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) + &wl->conf->channel, + #endif + (u8 *)&wl->bssid, + conn_info->req_ie, conn_info->req_ie_len, +- conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL); ++ conn_info->resp_ie, conn_info->resp_ie_len, ++#endif ++ GFP_KERNEL); + WL_DBG(("Report roaming result\n")); + + set_bit(WL_STATUS_CONNECTED, &wl->status); diff --git a/network/broadcom-sta/patches/20-linux414.patch b/network/broadcom-sta/patches/20-linux414.patch new file mode 100644 index 0000000000..f785a99edb --- /dev/null +++ b/network/broadcom-sta/patches/20-linux414.patch @@ -0,0 +1,38 @@ +From: Gerardo Esteban Malazdrewicz +Date: Fri, 29 Dec 2017 23:44:24 -0400 +Subject: linux414 +Origin: https://bugs.debian.org/885885 + +linux 4.14 changed the kernel_read function prototype. + +--- + amd64/src/shared/linux_osl.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/amd64/src/shared/linux_osl.c b/amd64/src/shared/linux_osl.c +index 9adc392..3aa48bf 100644 +--- a/amd64/src/shared/linux_osl.c ++++ b/amd64/src/shared/linux_osl.c +@@ -1076,11 +1076,21 @@ osl_os_get_image_block(char *buf, int len, void *image) + { + struct file *fp = (struct file *)image; + int rdlen; ++ loff_t pos; + + if (!image) + return 0; + +- rdlen = kernel_read(fp, fp->f_pos, buf, len); ++ pos = fp->f_pos; ++ rdlen = kernel_read(fp, ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0) ++ pos, ++#endif ++ buf, len ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) ++ ,&pos ++#endif ++ ); + if (rdlen > 0) + fp->f_pos += rdlen; + diff --git a/network/broadcom-sta/patches/21-linux415.patch b/network/broadcom-sta/patches/21-linux415.patch new file mode 100644 index 0000000000..2cd8c2532e --- /dev/null +++ b/network/broadcom-sta/patches/21-linux415.patch @@ -0,0 +1,67 @@ +From: Gerardo Esteban Malazdrewicz +Date: Sat, 30 Dec 2017 12:32:29 -0400 +Subject: linux415 +Origin: https://bugs.debian.org/885885 + +linux 4.15 deprecated the init_timer function. + +--- + amd64/src/wl/sys/wl_linux.c | 28 ++++++++++++++++++++++++---- + 1 file changed, 24 insertions(+), 4 deletions(-) + +diff --git a/amd64/src/wl/sys/wl_linux.c b/amd64/src/wl/sys/wl_linux.c +index 77dc327..ab7b883 100644 +--- a/amd64/src/wl/sys/wl_linux.c ++++ b/amd64/src/wl/sys/wl_linux.c +@@ -93,7 +93,13 @@ struct iw_statistics *wl_get_wireless_stats(struct net_device *dev); + + #include + +-static void wl_timer(ulong data); ++static void wl_timer( ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) ++ struct timer_list *tl ++#else ++ ulong data ++#endif ++ ); + static void _wl_timer(wl_timer_t *t); + static struct net_device *wl_alloc_linux_if(wl_if_t *wlif); + +@@ -2295,9 +2301,19 @@ wl_timer_task(wl_task_t *task) + } + + static void +-wl_timer(ulong data) +-{ +- wl_timer_t *t = (wl_timer_t *)data; ++wl_timer( ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) ++ struct timer_list *tl ++#else ++ ulong data ++#endif ++) { ++ wl_timer_t *t = ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) ++ from_timer(t, tl, timer); ++#else ++ (wl_timer_t *)data; ++#endif + + if (!WL_ALL_PASSIVE_ENAB(t->wl)) + _wl_timer(t); +@@ -2349,9 +2365,13 @@ wl_init_timer(wl_info_t *wl, void (*fn)(void *arg), void *arg, const char *tname + + bzero(t, sizeof(wl_timer_t)); + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) ++ timer_setup(&t->timer, wl_timer, 0); ++#else + init_timer(&t->timer); + t->timer.data = (ulong) t; + t->timer.function = wl_timer; ++#endif + t->wl = wl; + t->fn = fn; + t->arg = arg; -- cgit v1.2.3