From 28883bfe694fa397749e9ba2fd3b5f5894150cae Mon Sep 17 00:00:00 2001 From: Rmys Date: Tue, 8 Dec 2020 18:39:57 +0300 Subject: [PATCH] module-* --- kernel/drivers/module-bbswitch/pspec.xml | 11 +- ...com-wl-6.30.223.271-allow-user_ioctl.patch | 26 +++ ....223.271-debian-fix-dkms-build-error.patch | 32 +++ ...0.223.271-debian-fix-kernel-warnings.patch | 169 ++++++++++++++ ...-6.30.223.271-fix-null-pointer-crash.patch | 24 ++ ...broadcom-wl-6.30.223.271-ifname-wlan.patch | 19 ++ ...0.223.271-kernel-4.3-rdtscl-buildfix.patch | 27 +++ ...roadcom-wl-6.30.223.271-no-date-time.patch | 21 ++ .../files/kernel-4.14-buildfix.patch | 38 ++++ .../files/kernel-5.9-buildfix.patch | 215 ++++++++++++++++++ .../module-broadcom-wl/files/linux-4.11.patch | 65 ++---- .../module-broadcom-wl/files/linux-4.12.patch | 58 +++-- .../module-broadcom-wl/files/linux-4.15.patch | 55 ++--- .../module-broadcom-wl/files/linux-5.1.patch | 47 +++- .../module-broadcom-wl/files/linux-5.6.patch | 48 ++-- kernel/drivers/module-broadcom-wl/pspec.xml | 25 +- 16 files changed, 742 insertions(+), 138 deletions(-) create mode 100644 kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-allow-user_ioctl.patch create mode 100644 kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-debian-fix-dkms-build-error.patch create mode 100644 kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-debian-fix-kernel-warnings.patch create mode 100644 kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-fix-null-pointer-crash.patch create mode 100644 kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-ifname-wlan.patch create mode 100644 kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-kernel-4.3-rdtscl-buildfix.patch create mode 100644 kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-no-date-time.patch create mode 100644 kernel/drivers/module-broadcom-wl/files/kernel-4.14-buildfix.patch create mode 100644 kernel/drivers/module-broadcom-wl/files/kernel-5.9-buildfix.patch diff --git a/kernel/drivers/module-bbswitch/pspec.xml b/kernel/drivers/module-bbswitch/pspec.xml index abcdbf99..77fa014c 100644 --- a/kernel/drivers/module-bbswitch/pspec.xml +++ b/kernel/drivers/module-bbswitch/pspec.xml @@ -13,7 +13,7 @@ Kernel module allowing to switch dedicated graphics card on Optimus laptops kernel module allowing to switch dedicated graphics card on Optimus laptops - kernel-module-headers + kernel-module-headers https://github.com/Bumblebee-Project/bbswitch/archive/v0.8.tar.gz @@ -24,7 +24,7 @@ module-bbswitch - kernel + kernel bbswitch-common @@ -62,6 +62,13 @@ + + 2020-11-20 + 0.8 + Version bump. + Mustafa Cinasal + muscnsl@gmail.com + 2020-09-15 0.8 diff --git a/kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-allow-user_ioctl.patch b/kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-allow-user_ioctl.patch new file mode 100644 index 00000000..3a912af6 --- /dev/null +++ b/kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-allow-user_ioctl.patch @@ -0,0 +1,26 @@ + +From: Cyril Lacoux +Date: Mon, 19 Nov 2012 12:02:30 +0000 +Subject: Allow normal users to send ioctl requests +Origin: https://bugs.debian.org/672677 + +--- + src/wl/sys/wl_linux.c | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff -Nurp broadcom-wl-6.30.223.271.orig/src/wl/sys/wl_linux.c broadcom-wl-6.30.223.271/src/wl/sys/wl_linux.c +--- broadcom-wl-6.30.223.271.orig/src/wl/sys/wl_linux.c 2020-01-11 01:53:58.507062628 +0200 ++++ broadcom-wl-6.30.223.271/src/wl/sys/wl_linux.c 2020-01-11 02:06:15.233672677 +0200 +@@ -1663,11 +1663,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/kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-debian-fix-dkms-build-error.patch b/kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-debian-fix-dkms-build-error.patch new file mode 100644 index 00000000..a1a03cfc --- /dev/null +++ b/kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-debian-fix-dkms-build-error.patch @@ -0,0 +1,32 @@ +From: Roger Shimizu +Date: Fri, 17 Apr 2020 00:08:34 +0900 +Subject: Parse KERNELRELEASE into VERSION, PATCHLEVEL, and SUBLEVEL + +This fixes build error message: +==== +/bin/sh: 1: [: Illegal number: +/bin/sh: 1: [: Illegal number: +Wireless Extension is the only possible API for this kernel version +Using Wireless Extension API +==== + +Closes: #886512 +--- + Makefile | 4 ++++ + 1 files changed, 4 insertions(+) + +diff --git a/amd64/Makefile b/amd64/Makefile +index 994a146..ed16dfc 100644 +--- a/Makefile ++++ b/Makefile +@@ -20,6 +20,10 @@ + + ifneq ($(KERNELRELEASE),) + ++ VERSION := $(shell echo $(KERNELRELEASE) | sed -e 's/\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\(.*\)/\1/') ++ PATCHLEVEL := $(shell echo $(KERNELRELEASE) | sed -e 's/\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\(.*\)/\2/') ++ SUBLEVEL := $(shell echo $(KERNELRELEASE) | sed -e 's/\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\(.*\)/\3/') ++ + LINUXVER_GOODFOR_CFG80211:=$(strip $(shell \ + if [ "$(VERSION)" -ge "2" -a "$(PATCHLEVEL)" -ge "6" -a "$(SUBLEVEL)" -ge "32" -o "$(VERSION)" -ge "3" ]; then \ + echo TRUE; \ diff --git a/kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-debian-fix-kernel-warnings.patch b/kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-debian-fix-kernel-warnings.patch new file mode 100644 index 00000000..7f478070 --- /dev/null +++ b/kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-debian-fix-kernel-warnings.patch @@ -0,0 +1,169 @@ + +From debian + +--- + src/wl/sys/wl_cfg80211_hybrid.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------- + 1 file changed, 60 insertions(+), 27 deletions(-) + +diff -Nurp broadcom-wl-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c broadcom-wl-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c +--- broadcom-wl-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c 2020-01-11 01:53:58.508062673 +0200 ++++ broadcom-wl-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c 2020-01-11 01:55:42.011784473 +0200 +@@ -1984,7 +1984,7 @@ static s32 wl_inform_single_bss(struct w + + 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); +@@ -2008,9 +2008,15 @@ static s32 wl_inform_single_bss(struct w + 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) +@@ -2022,14 +2028,14 @@ static s32 wl_inform_single_bss(struct w + #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", +@@ -2037,28 +2043,37 @@ static s32 wl_inform_single_bss(struct w + 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); +@@ -2066,6 +2081,7 @@ static s32 wl_inform_single_bss(struct w + cfg80211_put_bss(cbss); + #endif + ++inform_single_bss_out: + kfree(notif_bss_info); + + return err; +@@ -2332,6 +2348,9 @@ static s32 wl_update_bss_info(struct 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 { +@@ -2344,11 +2363,18 @@ static s32 wl_update_bss_info(struct 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); +@@ -2390,10 +2416,17 @@ wl_bss_roaming_done(struct wl_cfg80211_p + #endif + 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(4, 12, 0) + &roam_info, diff --git a/kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-fix-null-pointer-crash.patch b/kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-fix-null-pointer-crash.patch new file mode 100644 index 00000000..1833b1cb --- /dev/null +++ b/kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-fix-null-pointer-crash.patch @@ -0,0 +1,24 @@ + +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 -Nurp broadcom-wl-6.30.223.271.orig/src/wl/sys/wl_linux.c broadcom-wl-6.30.223.271/src/wl/sys/wl_linux.c +--- broadcom-wl-6.30.223.271.orig/src/wl/sys/wl_linux.c 2015-09-19 01:47:30.000000000 +0300 ++++ broadcom-wl-6.30.223.271/src/wl/sys/wl_linux.c 2020-01-11 01:12:32.543692150 +0200 +@@ -2165,8 +2165,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/kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-ifname-wlan.patch b/kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-ifname-wlan.patch new file mode 100644 index 00000000..1d509fc5 --- /dev/null +++ b/kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-ifname-wlan.patch @@ -0,0 +1,19 @@ + +default interface name for wifi should be wlan, not eth + +--- + src/wl/sys/wl_linux.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff -Nurp broadcom-wl-6.30.223.271.orig/src/wl/sys/wl_linux.c broadcom-wl-6.30.223.271/src/wl/sys/wl_linux.c +--- broadcom-wl-6.30.223.271.orig/src/wl/sys/wl_linux.c 2020-01-11 02:09:00.384207338 +0200 ++++ broadcom-wl-6.30.223.271/src/wl/sys/wl_linux.c 2020-01-11 02:18:35.306461030 +0200 +@@ -221,7 +221,7 @@ module_param(nompc, int, 0); + #define to_str(s) #s + #define quote_str(s) to_str(s) + +-#define BRCM_WLAN_IFNAME eth%d ++#define BRCM_WLAN_IFNAME wlan%d + + static char intf_name[IFNAMSIZ] = quote_str(BRCM_WLAN_IFNAME); + diff --git a/kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-kernel-4.3-rdtscl-buildfix.patch b/kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-kernel-4.3-rdtscl-buildfix.patch new file mode 100644 index 00000000..f8d7b0da --- /dev/null +++ b/kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-kernel-4.3-rdtscl-buildfix.patch @@ -0,0 +1,27 @@ + +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 + +--- + src/shared/linux_osl.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff -Nurp broadcom-wl-6.30.223.271.orig/src/shared/linux_osl.c broadcom-wl-6.30.223.271/src/shared/linux_osl.c +--- broadcom-wl-6.30.223.271.orig/src/shared/linux_osl.c 2015-09-19 01:47:30.000000000 +0300 ++++ broadcom-wl-6.30.223.271/src/shared/linux_osl.c 2020-01-11 01:17:02.688960782 +0200 +@@ -932,7 +932,11 @@ osl_getcycles(void) + 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/kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-no-date-time.patch b/kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-no-date-time.patch new file mode 100644 index 00000000..3bc44007 --- /dev/null +++ b/kernel/drivers/module-broadcom-wl/files/broadcom-wl-6.30.223.271-no-date-time.patch @@ -0,0 +1,21 @@ + +The GE_49 check fails to detect gcc-10, but we dont care about old gcc +versions, so simply always apply the -Wno-date-time + +Fixes: https://bugs.mageia.org/show_bug.cgi?id=26620 + +Signed-off-by: Thomas Backlund + +diff -Nurp broadcom-wl-6.30.223.271.orig/Makefile broadcom-wl-6.30.223.271/Makefile +--- broadcom-wl-6.30.223.271.orig/Makefile 2015-09-19 01:47:30.000000000 +0300 ++++ broadcom-wl-6.30.223.271/Makefile 2020-05-15 16:28:08.586410105 +0300 +@@ -141,9 +141,7 @@ EXTRA_CFLAGS += -I$(src)/src/inclu + EXTRA_CFLAGS += -I$(src)/src/wl/sys -I$(src)/src/wl/phy -I$(src)/src/wl/ppr/include + EXTRA_CFLAGS += -I$(src)/src/shared/bcmwifi/include + #EXTRA_CFLAGS += -DBCMDBG_ASSERT -DBCMDBG_ERR +-ifeq "$(GE_49)" "1" + EXTRA_CFLAGS += -Wno-date-time +-endif + + EXTRA_LDFLAGS := $(src)/lib/wlc_hybrid.o_shipped + diff --git a/kernel/drivers/module-broadcom-wl/files/kernel-4.14-buildfix.patch b/kernel/drivers/module-broadcom-wl/files/kernel-4.14-buildfix.patch new file mode 100644 index 00000000..54144166 --- /dev/null +++ b/kernel/drivers/module-broadcom-wl/files/kernel-4.14-buildfix.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. + +--- + src/shared/linux_osl.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff -Nurp broadcom-wl-6.30.223.271.orig/src/shared/linux_osl.c broadcom-wl-6.30.223.271/src/shared/linux_osl.c +--- broadcom-wl-6.30.223.271.orig/src/shared/linux_osl.c 2020-01-11 01:17:02.688960782 +0200 ++++ broadcom-wl-6.30.223.271/src/shared/linux_osl.c 2020-01-11 01:37:41.527449819 +0200 +@@ -1076,11 +1076,21 @@ osl_os_get_image_block(char *buf, int le + { + 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/kernel/drivers/module-broadcom-wl/files/kernel-5.9-buildfix.patch b/kernel/drivers/module-broadcom-wl/files/kernel-5.9-buildfix.patch new file mode 100644 index 00000000..bb4ebb37 --- /dev/null +++ b/kernel/drivers/module-broadcom-wl/files/kernel-5.9-buildfix.patch @@ -0,0 +1,215 @@ +From: Joan Bruguera +Date: Sun, 13 Sep 2020 07:33:32 +0200 +Subject: Get rid of get_fs/set_fs calls in Broadcom WL driver. +Origin: https://gist.github.com/joanbm/5c640ac074d27fd1d82c74a5b67a1290 + +Fixes linux-next where get_fs/set_fs is already removed for some architectures. + +NB: Some checks in wlc_ioctl_internal are likely superfluous, + but I'm not familiar enough with the driver to remove them with confidence. + +See also: https://lwn.net/Articles/722267/ + https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/arch/x86/include/asm/uaccess.h?h=next-20200911&id=47058bb54b57962b3958a936ddbc59355e4c5504 + https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/include/linux/uaccess.h?h=next-20200911&id=5e6e9852d6f76e01b2e6803c74258afa5b432bc5 + +Signed-off-by: Joan Bruguera +--- + src/wl/sys/wl_cfg80211_hybrid.c | 29 ++----------------------- + src/wl/sys/wl_iw.c | 25 ++-------------------- + src/wl/sys/wl_linux.c | 40 ++++++++++++++++++++++++++++++----- + src/wl/sys/wl_linux.h | 2 ++ + src/wl/sys/wlc_pub.h | 1 + + 5 files changed, 42 insertions(+), 55 deletions(-) + +diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c +index 8e01841..111ec5a 100644 +--- a/src/wl/sys/wl_cfg80211_hybrid.c ++++ b/src/wl/sys/wl_cfg80211_hybrid.c +@@ -41,6 +41,7 @@ + #include + #include + #include ++#include + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) + #include +@@ -442,34 +443,8 @@ static void key_endian_to_host(struct wl_wsec_key *key) + static s32 + wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len) + { +- struct ifreq ifr; +- struct wl_ioctl ioc; +- mm_segment_t fs; +- s32 err = 0; +- + BUG_ON(len < sizeof(int)); +- +- memset(&ioc, 0, sizeof(ioc)); +- ioc.cmd = cmd; +- ioc.buf = arg; +- ioc.len = len; +- strcpy(ifr.ifr_name, dev->name); +- ifr.ifr_data = (caddr_t)&ioc; +- +- fs = get_fs(); +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) +- set_fs(KERNEL_DS); +-#else +- set_fs(get_ds()); +-#endif +-#if defined(WL_USE_NETDEV_OPS) +- err = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#else +- err = dev->do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#endif +- set_fs(fs); +- +- return err; ++ return wlc_ioctl_internal(dev, cmd, arg, len); + } + + static s32 +diff --git a/src/wl/sys/wl_iw.c b/src/wl/sys/wl_iw.c +index c4c610b..e346b15 100644 +--- a/src/wl/sys/wl_iw.c ++++ b/src/wl/sys/wl_iw.c +@@ -37,6 +37,7 @@ typedef const struct si_pub si_t; + + #include + #include ++#include + + extern bool wl_iw_conn_status_str(uint32 event_type, uint32 status, + uint32 reason, char* stringBuf, uint buflen); +@@ -103,33 +104,7 @@ dev_wlc_ioctl( + int len + ) + { +- struct ifreq ifr; +- wl_ioctl_t ioc; +- mm_segment_t fs; +- int ret; +- +- memset(&ioc, 0, sizeof(ioc)); +- ioc.cmd = cmd; +- ioc.buf = arg; +- ioc.len = len; +- +- strcpy(ifr.ifr_name, dev->name); +- ifr.ifr_data = (caddr_t) &ioc; +- +- fs = get_fs(); +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) +- set_fs(KERNEL_DS); +-#else +- set_fs(get_ds()); +-#endif +-#if defined(WL_USE_NETDEV_OPS) +- ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#else +- ret = dev->do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#endif +- set_fs(fs); +- +- return ret; ++ return wlc_ioctl_internal(dev, cmd, arg, len); + } + + static int +diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c +index 66069d4..cc01d2b 100644 +--- a/src/wl/sys/wl_linux.c ++++ b/src/wl/sys/wl_linux.c +@@ -1661,10 +1661,7 @@ wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) + goto done2; + } + +- if (segment_eq(get_fs(), KERNEL_DS)) +- buf = ioc.buf; +- +- else if (ioc.buf) { ++ if (ioc.buf) { + if (!(buf = (void *) MALLOC(wl->osh, MAX(ioc.len, WLC_IOCTL_MAXLEN)))) { + bcmerror = BCME_NORESOURCE; + goto done2; +@@ -1681,7 +1678,7 @@ wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) + WL_UNLOCK(wl); + + done1: +- if (ioc.buf && (ioc.buf != buf)) { ++ if (ioc.buf) { + if (copy_to_user(ioc.buf, buf, ioc.len)) + bcmerror = BCME_BADADDR; + MFREE(wl->osh, buf, MAX(ioc.len, WLC_IOCTL_MAXLEN)); +@@ -1694,6 +1691,39 @@ done2: + return (OSL_ERROR(bcmerror)); + } + ++int ++wlc_ioctl_internal(struct net_device *dev, int cmd, void *buf, int len) ++{ ++ wl_info_t *wl; ++ wl_if_t *wlif; ++ int bcmerror; ++ ++ if (!dev) ++ return -ENETDOWN; ++ ++ wl = WL_INFO(dev); ++ wlif = WL_DEV_IF(dev); ++ if (wlif == NULL || wl == NULL || wl->dev == NULL) ++ return -ENETDOWN; ++ ++ bcmerror = 0; ++ ++ WL_TRACE(("wl%d: wlc_ioctl_internal: cmd 0x%x\n", wl->pub->unit, cmd)); ++ ++ WL_LOCK(wl); ++ if (!capable(CAP_NET_ADMIN)) { ++ bcmerror = BCME_EPERM; ++ } else { ++ bcmerror = wlc_ioctl(wl->wlc, cmd, buf, len, wlif->wlcif); ++ } ++ WL_UNLOCK(wl); ++ ++ ASSERT(VALID_BCMERROR(bcmerror)); ++ if (bcmerror != 0) ++ wl->pub->bcmerror = bcmerror; ++ return (OSL_ERROR(bcmerror)); ++} ++ + static struct net_device_stats* + wl_get_stats(struct net_device *dev) + { +diff --git a/src/wl/sys/wl_linux.h b/src/wl/sys/wl_linux.h +index 5b1048e..c8c1f41 100644 +--- a/src/wl/sys/wl_linux.h ++++ b/src/wl/sys/wl_linux.h +@@ -22,6 +22,7 @@ + #define _wl_linux_h_ + + #include ++#include + + typedef struct wl_timer { + struct timer_list timer; +@@ -187,6 +188,7 @@ extern irqreturn_t wl_isr(int irq, void *dev_id, struct pt_regs *ptregs); + extern int __devinit wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent); + extern void wl_free(wl_info_t *wl); + extern int wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); ++extern int wlc_ioctl_internal(struct net_device *dev, int cmd, void *buf, int len); + extern struct net_device * wl_netdev_get(wl_info_t *wl); + + #endif +diff --git a/src/wl/sys/wlc_pub.h b/src/wl/sys/wlc_pub.h +index 53a98b8..2b5a029 100644 +--- a/src/wl/sys/wlc_pub.h ++++ b/src/wl/sys/wlc_pub.h +@@ -24,6 +24,7 @@ + + #include + #include ++#include + #include "proto/802.11.h" + #include "proto/bcmevent.h" + diff --git a/kernel/drivers/module-broadcom-wl/files/linux-4.11.patch b/kernel/drivers/module-broadcom-wl/files/linux-4.11.patch index a779f8c8..4a92ba80 100755 --- a/kernel/drivers/module-broadcom-wl/files/linux-4.11.patch +++ b/kernel/drivers/module-broadcom-wl/files/linux-4.11.patch @@ -1,50 +1,33 @@ -diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c -index a9671e2..da36405 100644 ---- a/src/wl/sys/wl_cfg80211_hybrid.c -+++ b/src/wl/sys/wl_cfg80211_hybrid.c -@@ -30,6 +30,9 @@ - #include - #include - #include + +Fix for 4.11, from debian + +--- + src/wl/sys/wl_cfg80211_hybrid.c | 4 ++++ + src/wl/sys/wl_linux.c | 2 ++ + 2 files changed, 6 insertions(+) + +diff -Nurp broadcom-wl-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c broadcom-wl-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c +--- broadcom-wl-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c 2020-01-11 01:19:17.966109836 +0200 ++++ broadcom-wl-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c 2020-01-11 01:25:39.080492424 +0200 +@@ -39,6 +39,10 @@ + #include + #include + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) +#include +#endif - #include - #include - #include -diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c -index 489c9f5..f8278ad 100644 ---- a/src/wl/sys/wl_linux.c -+++ b/src/wl/sys/wl_linux.c -@@ -117,6 +117,9 @@ int wl_found = 0; - - typedef struct priv_link { - wl_if_t *wlif; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) -+ unsigned long last_rx; -+#endif - } priv_link_t; - - #define WL_DEV_IF(dev) ((wl_if_t*)((priv_link_t*)DEV_PRIV(dev))->wlif) -@@ -2450,6 +2453,9 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rxsts, void *p) - { - struct sk_buff *oskb = (struct sk_buff *)p; - struct sk_buff *skb; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) -+ priv_link_t *priv_link; -+#endif - uchar *pdata; - uint len; - -@@ -2916,7 +2922,13 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rxsts, void *p) ++ + #define EVENT_TYPE(e) dtoh32((e)->event_type) + #define EVENT_FLAGS(e) dtoh16((e)->flags) + #define EVENT_STATUS(e) dtoh32((e)->status) +diff -Nurp broadcom-wl-6.30.223.271.orig/src/wl/sys/wl_linux.c broadcom-wl-6.30.223.271/src/wl/sys/wl_linux.c +--- broadcom-wl-6.30.223.271.orig/src/wl/sys/wl_linux.c 2020-01-11 01:12:32.543692150 +0200 ++++ broadcom-wl-6.30.223.271/src/wl/sys/wl_linux.c 2020-01-11 01:25:39.086492699 +0200 +@@ -2915,7 +2915,9 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rx if (skb == NULL) return; skb->dev = wl->monitor_dev; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) -+ priv_link = MALLOC(wl->osh, sizeof(priv_link_t)); -+ priv_link = netdev_priv(skb->dev); -+ priv_link->last_rx = jiffies; -+#else ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) skb->dev->last_rx = jiffies; +#endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) diff --git a/kernel/drivers/module-broadcom-wl/files/linux-4.12.patch b/kernel/drivers/module-broadcom-wl/files/linux-4.12.patch index 94c6253f..dd02c1d1 100755 --- a/kernel/drivers/module-broadcom-wl/files/linux-4.12.patch +++ b/kernel/drivers/module-broadcom-wl/files/linux-4.12.patch @@ -1,21 +1,26 @@ -diff -ru work.orig/src/wl/sys/wl_cfg80211_hybrid.c work.patched/src/wl/sys/wl_cfg80211_hybrid.c ---- work.orig/src/wl/sys/wl_cfg80211_hybrid.c 2017-06-10 15:50:27.328823384 -0700 -+++ work.patched/src/wl/sys/wl_cfg80211_hybrid.c 2017-06-10 15:52:40.540809187 -0700 -@@ -52,8 +52,13 @@ - u32 wl_dbg_level = WL_DBG_ERR; + +Ffix for 4.12 + +--- + src/wl/sys/wl_cfg80211_hybrid.c | 29 ++++++++++++++++++++++++++++- + 1 file changed, 28 insertions(+), 1 deletion(-) + +diff -Nurp broadcom-wl-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c broadcom-wl-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c +--- broadcom-wl-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c 2020-01-11 01:25:39.080492424 +0200 ++++ broadcom-wl-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c 2020-01-11 01:34:37.953072128 +0200 +@@ -54,7 +54,11 @@ u32 wl_dbg_level = WL_DBG_ERR; #endif + static s32 wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) -+static s32 wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, + enum nl80211_iftype type, struct vif_params *params); +#else - static s32 wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, enum nl80211_iftype type, u32 *flags, struct vif_params *params); +#endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) static s32 wl_cfg80211_scan(struct wiphy *wiphy, -@@ -466,7 +471,11 @@ +@@ -467,7 +471,11 @@ wl_dev_ioctl(struct net_device *dev, u32 static s32 wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, @@ -27,38 +32,43 @@ diff -ru work.orig/src/wl/sys/wl_cfg80211_hybrid.c work.patched/src/wl/sys/wl_cf struct vif_params *params) { struct wl_cfg80211_priv *wl = wiphy_to_wl(wiphy); -@@ -2361,12 +2370,26 @@ +@@ -2362,6 +2370,20 @@ wl_bss_roaming_done(struct wl_cfg80211_p 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 = {}; ++ struct cfg80211_bss *bss; ++ struct wlc_ssid *ssid; ++ ssid = &wl->profile->ssid; ++ bss = cfg80211_get_bss(wl_to_wiphy(wl), NULL, (s8 *)&wl->bssid, ++ ssid->SSID, ssid->SSID_len, WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); ++ struct cfg80211_roam_info roam_info = { ++ .bss = bss, ++ .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; wl_get_assoc_ies(wl); - memcpy(wl->profile->bssid, &e->addr, ETHER_ADDR_LEN); +@@ -2369,12 +2391,17 @@ wl_bss_roaming_done(struct wl_cfg80211_p memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN); wl_update_bss_info(wl); -+ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) -+ roam_info.channel = &wl->conf->channel, -+ roam_info.bssid = (u8 *)&wl->bssid, -+ roam_info.req_ie = conn_info->req_ie, -+ roam_info.req_ie_len = conn_info->req_ie_len, -+ roam_info.resp_ie = conn_info->resp_ie, -+ roam_info.resp_ie_len = conn_info->resp_ie_len, -+ -+ cfg80211_roamed(ndev, &roam_info, GFP_KERNEL); -+#else 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, -@@ -2374,6 +2397,7 @@ + #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, 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/kernel/drivers/module-broadcom-wl/files/linux-4.15.patch b/kernel/drivers/module-broadcom-wl/files/linux-4.15.patch index 91c4d895..b365201b 100755 --- a/kernel/drivers/module-broadcom-wl/files/linux-4.15.patch +++ b/kernel/drivers/module-broadcom-wl/files/linux-4.15.patch @@ -1,46 +1,49 @@ -diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c -index 489c9f5..f8278ad 100644 ---- a/src/wl/sys/wl_linux.c -+++ b/src/wl/sys/wl_linux.c -@@ -93,7 +93,11 @@ + +Fix for 4.15 + +--- + src/wl/sys/wl_linux.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff -Nurp broadcom-wl-6.30.223.271.orig/src/wl/sys/wl_linux.c broadcom-wl-6.30.223.271/src/wl/sys/wl_linux.c +--- broadcom-wl-6.30.223.271.orig/src/wl/sys/wl_linux.c 2020-01-11 01:25:39.086492699 +0200 ++++ broadcom-wl-6.30.223.271/src/wl/sys/wl_linux.c 2020-01-11 01:41:15.885238901 +0200 +@@ -93,7 +93,11 @@ struct iw_statistics *wl_get_wireless_st #include -+#ifdef HAVE_TIMER_SETUP -+static void wl_timer(struct timer_list *list); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) ++static void wl_timer(struct timer_list *tl); +#else static void wl_timer(ulong data); +#endif static void _wl_timer(wl_timer_t *t); static struct net_device *wl_alloc_linux_if(wl_if_t *wlif); -@@ -2296,12 +2300,17 @@ - +@@ -2297,10 +2301,17 @@ wl_timer_task(wl_task_t *task) atomic_dec(&t->wl->callbacks); } -- -+#ifdef HAVE_TIMER_SETUP + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) +static void -+wl_timer(struct timer_list *list) ++wl_timer(struct timer_list *tl) +{ -+ wl_timer_t *t = from_timer(t,list,timer); ++ wl_timer_t *t = (wl_timer_t *)tl; +#else static void wl_timer(ulong data) { wl_timer_t *t = (wl_timer_t *)data; -- +#endif + if (!WL_ALL_PASSIVE_ENAB(t->wl)) _wl_timer(t); - else -@@ -2351,10 +2360,13 @@ - } +@@ -2352,9 +2363,13 @@ wl_init_timer(wl_info_t *wl, void (*fn)( bzero(t, sizeof(wl_timer_t)); -- -+#ifdef HAVE_TIMER_SETUP -+ timer_setup(&t->timer, wl_timer,0); + ++#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; @@ -49,15 +52,3 @@ index 489c9f5..f8278ad 100644 t->wl = wl; t->fn = fn; t->arg = arg; -diff --git a/src/wl/sys/wl_linux.h b/src/wl/sys/wl_linux.h -index 489c9f5..f8278ad 100644 ---- a/src/wl/sys/wl_linux.h -+++ b/src/wl/sys/wl_linux.h -@@ -190,3 +190,7 @@ - extern struct net_device * wl_netdev_get(wl_info_t *wl); - - #endif -+ -+#if defined(timer_setup) && defined(from_timer) -+#define HAVE_TIMER_SETUP -+#endif diff --git a/kernel/drivers/module-broadcom-wl/files/linux-5.1.patch b/kernel/drivers/module-broadcom-wl/files/linux-5.1.patch index 692f02dd..d8c7aadf 100755 --- a/kernel/drivers/module-broadcom-wl/files/linux-5.1.patch +++ b/kernel/drivers/module-broadcom-wl/files/linux-5.1.patch @@ -1,15 +1,38 @@ -diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c -index cdf8c01..63b5650 100644 ---- a/src/wl/sys/wl_cfg80211_hybrid.c -+++ b/src/wl/sys/wl_cfg80211_hybrid.c -@@ -52,6 +52,10 @@ u32 wl_dbg_level = WL_DBG_ERR | WL_DBG_INFO; - u32 wl_dbg_level = WL_DBG_ERR; - #endif + +Fix for 5.1 + +--- + src/wl/sys/wl_cfg80211_hybrid.c | 4 ++++ + src/wl/sys/wl_iw.c | 4 ++++ + 2 files changed, 8 insertions(+) + +diff -Nurp broadcom-wl-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c broadcom-wl-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c +--- broadcom-wl-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c 2020-01-11 01:34:37.953072128 +0200 ++++ broadcom-wl-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c 2020-01-11 01:46:06.313501453 +0200 +@@ -458,7 +458,11 @@ wl_dev_ioctl(struct net_device *dev, u32 + ifr.ifr_data = (caddr_t)&ioc; + fs = get_fs(); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) -+#define get_ds() ((mm_segment_t) { (-1UL) }) ++ set_fs(KERNEL_DS); ++#else + set_fs(get_ds()); +#endif -+ - #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) - static s32 wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, - enum nl80211_iftype type, struct vif_params *params); \ No newline at end of file + #if defined(WL_USE_NETDEV_OPS) + err = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE); + #else +diff -Nurp broadcom-wl-6.30.223.271.orig/src/wl/sys/wl_iw.c broadcom-wl-6.30.223.271/src/wl/sys/wl_iw.c +--- broadcom-wl-6.30.223.271.orig/src/wl/sys/wl_iw.c 2015-09-19 01:47:30.000000000 +0300 ++++ broadcom-wl-6.30.223.271/src/wl/sys/wl_iw.c 2020-01-11 01:46:06.314501499 +0200 +@@ -117,7 +117,11 @@ dev_wlc_ioctl( + ifr.ifr_data = (caddr_t) &ioc; + + fs = get_fs(); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) ++ set_fs(KERNEL_DS); ++#else + set_fs(get_ds()); ++#endif + #if defined(WL_USE_NETDEV_OPS) + ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE); + #else diff --git a/kernel/drivers/module-broadcom-wl/files/linux-5.6.patch b/kernel/drivers/module-broadcom-wl/files/linux-5.6.patch index f8d57838..82d1be13 100644 --- a/kernel/drivers/module-broadcom-wl/files/linux-5.6.patch +++ b/kernel/drivers/module-broadcom-wl/files/linux-5.6.patch @@ -1,55 +1,59 @@ -diff --git a/src/shared/linux_osl.c b/src/shared/linux_osl.c -index 6157d18..8237ec7 100644 ---- a/src/shared/linux_osl.c -+++ b/src/shared/linux_osl.c -@@ -942,7 +942,7 @@ osl_getcycles(void) +diff -Nurp broadcom-wl-6.30.223.271.orig/src/shared/linux_osl.c broadcom-wl-6.30.223.271/src/shared/linux_osl.c +--- broadcom-wl-6.30.223.271.orig/src/shared/linux_osl.c 2020-04-11 13:01:14.768843749 +0300 ++++ broadcom-wl-6.30.223.271/src/shared/linux_osl.c 2020-04-11 13:15:29.246184298 +0300 +@@ -946,7 +946,11 @@ osl_getcycles(void) void * osl_reg_map(uint32 pa, uint size) { -- return (ioremap_nocache((unsigned long)pa, (unsigned long)size)); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) + return (ioremap((unsigned long)pa, (unsigned long)size)); ++#else + return (ioremap_nocache((unsigned long)pa, (unsigned long)size)); ++#endif } void -diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c -index 0d05100..2ed1f0d 100644 ---- a/src/wl/sys/wl_linux.c -+++ b/src/wl/sys/wl_linux.c -@@ -582,7 +582,7 @@ wl_attach(uint16 vendor, uint16 device, ulong regs, +diff -Nurp broadcom-wl-6.30.223.271.orig/src/wl/sys/wl_linux.c broadcom-wl-6.30.223.271/src/wl/sys/wl_linux.c +--- broadcom-wl-6.30.223.271.orig/src/wl/sys/wl_linux.c 2020-04-11 13:01:14.775844079 +0300 ++++ broadcom-wl-6.30.223.271/src/wl/sys/wl_linux.c 2020-04-11 13:18:05.671569807 +0300 +@@ -586,7 +586,11 @@ wl_attach(uint16 vendor, uint16 device, } wl->bcm_bustype = bustype; -- if ((wl->regsva = ioremap_nocache(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) + if ((wl->regsva = ioremap(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) { ++#else + if ((wl->regsva = ioremap_nocache(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) { ++#endif WL_ERROR(("wl%d: ioremap() failed\n", unit)); goto fail; } -@@ -772,7 +772,7 @@ wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) +@@ -776,7 +780,11 @@ wl_pci_probe(struct pci_dev *pdev, const if ((val & 0x0000ff00) != 0) pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); bar1_size = pci_resource_len(pdev, 2); -- bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2), ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) + bar1_addr = (uchar *)ioremap(pci_resource_start(pdev, 2), ++#else + bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2), ++#endif bar1_size); wl = wl_attach(pdev->vendor, pdev->device, pci_resource_start(pdev, 0), PCI_BUS, pdev, pdev->irq, bar1_addr, bar1_size); -@@ -3335,12 +3335,19 @@ wl_proc_write(struct file *filp, const char __user *buff, size_t length, loff_t +@@ -3348,10 +3356,16 @@ wl_proc_write(struct file *filp, const c } #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) -+static struct proc_ops wl_fops = { -+ .proc_read = wl_proc_read, -+ .proc_write = wl_proc_write, -+}; ++static const struct proc_ops wl_fops = { ++ .proc_read = wl_proc_read, ++ .proc_write = wl_proc_write, +#else static const struct file_operations wl_fops = { .owner = THIS_MODULE, .read = wl_proc_read, .write = wl_proc_write, ++#endif }; #endif -+#endif - static int - wl_reg_proc_entry(wl_info_t *wl) diff --git a/kernel/drivers/module-broadcom-wl/pspec.xml b/kernel/drivers/module-broadcom-wl/pspec.xml index 2cbc66d1..e37ed629 100755 --- a/kernel/drivers/module-broadcom-wl/pspec.xml +++ b/kernel/drivers/module-broadcom-wl/pspec.xml @@ -15,25 +15,33 @@ https://docs.broadcom.com/docs-and-downloads/docs/linux_sta/hybrid-v35-nodebug-pcoem-6_30_223_271.tar.gz https://docs.broadcom.com/docs-and-downloads/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz - kernel-module-headers + kernel-module-headers + broadcom-wl-6.30.223.271-debian-fix-kernel-warnings.patch patch/license.patch - patch/wl_linux.c.patch + broadcom-wl-6.30.223.271-kernel-4.3-rdtscl-buildfix.patch patch/linux47.patch patch/linux48.patch linux-4.11.patch linux-4.12.patch + kernel-4.14-buildfix.patch linux-4.15.patch - linux-5.1.patch - linux-5.6.patch + linux-5.1.patch + linux-5.6.patch + broadcom-wl-6.30.223.271-fix-null-pointer-crash.patch + broadcom-wl-6.30.223.271-ifname-wlan.patch + broadcom-wl-6.30.223.271-allow-user_ioctl.patch + broadcom-wl-6.30.223.271-debian-fix-dkms-build-error.patch + kernel-5.9-buildfix.patch + broadcom-wl-6.30.223.271-no-date-time.patch module-broadcom-wl - kernel + kernel module-broadcom-wl-userspace @@ -62,6 +70,13 @@ + + 2020-11-20 + 6.30.223.271 + Version bump. + Mustafa Cinasal + muscnsl@gmail.com + 2020-09-15 6.30.223.271