Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] broadcom-wl-dkms: patch for 6.0
@ 2022-10-14 11:56 sgn
  2022-10-14 16:37 ` [PR PATCH] [Updated] " sgn
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: sgn @ 2022-10-14 11:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1288 bytes --]

There is a new pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages broadcom-wl-dkms
https://github.com/void-linux/void-packages/pull/39950

broadcom-wl-dkms: patch for 6.0
While we're at it, import change for 5.17

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **NO**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/39950.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-broadcom-wl-dkms-39950.patch --]
[-- Type: text/x-diff, Size: 37776 bytes --]

From eccb080b6f5128e4a41e679c44cf41a5fda6498b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 14 Oct 2022 18:54:43 +0700
Subject: [PATCH] broadcom-wl-dkms: patch for 6.0

While we're at it, import change for 5.17
---
 .../patches/001-null-pointer-fix.patch        | 13 ++---
 .../patches/002-gcc-4.9.patch                 | 15 +++++
 .../patches/003-linux-4.3.patch               | 16 ++++++
 .../{linux-4.7.patch => 004-linux-4.7.patch}  | 35 +++++++-----
 .../{linux-4.8.patch => 005-linux-4.8.patch}  | 12 ++--
 ...{linux-4.11.patch => 006-linux-4.11.patch} | 20 +++----
 ...{linux-4.12.patch => 007-linux-4.12.patch} | 27 ++++-----
 .../patches/008-linux-4.14.patch              | 37 ++++++++++++
 .../patches/009-linux-4.15.patch              | 48 ++++++++++++++++
 .../{linux-5.1.patch => 010-linux-5.1.patch}  | 15 +++--
 .../{linux-5.6.patch => 011-linux-5.6.patch}  | 24 ++++----
 ...{linux-5.10.patch => 012-linux-5.10.patch} | 49 ++++++++--------
 .../patches/013-linux-5.17.patch              | 56 +++++++++++++++++++
 ...{linux-5.18.patch => 014-linux-5.18.patch} | 19 ++++---
 .../patches/015-linux-6.0.patch               | 31 ++++++++++
 .../broadcom-wl-dkms/patches/gcc-4.9.patch    | 13 -----
 .../broadcom-wl-dkms/patches/linux-4.15.patch | 44 ---------------
 .../broadcom-wl-dkms/patches/linux-4.3.patch  | 15 -----
 .../broadcom-wl-dkms/patches/linux-5.17.patch | 39 -------------
 19 files changed, 317 insertions(+), 211 deletions(-)
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/002-gcc-4.9.patch
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/003-linux-4.3.patch
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-4.7.patch => 004-linux-4.7.patch} (73%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-4.8.patch => 005-linux-4.8.patch} (71%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-4.11.patch => 006-linux-4.11.patch} (63%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-4.12.patch => 007-linux-4.12.patch} (68%)
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/008-linux-4.14.patch
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/009-linux-4.15.patch
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-5.1.patch => 010-linux-5.1.patch} (50%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-5.6.patch => 011-linux-5.6.patch} (63%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-5.10.patch => 012-linux-5.10.patch} (74%)
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/013-linux-5.17.patch
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-5.18.patch => 014-linux-5.18.patch} (76%)
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/015-linux-6.0.patch
 delete mode 100644 srcpkgs/broadcom-wl-dkms/patches/gcc-4.9.patch
 delete mode 100644 srcpkgs/broadcom-wl-dkms/patches/linux-4.15.patch
 delete mode 100644 srcpkgs/broadcom-wl-dkms/patches/linux-4.3.patch
 delete mode 100644 srcpkgs/broadcom-wl-dkms/patches/linux-5.17.patch

diff --git a/srcpkgs/broadcom-wl-dkms/patches/001-null-pointer-fix.patch b/srcpkgs/broadcom-wl-dkms/patches/001-null-pointer-fix.patch
index adef19f30af1..e9b4bc26d73a 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/001-null-pointer-fix.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/001-null-pointer-fix.patch
@@ -8,11 +8,11 @@ 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)
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+@@ -2165,8 +2165,8 @@ wl_start(struct sk_buff *skb, struct net
  	wlif = WL_DEV_IF(dev);
  	wl = WL_INFO(dev);
  
@@ -22,6 +22,3 @@ index 860b935..295156f 100644
  
  		TXQ_LOCK(wl);
  
--- 
-1.9.1
-
diff --git a/srcpkgs/broadcom-wl-dkms/patches/002-gcc-4.9.patch b/srcpkgs/broadcom-wl-dkms/patches/002-gcc-4.9.patch
new file mode 100644
index 000000000000..021f98a74a83
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/002-gcc-4.9.patch
@@ -0,0 +1,15 @@
+https://github.com/voidlinux/xbps-packages/issues/412
+
+Index: broadcom-wl-dkms-6.30.223.271/Makefile
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/Makefile
++++ broadcom-wl-dkms-6.30.223.271/Makefile
+@@ -145,6 +145,8 @@ ifeq "$(GE_49)" "1"
+ EXTRA_CFLAGS       += -Wno-date-time
+ endif
+ 
++EXTRA_CFLAGS       += -Wno-date-time
++
+ EXTRA_LDFLAGS      := $(src)/lib/wlc_hybrid.o_shipped
+ 
+ KBASE              ?= /lib/modules/`uname -r`
diff --git a/srcpkgs/broadcom-wl-dkms/patches/003-linux-4.3.patch b/srcpkgs/broadcom-wl-dkms/patches/003-linux-4.3.patch
new file mode 100644
index 000000000000..d041be223f35
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/003-linux-4.3.patch
@@ -0,0 +1,16 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/shared/linux_osl.c
++++ broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+@@ -932,7 +932,11 @@ osl_getcycles(void)
+ 	uint cycles;
+ 
+ #if defined(__i386__)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
++	cycles = rdtsc();
++#else
+ 	rdtscl(cycles);
++#endif
+ #else
+ 	cycles = 0;
+ #endif 
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.7.patch b/srcpkgs/broadcom-wl-dkms/patches/004-linux-4.7.patch
similarity index 73%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-4.7.patch
rename to srcpkgs/broadcom-wl-dkms/patches/004-linux-4.7.patch
index e2d0dfc23f22..dc8e12960af4 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.7.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/004-linux-4.7.patch
@@ -10,12 +10,14 @@ makes heavy use of that enum. The simple fix is to re-create the values.
 This patch came from the folks at Manjaro.
 https://github.com/manjaro/packages-extra/blob/master/broadcom-wl-dkms/linux-47.patch
 
---- a/src/wl/sys/wl_linux.h   2016-06-04 15:24:22.915341000 +0200
-+++ b/src/wl/sys/wl_linux.h   2016-06-04 15:29:36.236136244 +0200
-@@ -18,6 +18,13 @@
-  * $Id: wl_linux.h 369548 2012-11-19 09:01:01Z $
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.h
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.h
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.h
+@@ -19,6 +19,13 @@
+  * $Id: wl_cfg80211.h,v 1.1.8.1 2011-01-26 00:57:46 $
   */
-
+ 
 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
 +#define ieee80211_band nl80211_band
 +#define IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ
@@ -23,15 +25,17 @@ https://github.com/manjaro/packages-extra/blob/master/broadcom-wl-dkms/linux-47.
 +#define IEEE80211_NUM_BANDS NUM_NL80211_BANDS
 +#endif
 +
- #ifndef _wl_linux_h_
- #define _wl_linux_h_
-
---- a/src/wl/sys/wl_cfg80211_hybrid.h 2016-06-04 15:34:41.123022255 +0200
-+++ b/src/wl/sys/wl_cfg80211_hybrid.h 2016-06-04 15:37:25.391772105 +0200
-@@ -19,6 +19,13 @@
-  * $Id: wl_cfg80211.h,v 1.1.8.1 2011-01-26 00:57:46 $
+ #ifndef _wl_cfg80211_h_
+ #define _wl_cfg80211_h_
+ 
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.h
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.h
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.h
+@@ -18,6 +18,13 @@
+  * $Id: wl_linux.h 369548 2012-11-19 09:01:01Z $
   */
-
+ 
 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
 +#define ieee80211_band nl80211_band
 +#define IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ
@@ -39,5 +43,6 @@ https://github.com/manjaro/packages-extra/blob/master/broadcom-wl-dkms/linux-47.
 +#define IEEE80211_NUM_BANDS NUM_NL80211_BANDS
 +#endif
 +
- #ifndef _wl_cfg80211_h_
- #define _wl_cfg80211_h_
+ #ifndef _wl_linux_h_
+ #define _wl_linux_h_
+ 
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.8.patch b/srcpkgs/broadcom-wl-dkms/patches/005-linux-4.8.patch
similarity index 71%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-4.8.patch
rename to srcpkgs/broadcom-wl-dkms/patches/005-linux-4.8.patch
index 0f3e81906226..9047e2f88ded 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.8.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/005-linux-4.8.patch
@@ -1,8 +1,10 @@
 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 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -2386,8 +2386,15 @@ wl_bss_connect_done(struct wl_cfg80211_p
  	s32 err = 0;
  
  	if (wl->scan_request) {
@@ -19,7 +21,7 @@ Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=839629
  		wl->scan_request = NULL;
  	}
  
-@@ -2488,7 +2495,14 @@
+@@ -2488,7 +2495,14 @@ wl_notify_scan_status(struct wl_cfg80211
  
  scan_done_out:
  	if (wl->scan_request) {
@@ -34,7 +36,7 @@ Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=839629
  		wl->scan_request = NULL;
  	}
  	rtnl_unlock();
-@@ -2913,7 +2927,14 @@
+@@ -2913,7 +2927,14 @@ s32 wl_cfg80211_down(struct net_device *
  	s32 err = 0;
  
  	if (wl->scan_request) {
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.11.patch b/srcpkgs/broadcom-wl-dkms/patches/006-linux-4.11.patch
similarity index 63%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-4.11.patch
rename to srcpkgs/broadcom-wl-dkms/patches/006-linux-4.11.patch
index ae73bcf9b6b1..36b67681c8ca 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.11.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/006-linux-4.11.patch
@@ -1,7 +1,7 @@
-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
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
 @@ -30,6 +30,9 @@
  #include <linux/kthread.h>
  #include <linux/netdevice.h>
@@ -12,10 +12,10 @@ index a9671e2..da36405 100644
  #include <net/cfg80211.h>
  #include <linux/nl80211.h>
  #include <net/rtnetlink.h>
-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
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
 @@ -117,6 +117,9 @@ int wl_found = 0;
  
  typedef struct priv_link {
@@ -26,7 +26,7 @@ index 489c9f5..f8278ad 100644
  } 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)
+@@ -2449,6 +2452,9 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rx
  {
  	struct sk_buff *oskb = (struct sk_buff *)p;
  	struct sk_buff *skb;
@@ -36,7 +36,7 @@ index 489c9f5..f8278ad 100644
  	uchar *pdata;
  	uint len;
  
-@@ -2916,7 +2922,13 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rxsts, void *p)
+@@ -2915,7 +2921,13 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rx
  	if (skb == NULL) return;
  
  	skb->dev = wl->monitor_dev;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.12.patch b/srcpkgs/broadcom-wl-dkms/patches/007-linux-4.12.patch
similarity index 68%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-4.12.patch
rename to srcpkgs/broadcom-wl-dkms/patches/007-linux-4.12.patch
index bf9494a30fed..f529177ac2d5 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.12.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/007-linux-4.12.patch
@@ -1,7 +1,8 @@
-diff -ru work.orig/src/wl/sys/wl_cfg80211_hybrid.c work.patched/src/wl/sys/wl_cfg80211_hybrid.c
---- a/src/wl/sys/wl_cfg80211_hybrid.c	2017-06-10 15:50:27.328823384 -0700
-+++ b/src/wl/sys/wl_cfg80211_hybrid.c	2017-06-10 15:52:40.540809187 -0700
-@@ -52,8 +52,13 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -52,8 +52,13 @@ u32 wl_dbg_level = WL_DBG_ERR | WL_DBG_I
  u32 wl_dbg_level = WL_DBG_ERR;
  #endif
  
@@ -15,7 +16,7 @@ diff -ru work.orig/src/wl/sys/wl_cfg80211_hybrid.c work.patched/src/wl/sys/wl_cf
  #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
  static s32
  wl_cfg80211_scan(struct wiphy *wiphy,
-@@ -466,7 +471,11 @@
+@@ -466,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,7 +28,7 @@ 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 @@
+@@ -2361,12 +2370,26 @@ 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);
@@ -42,19 +43,19 @@ diff -ru work.orig/src/wl/sys/wl_cfg80211_hybrid.c work.patched/src/wl/sys/wl_cf
  	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,
++	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(2, 6, 39)
  			&wl->conf->channel,	 
-@@ -2374,6 +2397,7 @@
+@@ -2374,6 +2397,7 @@ wl_bss_roaming_done(struct wl_cfg80211_p
  			(u8 *)&wl->bssid,
  			conn_info->req_ie, conn_info->req_ie_len,
  			conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL);
diff --git a/srcpkgs/broadcom-wl-dkms/patches/008-linux-4.14.patch b/srcpkgs/broadcom-wl-dkms/patches/008-linux-4.14.patch
new file mode 100644
index 000000000000..0a3d021667bf
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/008-linux-4.14.patch
@@ -0,0 +1,37 @@
+From: Gerardo Esteban Malazdrewicz <gerardo@malazdrewicz.com.ar>
+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 files changed, 12 insertions(+), 1 deletion(-)
+
+Index: broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/shared/linux_osl.c
++++ broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+@@ -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/srcpkgs/broadcom-wl-dkms/patches/009-linux-4.15.patch b/srcpkgs/broadcom-wl-dkms/patches/009-linux-4.15.patch
new file mode 100644
index 000000000000..82fa33c89bf4
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/009-linux-4.15.patch
@@ -0,0 +1,48 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+@@ -93,7 +93,11 @@ struct iw_statistics *wl_get_wireless_st
+ 
+ #include <wlc_wowl.h>
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ static void wl_timer(ulong data);
++#else
++static void wl_timer(struct timer_list *tl);
++#endif
+ static void _wl_timer(wl_timer_t *t);
+ static struct net_device *wl_alloc_linux_if(wl_if_t *wlif);
+ 
+@@ -2301,9 +2305,17 @@ wl_timer_task(wl_task_t *task)
+ }
+ 
+ static void
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ wl_timer(ulong data)
++#else
++wl_timer(struct timer_list *tl)
++#endif
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ 	wl_timer_t *t = (wl_timer_t *)data;
++#else
++    wl_timer_t *t = from_timer(t, tl, timer);
++#endif
+ 
+ 	if (!WL_ALL_PASSIVE_ENAB(t->wl))
+ 		_wl_timer(t);
+@@ -2355,9 +2367,13 @@ wl_init_timer(wl_info_t *wl, void (*fn)(
+ 
+ 	bzero(t, sizeof(wl_timer_t));
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ 	init_timer(&t->timer);
+ 	t->timer.data = (ulong) t;
+ 	t->timer.function = wl_timer;
++#else
++    timer_setup(&t->timer, wl_timer, 0);
++#endif
+ 	t->wl = wl;
+ 	t->fn = fn;
+ 	t->arg = arg;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.1.patch b/srcpkgs/broadcom-wl-dkms/patches/010-linux-5.1.patch
similarity index 50%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-5.1.patch
rename to srcpkgs/broadcom-wl-dkms/patches/010-linux-5.1.patch
index 1820dff63c20..66dcbdc901c3 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.1.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/010-linux-5.1.patch
@@ -1,6 +1,8 @@
---- a/src/wl/sys/wl_cfg80211_hybrid.c
-+++ b/src/wl/sys/wl_cfg80211_hybrid.c
-@@ -43,6 +43,9 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -46,6 +46,9 @@
  #define EVENT_FLAGS(e) dtoh16((e)->flags)
  #define EVENT_STATUS(e) dtoh32((e)->status)
  
@@ -10,8 +12,10 @@
  #ifdef BCMDBG
  u32 wl_dbg_level = WL_DBG_ERR | WL_DBG_INFO;
  #else
---- a/src/wl/sys/wl_iw.c
-+++ b/src/wl/sys/wl_iw.c
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_iw.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_iw.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_iw.c
 @@ -61,6 +61,9 @@ typedef struct priv_link {
  	wl_iw_t *wliw;
  } priv_link_t;
@@ -22,4 +26,3 @@
  #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24))
  #define WL_DEV_LINK(dev)       (priv_link_t*)(dev->priv)
  #else
-
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.6.patch b/srcpkgs/broadcom-wl-dkms/patches/011-linux-5.6.patch
similarity index 63%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-5.6.patch
rename to srcpkgs/broadcom-wl-dkms/patches/011-linux-5.6.patch
index 113fd092ecce..09420647773b 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.6.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/011-linux-5.6.patch
@@ -1,8 +1,8 @@
-diff --git src/shared/linux_osl.c 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)
+Index: broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/shared/linux_osl.c
++++ broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+@@ -946,7 +946,7 @@ osl_getcycles(void)
  void *
  osl_reg_map(uint32 pa, uint size)
  {
@@ -11,11 +11,11 @@ index 6157d18..8237ec7 100644
  }
  
  void
-diff --git src/wl/sys/wl_linux.c 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,
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+@@ -589,7 +589,7 @@ wl_attach(uint16 vendor, uint16 device,
  	}
  	wl->bcm_bustype = bustype;
  
@@ -24,7 +24,7 @@ index 0d05100..2ed1f0d 100644
  		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)
+@@ -779,7 +779,7 @@ 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);
@@ -33,7 +33,7 @@ index 0d05100..2ed1f0d 100644
  			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
+@@ -3363,12 +3363,19 @@ wl_proc_write(struct file *filp, const c
  }
  
  #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch b/srcpkgs/broadcom-wl-dkms/patches/012-linux-5.10.patch
similarity index 74%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch
rename to srcpkgs/broadcom-wl-dkms/patches/012-linux-5.10.patch
index 53514bf020a1..20c043a7fcd7 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/012-linux-5.10.patch
@@ -25,9 +25,10 @@ Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
  src/wl/sys/wlc_pub.h            |  1 +
  5 files changed, 42 insertions(+), 51 deletions(-)
 
-diff -u -r src/wl/sys/wl_cfg80211_hybrid.c src/wl/sys/wl_cfg80211_hybrid.c
---- a/src/wl/sys/wl_cfg80211_hybrid.c	2021-01-25 08:55:05.625224400 -0800
-+++ b/src/wl/sys/wl_cfg80211_hybrid.c	2021-01-25 08:58:30.000982902 -0800
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
 @@ -41,6 +41,7 @@
  #include <wlioctl.h>
  #include <proto/802.11.h>
@@ -36,7 +37,7 @@ diff -u -r src/wl/sys/wl_cfg80211_hybrid.c src/wl/sys/wl_cfg80211_hybrid.c
  
  #define EVENT_TYPE(e) dtoh32((e)->event_type)
  #define EVENT_FLAGS(e) dtoh16((e)->flags)
-@@ -446,30 +447,8 @@
+@@ -446,30 +447,8 @@ static void key_endian_to_host(struct wl
  static s32
  wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len)
  {
@@ -68,10 +69,11 @@ diff -u -r src/wl/sys/wl_cfg80211_hybrid.c src/wl/sys/wl_cfg80211_hybrid.c
  }
  
  static s32
-diff -u -r src/wl/sys/wl_iw.c src/wl/sys/wl_iw.c
---- a/src/wl/sys/wl_iw.c	2021-01-25 09:00:13.163543809 -0800
-+++ b/src/wl/sys/wl_iw.c	2021-01-25 09:02:04.218646005 -0800
-@@ -37,6 +37,7 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_iw.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_iw.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_iw.c
+@@ -37,6 +37,7 @@ typedef const struct si_pub	si_t;
  
  #include <wl_dbg.h>
  #include <wl_iw.h>
@@ -79,7 +81,7 @@ diff -u -r src/wl/sys/wl_iw.c src/wl/sys/wl_iw.c
  
  extern bool wl_iw_conn_status_str(uint32 event_type, uint32 status,
  	uint32 reason, char* stringBuf, uint buflen);
-@@ -106,29 +107,7 @@
+@@ -106,29 +107,7 @@ dev_wlc_ioctl(
  	int len
  )
  {
@@ -110,10 +112,11 @@ diff -u -r src/wl/sys/wl_iw.c src/wl/sys/wl_iw.c
  }
  
  static int
-diff -u -r src/wl/sys/wl_linux.c src/wl/sys/wl_linux.c
---- a/src/wl/sys/wl_linux.c	2021-01-25 09:02:08.055475147 -0800
-+++ b/src/wl/sys/wl_linux.c	2021-01-25 09:06:11.894764339 -0800
-@@ -1650,10 +1650,7 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+@@ -1650,10 +1650,7 @@ wl_ioctl(struct net_device *dev, struct
  		goto done2;
  	}
  
@@ -125,7 +128,7 @@ diff -u -r src/wl/sys/wl_linux.c src/wl/sys/wl_linux.c
  		if (!(buf = (void *) MALLOC(wl->osh, MAX(ioc.len, WLC_IOCTL_MAXLEN)))) {
  			bcmerror = BCME_NORESOURCE;
  			goto done2;
-@@ -1674,7 +1671,7 @@
+@@ -1674,7 +1671,7 @@ wl_ioctl(struct net_device *dev, struct
  	WL_UNLOCK(wl);
  
  done1:
@@ -134,7 +137,7 @@ diff -u -r src/wl/sys/wl_linux.c src/wl/sys/wl_linux.c
  		if (copy_to_user(ioc.buf, buf, ioc.len))
  			bcmerror = BCME_BADADDR;
  		MFREE(wl->osh, buf, MAX(ioc.len, WLC_IOCTL_MAXLEN));
-@@ -1684,6 +1681,39 @@
+@@ -1684,6 +1681,39 @@ done2:
  	ASSERT(VALID_BCMERROR(bcmerror));
  	if (bcmerror != 0)
  		wl->pub->bcmerror = bcmerror;
@@ -174,9 +177,10 @@ diff -u -r src/wl/sys/wl_linux.c src/wl/sys/wl_linux.c
  	return (OSL_ERROR(bcmerror));
  }
  
-diff -u -r src/wl/sys/wl_linux.h src/wl/sys/wl_linux.h
---- a/src/wl/sys/wl_linux.h	2021-01-25 09:06:15.188672391 -0800
-+++ b/src/wl/sys/wl_linux.h	2021-01-25 09:07:49.457810535 -0800
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.h
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.h
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.h
 @@ -29,6 +29,7 @@
  #define _wl_linux_h_
  
@@ -185,7 +189,7 @@ diff -u -r src/wl/sys/wl_linux.h src/wl/sys/wl_linux.h
  
  typedef struct wl_timer {
  	struct timer_list 	timer;
-@@ -194,6 +195,7 @@
+@@ -194,6 +195,7 @@ extern irqreturn_t wl_isr(int irq, void
  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);
@@ -193,9 +197,10 @@ diff -u -r src/wl/sys/wl_linux.h src/wl/sys/wl_linux.h
  extern struct net_device * wl_netdev_get(wl_info_t *wl);
  
  #endif 
-diff -u -r src/wl/sys/wlc_pub.h src/wl/sys/wlc_pub.h
---- a/src/wl/sys/wlc_pub.h	2021-01-25 09:07:54.543645032 -0800
-+++ b/src/wl/sys/wlc_pub.h	2021-01-25 09:08:10.772110464 -0800
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wlc_pub.h
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wlc_pub.h
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wlc_pub.h
 @@ -24,6 +24,7 @@
  
  #include <wlc_types.h>
diff --git a/srcpkgs/broadcom-wl-dkms/patches/013-linux-5.17.patch b/srcpkgs/broadcom-wl-dkms/patches/013-linux-5.17.patch
new file mode 100644
index 000000000000..c8223dbc008a
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/013-linux-5.17.patch
@@ -0,0 +1,56 @@
+Source: Arch Linux
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+@@ -93,6 +93,10 @@ struct iw_statistics *wl_get_wireless_st
+ 
+ #include <wlc_wowl.h>
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)
++#define PDE_DATA pde_data
++#endif
++
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ static void wl_timer(ulong data);
+ #else
+@@ -493,6 +497,12 @@ wl_if_setup(struct net_device *dev)
+ #endif
+ }
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
++static inline void eth_hw_addr_set(struct net_device *dev, const void *addr) {
++	memcpy(dev->dev_addr, addr, ETHER_ADDR_LEN);
++}
++#endif
++
+ static wl_info_t *
+ wl_attach(uint16 vendor, uint16 device, ulong regs,
+ 	uint bustype, void *btparam, uint irq, uchar* bar1_addr, uint32 bar1_size)
+@@ -637,7 +647,7 @@ wl_attach(uint16 vendor, uint16 device,
+ 			WL_ERROR(("wl%d: Error setting MAC ADDRESS\n", unit));
+ 	}
+ #endif 
+-	bcopy(&wl->pub->cur_etheraddr, dev->dev_addr, ETHER_ADDR_LEN);
++	eth_hw_addr_set(dev, wl->pub->cur_etheraddr.octet);
+ 
+ 	online_cpus = 1;
+ 
+@@ -1838,7 +1848,7 @@ wl_set_mac_address(struct net_device *de
+ 
+ 	WL_LOCK(wl);
+ 
+-	bcopy(sa->sa_data, dev->dev_addr, ETHER_ADDR_LEN);
++	eth_hw_addr_set(dev, sa->sa_data);
+ 	err = wlc_iovar_op(wl->wlc, "cur_etheraddr", NULL, 0, sa->sa_data, ETHER_ADDR_LEN,
+ 		IOV_SET, (WL_DEV_IF(dev))->wlcif);
+ 	WL_UNLOCK(wl);
+@@ -3021,7 +3031,7 @@ _wl_add_monitor_if(wl_task_t *task)
+ 	else
+ 		dev->type = ARPHRD_IEEE80211_RADIOTAP;
+ 
+-	bcopy(wl->dev->dev_addr, dev->dev_addr, ETHER_ADDR_LEN);
++	eth_hw_addr_set(dev, wl->dev->dev_addr);
+ 
+ #if defined(WL_USE_NETDEV_OPS)
+ 	dev->netdev_ops = &wl_netdev_monitor_ops;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.18.patch b/srcpkgs/broadcom-wl-dkms/patches/014-linux-5.18.patch
similarity index 76%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-5.18.patch
rename to srcpkgs/broadcom-wl-dkms/patches/014-linux-5.18.patch
index d837429a6899..c404f98fc9b5 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.18.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/014-linux-5.18.patch
@@ -1,7 +1,8 @@
-diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
---- a/src/shared/linux_osl.c	2022-05-24 20:51:15.662604980 +0000
-+++ b/src/shared/linux_osl.c	2022-05-24 21:13:38.264472425 +0000
-@@ -599,6 +599,8 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/shared/linux_osl.c
++++ broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+@@ -599,6 +599,8 @@ osl_dma_alloc_consistent(osl_t *osh, uin
  	va = kmalloc(size, GFP_ATOMIC | __GFP_ZERO);
  	if (va)
  		*pap = (ulong)__virt_to_phys(va);
@@ -10,7 +11,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  #else
  	va = pci_alloc_consistent(osh->pdev, size, (dma_addr_t*)pap);
  #endif
-@@ -612,6 +614,8 @@
+@@ -612,6 +614,8 @@ osl_dma_free_consistent(osl_t *osh, void
  
  #ifdef __ARM_ARCH_7A__
  	kfree(va);
@@ -19,7 +20,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  #else
  	pci_free_consistent(osh->pdev, size, va, (dma_addr_t)pa);
  #endif
-@@ -623,7 +627,11 @@
+@@ -623,7 +627,11 @@ osl_dma_map(osl_t *osh, void *va, uint s
  	int dir;
  
  	ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));
@@ -31,7 +32,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  
  #if defined(__ARM_ARCH_7A__) && defined(BCMDMASGLISTOSL)
  	if (dmah != NULL) {
-@@ -641,7 +649,11 @@
+@@ -641,7 +649,11 @@ osl_dma_map(osl_t *osh, void *va, uint s
  				ASSERT(totsegs + nsegs <= MAX_DMA_SEGS);
  				sg->page_link = 0;
  				sg_set_buf(sg, PKTDATA(osh, skb), PKTLEN(osh, skb));
@@ -43,7 +44,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  			}
  			totsegs += nsegs;
  			totlen += PKTLEN(osh, skb);
-@@ -656,7 +668,11 @@
+@@ -656,7 +668,11 @@ osl_dma_map(osl_t *osh, void *va, uint s
  	}
  #endif 
  
@@ -55,7 +56,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  }
  
  void BCMFASTPATH
-@@ -665,8 +681,13 @@
+@@ -665,8 +681,13 @@ osl_dma_unmap(osl_t *osh, uint pa, uint
  	int dir;
  
  	ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));
diff --git a/srcpkgs/broadcom-wl-dkms/patches/015-linux-6.0.patch b/srcpkgs/broadcom-wl-dkms/patches/015-linux-6.0.patch
new file mode 100644
index 000000000000..348eaf8e379b
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/015-linux-6.0.patch
@@ -0,0 +1,31 @@
+From 933540c63f33e6ac2825d65c4b681ef3387d9146 Mon Sep 17 00:00:00 2001
+From: Antoine Cotten <hello@acotten.com>
+Date: Mon, 15 Aug 2022 17:53:51 +0200
+Subject: [PATCH] cfg80211_roam_info compat for MLO APIs in Linux >= 6.0
+
+The 'bssid' struct field is now under 'links.bssid'.
+
+See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=efbabc11650040c64884ff3019b88c7bcc0ceb1d
+
+Original patch by Joan Bruguera:
+https://gist.github.com/joanbm/207210d74637870c01ef5a3c262a597d
+---
+ src/wl/sys/wl_cfg80211_hybrid.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -2364,7 +2364,11 @@ wl_bss_roaming_done(struct wl_cfg80211_p
+ 
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
+ 	roam_info.channel = &wl->conf->channel;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
++	roam_info.links[0].bssid = (u8 *)&wl->bssid;
++#else
+ 	roam_info.bssid = (u8 *)&wl->bssid;
++#endif
+ 	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;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/gcc-4.9.patch b/srcpkgs/broadcom-wl-dkms/patches/gcc-4.9.patch
deleted file mode 100644
index ec354cecdbb5..000000000000
--- a/srcpkgs/broadcom-wl-dkms/patches/gcc-4.9.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-https://github.com/voidlinux/xbps-packages/issues/412
-
---- a/Makefile	2014-05-21 12:47:46.915833131 +0200
-+++ b/Makefile	2014-05-21 12:48:54.027409879 +0200
-@@ -126,6 +126,8 @@ EXTRA_CFLAGS       += -I$(src)/src/wl/sy
- EXTRA_CFLAGS       += -I$(src)/src/shared/bcmwifi/include
- #EXTRA_CFLAGS       += -DBCMDBG_ASSERT
- 
-+EXTRA_CFLAGS       += -Wno-date-time
-+
- EXTRA_LDFLAGS      := $(src)/lib/wlc_hybrid.o_shipped
- 
- KBASE              ?= /lib/modules/`uname -r`
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.15.patch b/srcpkgs/broadcom-wl-dkms/patches/linux-4.15.patch
deleted file mode 100644
index 9fcd7176b50a..000000000000
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.15.patch
+++ /dev/null
@@ -1,44 +0,0 @@
---- a/src/wl/sys/wl_linux.c     2018-01-31 11:33:26.000000000 +0100 
-+++ b/src/wl/sys/wl_linux.c     2018-01-31 15:27:18.000000000 +0100 
-@@ -93,7 +93,11 @@ 
- 
- #include <wlc_wowl.h>
- 
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) 
- static void wl_timer(ulong data);
-+#else 
-+static void wl_timer(struct timer_list *tl); 
-+#endif 
- static void _wl_timer(wl_timer_t *t);
- static struct net_device *wl_alloc_linux_if(wl_if_t *wlif);
- 
-@@ -2301,9 +2305,17 @@ 
- }
- 
- static void
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) 
- wl_timer(ulong data)
-+#else 
-+wl_timer(struct timer_list *tl) 
-+#endif 
- {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) 
- 	wl_timer_t *t = (wl_timer_t *)data;
-+#else 
-+    wl_timer_t *t = from_timer(t, tl, timer); 
-+#endif 
- 
- 	if (!WL_ALL_PASSIVE_ENAB(t->wl))
- 		_wl_timer(t);
-@@ -2355,7 +2367,11 @@ 
- 
- 	bzero(t, sizeof(wl_timer_t));
- 
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) 
- 	init_timer(&t->timer);
- 	t->timer.data = (ulong) t;
- 	t->timer.function = wl_timer;
-+#else 
-+    timer_setup(&t->timer, wl_timer, 0); 
-+#endif 
- 	t->wl = wl;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.3.patch b/srcpkgs/broadcom-wl-dkms/patches/linux-4.3.patch
deleted file mode 100644
index 9487eb68f0bc..000000000000
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.3.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff -ru a/src/shared/linux_osl.c b/src/shared/linux_osl.c
---- a/src/shared/linux_osl.c	2015-09-18 15:47:30.000000000 -0700
-+++ b/src/shared/linux_osl.c	2015-11-14 15:38:10.484563014 -0800
-@@ -932,7 +932,11 @@
- 	uint cycles;
- 
- #if defined(__i386__)
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
-+	cycles = rdtsc();
-+#else
- 	rdtscl(cycles);
-+#endif
- #else
- 	cycles = 0;
- #endif 
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.17.patch b/srcpkgs/broadcom-wl-dkms/patches/linux-5.17.patch
deleted file mode 100644
index 74847cb6bb40..000000000000
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.17.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-diff -u -r a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c
---- a/src/wl/sys/wl_linux.c	2022-03-23 00:35:42.930416350 +0000
-+++ b/src/wl/sys/wl_linux.c	2022-03-23 00:40:12.903771013 +0000
-@@ -2980,7 +2980,11 @@
- 	else
- 		dev->type = ARPHRD_IEEE80211_RADIOTAP;
- 
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
- 	bcopy(wl->dev->dev_addr, dev->dev_addr, ETHER_ADDR_LEN);
-+#else
-+	eth_hw_addr_set(wl->dev, dev->dev_addr);
-+#endif
- 
- #if defined(WL_USE_NETDEV_OPS)
- 	dev->netdev_ops = &wl_netdev_monitor_ops;
-@@ -3261,7 +3265,11 @@
- static ssize_t
- wl_proc_read(struct file *filp, char __user *buffer, size_t length, loff_t *offp)
- {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
- 	wl_info_t * wl = PDE_DATA(file_inode(filp));
-+#else
-+	wl_info_t * wl = pde_data(file_inode(filp));
-+#endif
- #endif
- 	int bcmerror, len;
- 	int to_user = 0;
-@@ -3318,7 +3326,11 @@
- static ssize_t
- wl_proc_write(struct file *filp, const char __user *buff, size_t length, loff_t *offp)
- {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
- 	wl_info_t * wl = PDE_DATA(file_inode(filp));
-+#else
-+	wl_info_t * wl = pde_data(file_inode(filp));
-+#endif
- #endif
- 	int from_user = 0;
- 	int bcmerror;

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Updated] broadcom-wl-dkms: patch for 6.0
  2022-10-14 11:56 [PR PATCH] broadcom-wl-dkms: patch for 6.0 sgn
@ 2022-10-14 16:37 ` sgn
  2022-10-14 16:56 ` sgn
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: sgn @ 2022-10-14 16:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1293 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages broadcom-wl-dkms
https://github.com/void-linux/void-packages/pull/39950

broadcom-wl-dkms: patch for 6.0
While we're at it, import change for 5.17

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **NO**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/39950.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-broadcom-wl-dkms-39950.patch --]
[-- Type: text/x-diff, Size: 56867 bytes --]

From 8c759d1894618b976c9be86253ec5da0c3b3b9fb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 14 Oct 2022 23:26:52 +0700
Subject: [PATCH 1/2] linux: change default congestion control algo to cubic

It's default algorithm upstream from 2.6.19
---
 srcpkgs/linux4.14/files/i386-dotconfig    | 5 +++--
 srcpkgs/linux4.14/files/ppc64-dotconfig   | 5 +++--
 srcpkgs/linux4.14/files/x86_64-dotconfig  | 5 +++--
 srcpkgs/linux4.19/files/i386-dotconfig    | 5 +++--
 srcpkgs/linux4.19/files/ppc64-dotconfig   | 5 +++--
 srcpkgs/linux4.19/files/ppc64le-dotconfig | 5 +++--
 srcpkgs/linux4.19/files/x86_64-dotconfig  | 5 +++--
 srcpkgs/linux4.9/files/i386-dotconfig     | 5 +++--
 srcpkgs/linux4.9/files/ppc64-dotconfig    | 5 +++--
 srcpkgs/linux4.9/files/x86_64-dotconfig   | 5 +++--
 srcpkgs/linux5.10/files/i386-dotconfig    | 5 +++--
 srcpkgs/linux5.10/files/ppc64-dotconfig   | 5 +++--
 srcpkgs/linux5.10/files/ppc64le-dotconfig | 5 +++--
 srcpkgs/linux5.10/files/x86_64-dotconfig  | 5 +++--
 srcpkgs/linux5.15/files/i386-dotconfig    | 5 +++--
 srcpkgs/linux5.15/files/ppc64-dotconfig   | 5 +++--
 srcpkgs/linux5.15/files/ppc64le-dotconfig | 5 +++--
 srcpkgs/linux5.15/files/x86_64-dotconfig  | 5 +++--
 srcpkgs/linux5.19/files/i386-dotconfig    | 5 +++--
 srcpkgs/linux5.19/files/ppc64-dotconfig   | 5 +++--
 srcpkgs/linux5.19/files/ppc64le-dotconfig | 5 +++--
 srcpkgs/linux5.19/files/x86_64-dotconfig  | 5 +++--
 srcpkgs/linux5.4/files/i386-dotconfig     | 5 +++--
 srcpkgs/linux5.4/files/ppc64-dotconfig    | 5 +++--
 srcpkgs/linux5.4/files/ppc64le-dotconfig  | 5 +++--
 srcpkgs/linux5.4/files/x86_64-dotconfig   | 5 +++--
 srcpkgs/linux6.0/files/i386-dotconfig     | 5 +++--
 srcpkgs/linux6.0/files/ppc64-dotconfig    | 5 +++--
 srcpkgs/linux6.0/files/ppc64le-dotconfig  | 5 +++--
 srcpkgs/linux6.0/files/x86_64-dotconfig   | 5 +++--
 30 files changed, 90 insertions(+), 60 deletions(-)

diff --git a/srcpkgs/linux4.14/files/i386-dotconfig b/srcpkgs/linux4.14/files/i386-dotconfig
index 9fcc0839e9da..0f3e9ea751a9 100644
--- a/srcpkgs/linux4.14/files/i386-dotconfig
+++ b/srcpkgs/linux4.14/files/i386-dotconfig
@@ -976,8 +976,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux4.14/files/ppc64-dotconfig b/srcpkgs/linux4.14/files/ppc64-dotconfig
index 574f6935acef..9833a51db5a9 100644
--- a/srcpkgs/linux4.14/files/ppc64-dotconfig
+++ b/srcpkgs/linux4.14/files/ppc64-dotconfig
@@ -925,8 +925,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux4.14/files/x86_64-dotconfig b/srcpkgs/linux4.14/files/x86_64-dotconfig
index d0a943589a64..44f826f1fe21 100644
--- a/srcpkgs/linux4.14/files/x86_64-dotconfig
+++ b/srcpkgs/linux4.14/files/x86_64-dotconfig
@@ -1006,8 +1006,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux4.19/files/i386-dotconfig b/srcpkgs/linux4.19/files/i386-dotconfig
index ed13503b7af5..fc593bfcf0d0 100644
--- a/srcpkgs/linux4.19/files/i386-dotconfig
+++ b/srcpkgs/linux4.19/files/i386-dotconfig
@@ -1059,8 +1059,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux4.19/files/ppc64-dotconfig b/srcpkgs/linux4.19/files/ppc64-dotconfig
index 87827b692bae..d394d45da49c 100644
--- a/srcpkgs/linux4.19/files/ppc64-dotconfig
+++ b/srcpkgs/linux4.19/files/ppc64-dotconfig
@@ -976,8 +976,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux4.19/files/ppc64le-dotconfig b/srcpkgs/linux4.19/files/ppc64le-dotconfig
index 9f61fbb57682..3c5adb5234ba 100644
--- a/srcpkgs/linux4.19/files/ppc64le-dotconfig
+++ b/srcpkgs/linux4.19/files/ppc64le-dotconfig
@@ -894,8 +894,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux4.19/files/x86_64-dotconfig b/srcpkgs/linux4.19/files/x86_64-dotconfig
index d488ad4e7ff3..a5e03674c52d 100644
--- a/srcpkgs/linux4.19/files/x86_64-dotconfig
+++ b/srcpkgs/linux4.19/files/x86_64-dotconfig
@@ -1105,8 +1105,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux4.9/files/i386-dotconfig b/srcpkgs/linux4.9/files/i386-dotconfig
index d04e07d1afe7..098d7e317f1a 100644
--- a/srcpkgs/linux4.9/files/i386-dotconfig
+++ b/srcpkgs/linux4.9/files/i386-dotconfig
@@ -905,8 +905,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux4.9/files/ppc64-dotconfig b/srcpkgs/linux4.9/files/ppc64-dotconfig
index 4bc17d04843d..e02df2c617d1 100644
--- a/srcpkgs/linux4.9/files/ppc64-dotconfig
+++ b/srcpkgs/linux4.9/files/ppc64-dotconfig
@@ -825,8 +825,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux4.9/files/x86_64-dotconfig b/srcpkgs/linux4.9/files/x86_64-dotconfig
index 3ac7fb403d7d..522cf90a6343 100644
--- a/srcpkgs/linux4.9/files/x86_64-dotconfig
+++ b/srcpkgs/linux4.9/files/x86_64-dotconfig
@@ -924,8 +924,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux5.10/files/i386-dotconfig b/srcpkgs/linux5.10/files/i386-dotconfig
index a6983d73ae81..1e82c5cdbe3b 100644
--- a/srcpkgs/linux5.10/files/i386-dotconfig
+++ b/srcpkgs/linux5.10/files/i386-dotconfig
@@ -1081,8 +1081,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux5.10/files/ppc64-dotconfig b/srcpkgs/linux5.10/files/ppc64-dotconfig
index 7227a355e3c6..2e317d894134 100644
--- a/srcpkgs/linux5.10/files/ppc64-dotconfig
+++ b/srcpkgs/linux5.10/files/ppc64-dotconfig
@@ -985,8 +985,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux5.10/files/ppc64le-dotconfig b/srcpkgs/linux5.10/files/ppc64le-dotconfig
index de9c8c54e6a7..356eb858c81b 100644
--- a/srcpkgs/linux5.10/files/ppc64le-dotconfig
+++ b/srcpkgs/linux5.10/files/ppc64le-dotconfig
@@ -912,8 +912,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux5.10/files/x86_64-dotconfig b/srcpkgs/linux5.10/files/x86_64-dotconfig
index 0e9f4e051be4..627e97eb3045 100644
--- a/srcpkgs/linux5.10/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.10/files/x86_64-dotconfig
@@ -1134,8 +1134,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux5.15/files/i386-dotconfig b/srcpkgs/linux5.15/files/i386-dotconfig
index c74917751f70..23b18fa6322c 100644
--- a/srcpkgs/linux5.15/files/i386-dotconfig
+++ b/srcpkgs/linux5.15/files/i386-dotconfig
@@ -1073,8 +1073,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux5.15/files/ppc64-dotconfig b/srcpkgs/linux5.15/files/ppc64-dotconfig
index 7291dd631945..e3991334fac2 100644
--- a/srcpkgs/linux5.15/files/ppc64-dotconfig
+++ b/srcpkgs/linux5.15/files/ppc64-dotconfig
@@ -1021,8 +1021,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux5.15/files/ppc64le-dotconfig b/srcpkgs/linux5.15/files/ppc64le-dotconfig
index 5c8c5e8f82a3..a6bbfb1ed151 100644
--- a/srcpkgs/linux5.15/files/ppc64le-dotconfig
+++ b/srcpkgs/linux5.15/files/ppc64le-dotconfig
@@ -946,8 +946,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux5.15/files/x86_64-dotconfig b/srcpkgs/linux5.15/files/x86_64-dotconfig
index 4bfd6b11e330..9b2710b7e941 100644
--- a/srcpkgs/linux5.15/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.15/files/x86_64-dotconfig
@@ -1133,8 +1133,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux5.19/files/i386-dotconfig b/srcpkgs/linux5.19/files/i386-dotconfig
index bf3ce35396c3..e30a548a3399 100644
--- a/srcpkgs/linux5.19/files/i386-dotconfig
+++ b/srcpkgs/linux5.19/files/i386-dotconfig
@@ -1108,8 +1108,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux5.19/files/ppc64-dotconfig b/srcpkgs/linux5.19/files/ppc64-dotconfig
index 650f7f6848ad..4f9c3937f893 100644
--- a/srcpkgs/linux5.19/files/ppc64-dotconfig
+++ b/srcpkgs/linux5.19/files/ppc64-dotconfig
@@ -1048,8 +1048,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux5.19/files/ppc64le-dotconfig b/srcpkgs/linux5.19/files/ppc64le-dotconfig
index 49d4d11350e1..17c13b889a64 100644
--- a/srcpkgs/linux5.19/files/ppc64le-dotconfig
+++ b/srcpkgs/linux5.19/files/ppc64le-dotconfig
@@ -973,8 +973,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux5.19/files/x86_64-dotconfig b/srcpkgs/linux5.19/files/x86_64-dotconfig
index 749aaf7144ef..e388fb0d3c96 100644
--- a/srcpkgs/linux5.19/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.19/files/x86_64-dotconfig
@@ -1183,8 +1183,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux5.4/files/i386-dotconfig b/srcpkgs/linux5.4/files/i386-dotconfig
index 9ad39afed993..06ce3445b258 100644
--- a/srcpkgs/linux5.4/files/i386-dotconfig
+++ b/srcpkgs/linux5.4/files/i386-dotconfig
@@ -1031,8 +1031,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux5.4/files/ppc64-dotconfig b/srcpkgs/linux5.4/files/ppc64-dotconfig
index e5734d6c40b3..fc850d1d187d 100644
--- a/srcpkgs/linux5.4/files/ppc64-dotconfig
+++ b/srcpkgs/linux5.4/files/ppc64-dotconfig
@@ -948,8 +948,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux5.4/files/ppc64le-dotconfig b/srcpkgs/linux5.4/files/ppc64le-dotconfig
index 3fcbaec21dfd..0d1c4697f5ed 100644
--- a/srcpkgs/linux5.4/files/ppc64le-dotconfig
+++ b/srcpkgs/linux5.4/files/ppc64le-dotconfig
@@ -877,8 +877,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux5.4/files/x86_64-dotconfig b/srcpkgs/linux5.4/files/x86_64-dotconfig
index 71a859468c44..689f1790394c 100644
--- a/srcpkgs/linux5.4/files/x86_64-dotconfig
+++ b/srcpkgs/linux5.4/files/x86_64-dotconfig
@@ -1077,8 +1077,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux6.0/files/i386-dotconfig b/srcpkgs/linux6.0/files/i386-dotconfig
index f55481947e4a..37406a602a5a 100644
--- a/srcpkgs/linux6.0/files/i386-dotconfig
+++ b/srcpkgs/linux6.0/files/i386-dotconfig
@@ -1112,8 +1112,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux6.0/files/ppc64-dotconfig b/srcpkgs/linux6.0/files/ppc64-dotconfig
index 9b4812205785..9ed2df8d3120 100644
--- a/srcpkgs/linux6.0/files/ppc64-dotconfig
+++ b/srcpkgs/linux6.0/files/ppc64-dotconfig
@@ -1056,8 +1056,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux6.0/files/ppc64le-dotconfig b/srcpkgs/linux6.0/files/ppc64le-dotconfig
index 472346d8671f..b1ff13e28b7e 100644
--- a/srcpkgs/linux6.0/files/ppc64le-dotconfig
+++ b/srcpkgs/linux6.0/files/ppc64le-dotconfig
@@ -981,8 +981,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
diff --git a/srcpkgs/linux6.0/files/x86_64-dotconfig b/srcpkgs/linux6.0/files/x86_64-dotconfig
index 9172a49f2c4e..63a1a1948813 100644
--- a/srcpkgs/linux6.0/files/x86_64-dotconfig
+++ b/srcpkgs/linux6.0/files/x86_64-dotconfig
@@ -1185,8 +1185,9 @@ CONFIG_TCP_CONG_ILLINOIS=m
 CONFIG_TCP_CONG_DCTCP=m
 CONFIG_TCP_CONG_CDG=m
 CONFIG_TCP_CONG_BBR=m
-CONFIG_DEFAULT_RENO=y
-CONFIG_DEFAULT_TCP_CONG="reno"
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
 CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y

From 127c6272071fa8b131e5c763456aedfa0ee91958 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 14 Oct 2022 18:54:43 +0700
Subject: [PATCH 2/2] broadcom-wl-dkms: patch for 6.0

While we're at it, import change for 5.17

Close: #39950
---
 .../patches/001-null-pointer-fix.patch        | 13 ++---
 .../patches/002-gcc-4.9.patch                 | 15 +++++
 .../patches/003-linux-4.3.patch               | 16 ++++++
 .../{linux-4.7.patch => 004-linux-4.7.patch}  | 35 +++++++-----
 .../{linux-4.8.patch => 005-linux-4.8.patch}  | 12 ++--
 ...{linux-4.11.patch => 006-linux-4.11.patch} | 20 +++----
 ...{linux-4.12.patch => 007-linux-4.12.patch} | 27 ++++-----
 .../patches/008-linux-4.14.patch              | 37 ++++++++++++
 .../patches/009-linux-4.15.patch              | 48 ++++++++++++++++
 .../{linux-5.1.patch => 010-linux-5.1.patch}  | 15 +++--
 .../{linux-5.6.patch => 011-linux-5.6.patch}  | 24 ++++----
 ...{linux-5.10.patch => 012-linux-5.10.patch} | 49 ++++++++--------
 .../patches/013-linux-5.17.patch              | 56 +++++++++++++++++++
 ...{linux-5.18.patch => 014-linux-5.18.patch} | 19 ++++---
 .../patches/015-linux-6.0.patch               | 31 ++++++++++
 .../broadcom-wl-dkms/patches/gcc-4.9.patch    | 13 -----
 .../broadcom-wl-dkms/patches/linux-4.15.patch | 44 ---------------
 .../broadcom-wl-dkms/patches/linux-4.3.patch  | 15 -----
 .../broadcom-wl-dkms/patches/linux-5.17.patch | 39 -------------
 srcpkgs/broadcom-wl-dkms/template             |  2 +-
 20 files changed, 318 insertions(+), 212 deletions(-)
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/002-gcc-4.9.patch
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/003-linux-4.3.patch
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-4.7.patch => 004-linux-4.7.patch} (73%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-4.8.patch => 005-linux-4.8.patch} (71%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-4.11.patch => 006-linux-4.11.patch} (63%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-4.12.patch => 007-linux-4.12.patch} (68%)
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/008-linux-4.14.patch
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/009-linux-4.15.patch
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-5.1.patch => 010-linux-5.1.patch} (50%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-5.6.patch => 011-linux-5.6.patch} (63%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-5.10.patch => 012-linux-5.10.patch} (74%)
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/013-linux-5.17.patch
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-5.18.patch => 014-linux-5.18.patch} (76%)
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/015-linux-6.0.patch
 delete mode 100644 srcpkgs/broadcom-wl-dkms/patches/gcc-4.9.patch
 delete mode 100644 srcpkgs/broadcom-wl-dkms/patches/linux-4.15.patch
 delete mode 100644 srcpkgs/broadcom-wl-dkms/patches/linux-4.3.patch
 delete mode 100644 srcpkgs/broadcom-wl-dkms/patches/linux-5.17.patch

diff --git a/srcpkgs/broadcom-wl-dkms/patches/001-null-pointer-fix.patch b/srcpkgs/broadcom-wl-dkms/patches/001-null-pointer-fix.patch
index adef19f30af1..e9b4bc26d73a 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/001-null-pointer-fix.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/001-null-pointer-fix.patch
@@ -8,11 +8,11 @@ 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)
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+@@ -2165,8 +2165,8 @@ wl_start(struct sk_buff *skb, struct net
  	wlif = WL_DEV_IF(dev);
  	wl = WL_INFO(dev);
  
@@ -22,6 +22,3 @@ index 860b935..295156f 100644
  
  		TXQ_LOCK(wl);
  
--- 
-1.9.1
-
diff --git a/srcpkgs/broadcom-wl-dkms/patches/002-gcc-4.9.patch b/srcpkgs/broadcom-wl-dkms/patches/002-gcc-4.9.patch
new file mode 100644
index 000000000000..021f98a74a83
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/002-gcc-4.9.patch
@@ -0,0 +1,15 @@
+https://github.com/voidlinux/xbps-packages/issues/412
+
+Index: broadcom-wl-dkms-6.30.223.271/Makefile
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/Makefile
++++ broadcom-wl-dkms-6.30.223.271/Makefile
+@@ -145,6 +145,8 @@ ifeq "$(GE_49)" "1"
+ EXTRA_CFLAGS       += -Wno-date-time
+ endif
+ 
++EXTRA_CFLAGS       += -Wno-date-time
++
+ EXTRA_LDFLAGS      := $(src)/lib/wlc_hybrid.o_shipped
+ 
+ KBASE              ?= /lib/modules/`uname -r`
diff --git a/srcpkgs/broadcom-wl-dkms/patches/003-linux-4.3.patch b/srcpkgs/broadcom-wl-dkms/patches/003-linux-4.3.patch
new file mode 100644
index 000000000000..d041be223f35
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/003-linux-4.3.patch
@@ -0,0 +1,16 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/shared/linux_osl.c
++++ broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+@@ -932,7 +932,11 @@ osl_getcycles(void)
+ 	uint cycles;
+ 
+ #if defined(__i386__)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
++	cycles = rdtsc();
++#else
+ 	rdtscl(cycles);
++#endif
+ #else
+ 	cycles = 0;
+ #endif 
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.7.patch b/srcpkgs/broadcom-wl-dkms/patches/004-linux-4.7.patch
similarity index 73%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-4.7.patch
rename to srcpkgs/broadcom-wl-dkms/patches/004-linux-4.7.patch
index e2d0dfc23f22..dc8e12960af4 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.7.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/004-linux-4.7.patch
@@ -10,12 +10,14 @@ makes heavy use of that enum. The simple fix is to re-create the values.
 This patch came from the folks at Manjaro.
 https://github.com/manjaro/packages-extra/blob/master/broadcom-wl-dkms/linux-47.patch
 
---- a/src/wl/sys/wl_linux.h   2016-06-04 15:24:22.915341000 +0200
-+++ b/src/wl/sys/wl_linux.h   2016-06-04 15:29:36.236136244 +0200
-@@ -18,6 +18,13 @@
-  * $Id: wl_linux.h 369548 2012-11-19 09:01:01Z $
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.h
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.h
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.h
+@@ -19,6 +19,13 @@
+  * $Id: wl_cfg80211.h,v 1.1.8.1 2011-01-26 00:57:46 $
   */
-
+ 
 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
 +#define ieee80211_band nl80211_band
 +#define IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ
@@ -23,15 +25,17 @@ https://github.com/manjaro/packages-extra/blob/master/broadcom-wl-dkms/linux-47.
 +#define IEEE80211_NUM_BANDS NUM_NL80211_BANDS
 +#endif
 +
- #ifndef _wl_linux_h_
- #define _wl_linux_h_
-
---- a/src/wl/sys/wl_cfg80211_hybrid.h 2016-06-04 15:34:41.123022255 +0200
-+++ b/src/wl/sys/wl_cfg80211_hybrid.h 2016-06-04 15:37:25.391772105 +0200
-@@ -19,6 +19,13 @@
-  * $Id: wl_cfg80211.h,v 1.1.8.1 2011-01-26 00:57:46 $
+ #ifndef _wl_cfg80211_h_
+ #define _wl_cfg80211_h_
+ 
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.h
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.h
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.h
+@@ -18,6 +18,13 @@
+  * $Id: wl_linux.h 369548 2012-11-19 09:01:01Z $
   */
-
+ 
 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
 +#define ieee80211_band nl80211_band
 +#define IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ
@@ -39,5 +43,6 @@ https://github.com/manjaro/packages-extra/blob/master/broadcom-wl-dkms/linux-47.
 +#define IEEE80211_NUM_BANDS NUM_NL80211_BANDS
 +#endif
 +
- #ifndef _wl_cfg80211_h_
- #define _wl_cfg80211_h_
+ #ifndef _wl_linux_h_
+ #define _wl_linux_h_
+ 
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.8.patch b/srcpkgs/broadcom-wl-dkms/patches/005-linux-4.8.patch
similarity index 71%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-4.8.patch
rename to srcpkgs/broadcom-wl-dkms/patches/005-linux-4.8.patch
index 0f3e81906226..9047e2f88ded 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.8.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/005-linux-4.8.patch
@@ -1,8 +1,10 @@
 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 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -2386,8 +2386,15 @@ wl_bss_connect_done(struct wl_cfg80211_p
  	s32 err = 0;
  
  	if (wl->scan_request) {
@@ -19,7 +21,7 @@ Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=839629
  		wl->scan_request = NULL;
  	}
  
-@@ -2488,7 +2495,14 @@
+@@ -2488,7 +2495,14 @@ wl_notify_scan_status(struct wl_cfg80211
  
  scan_done_out:
  	if (wl->scan_request) {
@@ -34,7 +36,7 @@ Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=839629
  		wl->scan_request = NULL;
  	}
  	rtnl_unlock();
-@@ -2913,7 +2927,14 @@
+@@ -2913,7 +2927,14 @@ s32 wl_cfg80211_down(struct net_device *
  	s32 err = 0;
  
  	if (wl->scan_request) {
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.11.patch b/srcpkgs/broadcom-wl-dkms/patches/006-linux-4.11.patch
similarity index 63%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-4.11.patch
rename to srcpkgs/broadcom-wl-dkms/patches/006-linux-4.11.patch
index ae73bcf9b6b1..36b67681c8ca 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.11.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/006-linux-4.11.patch
@@ -1,7 +1,7 @@
-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
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
 @@ -30,6 +30,9 @@
  #include <linux/kthread.h>
  #include <linux/netdevice.h>
@@ -12,10 +12,10 @@ index a9671e2..da36405 100644
  #include <net/cfg80211.h>
  #include <linux/nl80211.h>
  #include <net/rtnetlink.h>
-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
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
 @@ -117,6 +117,9 @@ int wl_found = 0;
  
  typedef struct priv_link {
@@ -26,7 +26,7 @@ index 489c9f5..f8278ad 100644
  } 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)
+@@ -2449,6 +2452,9 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rx
  {
  	struct sk_buff *oskb = (struct sk_buff *)p;
  	struct sk_buff *skb;
@@ -36,7 +36,7 @@ index 489c9f5..f8278ad 100644
  	uchar *pdata;
  	uint len;
  
-@@ -2916,7 +2922,13 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rxsts, void *p)
+@@ -2915,7 +2921,13 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rx
  	if (skb == NULL) return;
  
  	skb->dev = wl->monitor_dev;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.12.patch b/srcpkgs/broadcom-wl-dkms/patches/007-linux-4.12.patch
similarity index 68%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-4.12.patch
rename to srcpkgs/broadcom-wl-dkms/patches/007-linux-4.12.patch
index bf9494a30fed..f529177ac2d5 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.12.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/007-linux-4.12.patch
@@ -1,7 +1,8 @@
-diff -ru work.orig/src/wl/sys/wl_cfg80211_hybrid.c work.patched/src/wl/sys/wl_cfg80211_hybrid.c
---- a/src/wl/sys/wl_cfg80211_hybrid.c	2017-06-10 15:50:27.328823384 -0700
-+++ b/src/wl/sys/wl_cfg80211_hybrid.c	2017-06-10 15:52:40.540809187 -0700
-@@ -52,8 +52,13 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -52,8 +52,13 @@ u32 wl_dbg_level = WL_DBG_ERR | WL_DBG_I
  u32 wl_dbg_level = WL_DBG_ERR;
  #endif
  
@@ -15,7 +16,7 @@ diff -ru work.orig/src/wl/sys/wl_cfg80211_hybrid.c work.patched/src/wl/sys/wl_cf
  #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
  static s32
  wl_cfg80211_scan(struct wiphy *wiphy,
-@@ -466,7 +471,11 @@
+@@ -466,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,7 +28,7 @@ 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 @@
+@@ -2361,12 +2370,26 @@ 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);
@@ -42,19 +43,19 @@ diff -ru work.orig/src/wl/sys/wl_cfg80211_hybrid.c work.patched/src/wl/sys/wl_cf
  	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,
++	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(2, 6, 39)
  			&wl->conf->channel,	 
-@@ -2374,6 +2397,7 @@
+@@ -2374,6 +2397,7 @@ wl_bss_roaming_done(struct wl_cfg80211_p
  			(u8 *)&wl->bssid,
  			conn_info->req_ie, conn_info->req_ie_len,
  			conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL);
diff --git a/srcpkgs/broadcom-wl-dkms/patches/008-linux-4.14.patch b/srcpkgs/broadcom-wl-dkms/patches/008-linux-4.14.patch
new file mode 100644
index 000000000000..0a3d021667bf
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/008-linux-4.14.patch
@@ -0,0 +1,37 @@
+From: Gerardo Esteban Malazdrewicz <gerardo@malazdrewicz.com.ar>
+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 files changed, 12 insertions(+), 1 deletion(-)
+
+Index: broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/shared/linux_osl.c
++++ broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+@@ -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/srcpkgs/broadcom-wl-dkms/patches/009-linux-4.15.patch b/srcpkgs/broadcom-wl-dkms/patches/009-linux-4.15.patch
new file mode 100644
index 000000000000..82fa33c89bf4
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/009-linux-4.15.patch
@@ -0,0 +1,48 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+@@ -93,7 +93,11 @@ struct iw_statistics *wl_get_wireless_st
+ 
+ #include <wlc_wowl.h>
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ static void wl_timer(ulong data);
++#else
++static void wl_timer(struct timer_list *tl);
++#endif
+ static void _wl_timer(wl_timer_t *t);
+ static struct net_device *wl_alloc_linux_if(wl_if_t *wlif);
+ 
+@@ -2301,9 +2305,17 @@ wl_timer_task(wl_task_t *task)
+ }
+ 
+ static void
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ wl_timer(ulong data)
++#else
++wl_timer(struct timer_list *tl)
++#endif
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ 	wl_timer_t *t = (wl_timer_t *)data;
++#else
++    wl_timer_t *t = from_timer(t, tl, timer);
++#endif
+ 
+ 	if (!WL_ALL_PASSIVE_ENAB(t->wl))
+ 		_wl_timer(t);
+@@ -2355,9 +2367,13 @@ wl_init_timer(wl_info_t *wl, void (*fn)(
+ 
+ 	bzero(t, sizeof(wl_timer_t));
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ 	init_timer(&t->timer);
+ 	t->timer.data = (ulong) t;
+ 	t->timer.function = wl_timer;
++#else
++    timer_setup(&t->timer, wl_timer, 0);
++#endif
+ 	t->wl = wl;
+ 	t->fn = fn;
+ 	t->arg = arg;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.1.patch b/srcpkgs/broadcom-wl-dkms/patches/010-linux-5.1.patch
similarity index 50%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-5.1.patch
rename to srcpkgs/broadcom-wl-dkms/patches/010-linux-5.1.patch
index 1820dff63c20..66dcbdc901c3 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.1.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/010-linux-5.1.patch
@@ -1,6 +1,8 @@
---- a/src/wl/sys/wl_cfg80211_hybrid.c
-+++ b/src/wl/sys/wl_cfg80211_hybrid.c
-@@ -43,6 +43,9 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -46,6 +46,9 @@
  #define EVENT_FLAGS(e) dtoh16((e)->flags)
  #define EVENT_STATUS(e) dtoh32((e)->status)
  
@@ -10,8 +12,10 @@
  #ifdef BCMDBG
  u32 wl_dbg_level = WL_DBG_ERR | WL_DBG_INFO;
  #else
---- a/src/wl/sys/wl_iw.c
-+++ b/src/wl/sys/wl_iw.c
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_iw.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_iw.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_iw.c
 @@ -61,6 +61,9 @@ typedef struct priv_link {
  	wl_iw_t *wliw;
  } priv_link_t;
@@ -22,4 +26,3 @@
  #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24))
  #define WL_DEV_LINK(dev)       (priv_link_t*)(dev->priv)
  #else
-
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.6.patch b/srcpkgs/broadcom-wl-dkms/patches/011-linux-5.6.patch
similarity index 63%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-5.6.patch
rename to srcpkgs/broadcom-wl-dkms/patches/011-linux-5.6.patch
index 113fd092ecce..09420647773b 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.6.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/011-linux-5.6.patch
@@ -1,8 +1,8 @@
-diff --git src/shared/linux_osl.c 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)
+Index: broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/shared/linux_osl.c
++++ broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+@@ -946,7 +946,7 @@ osl_getcycles(void)
  void *
  osl_reg_map(uint32 pa, uint size)
  {
@@ -11,11 +11,11 @@ index 6157d18..8237ec7 100644
  }
  
  void
-diff --git src/wl/sys/wl_linux.c 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,
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+@@ -589,7 +589,7 @@ wl_attach(uint16 vendor, uint16 device,
  	}
  	wl->bcm_bustype = bustype;
  
@@ -24,7 +24,7 @@ index 0d05100..2ed1f0d 100644
  		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)
+@@ -779,7 +779,7 @@ 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);
@@ -33,7 +33,7 @@ index 0d05100..2ed1f0d 100644
  			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
+@@ -3363,12 +3363,19 @@ wl_proc_write(struct file *filp, const c
  }
  
  #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch b/srcpkgs/broadcom-wl-dkms/patches/012-linux-5.10.patch
similarity index 74%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch
rename to srcpkgs/broadcom-wl-dkms/patches/012-linux-5.10.patch
index 53514bf020a1..20c043a7fcd7 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/012-linux-5.10.patch
@@ -25,9 +25,10 @@ Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
  src/wl/sys/wlc_pub.h            |  1 +
  5 files changed, 42 insertions(+), 51 deletions(-)
 
-diff -u -r src/wl/sys/wl_cfg80211_hybrid.c src/wl/sys/wl_cfg80211_hybrid.c
---- a/src/wl/sys/wl_cfg80211_hybrid.c	2021-01-25 08:55:05.625224400 -0800
-+++ b/src/wl/sys/wl_cfg80211_hybrid.c	2021-01-25 08:58:30.000982902 -0800
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
 @@ -41,6 +41,7 @@
  #include <wlioctl.h>
  #include <proto/802.11.h>
@@ -36,7 +37,7 @@ diff -u -r src/wl/sys/wl_cfg80211_hybrid.c src/wl/sys/wl_cfg80211_hybrid.c
  
  #define EVENT_TYPE(e) dtoh32((e)->event_type)
  #define EVENT_FLAGS(e) dtoh16((e)->flags)
-@@ -446,30 +447,8 @@
+@@ -446,30 +447,8 @@ static void key_endian_to_host(struct wl
  static s32
  wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len)
  {
@@ -68,10 +69,11 @@ diff -u -r src/wl/sys/wl_cfg80211_hybrid.c src/wl/sys/wl_cfg80211_hybrid.c
  }
  
  static s32
-diff -u -r src/wl/sys/wl_iw.c src/wl/sys/wl_iw.c
---- a/src/wl/sys/wl_iw.c	2021-01-25 09:00:13.163543809 -0800
-+++ b/src/wl/sys/wl_iw.c	2021-01-25 09:02:04.218646005 -0800
-@@ -37,6 +37,7 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_iw.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_iw.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_iw.c
+@@ -37,6 +37,7 @@ typedef const struct si_pub	si_t;
  
  #include <wl_dbg.h>
  #include <wl_iw.h>
@@ -79,7 +81,7 @@ diff -u -r src/wl/sys/wl_iw.c src/wl/sys/wl_iw.c
  
  extern bool wl_iw_conn_status_str(uint32 event_type, uint32 status,
  	uint32 reason, char* stringBuf, uint buflen);
-@@ -106,29 +107,7 @@
+@@ -106,29 +107,7 @@ dev_wlc_ioctl(
  	int len
  )
  {
@@ -110,10 +112,11 @@ diff -u -r src/wl/sys/wl_iw.c src/wl/sys/wl_iw.c
  }
  
  static int
-diff -u -r src/wl/sys/wl_linux.c src/wl/sys/wl_linux.c
---- a/src/wl/sys/wl_linux.c	2021-01-25 09:02:08.055475147 -0800
-+++ b/src/wl/sys/wl_linux.c	2021-01-25 09:06:11.894764339 -0800
-@@ -1650,10 +1650,7 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+@@ -1650,10 +1650,7 @@ wl_ioctl(struct net_device *dev, struct
  		goto done2;
  	}
  
@@ -125,7 +128,7 @@ diff -u -r src/wl/sys/wl_linux.c src/wl/sys/wl_linux.c
  		if (!(buf = (void *) MALLOC(wl->osh, MAX(ioc.len, WLC_IOCTL_MAXLEN)))) {
  			bcmerror = BCME_NORESOURCE;
  			goto done2;
-@@ -1674,7 +1671,7 @@
+@@ -1674,7 +1671,7 @@ wl_ioctl(struct net_device *dev, struct
  	WL_UNLOCK(wl);
  
  done1:
@@ -134,7 +137,7 @@ diff -u -r src/wl/sys/wl_linux.c src/wl/sys/wl_linux.c
  		if (copy_to_user(ioc.buf, buf, ioc.len))
  			bcmerror = BCME_BADADDR;
  		MFREE(wl->osh, buf, MAX(ioc.len, WLC_IOCTL_MAXLEN));
-@@ -1684,6 +1681,39 @@
+@@ -1684,6 +1681,39 @@ done2:
  	ASSERT(VALID_BCMERROR(bcmerror));
  	if (bcmerror != 0)
  		wl->pub->bcmerror = bcmerror;
@@ -174,9 +177,10 @@ diff -u -r src/wl/sys/wl_linux.c src/wl/sys/wl_linux.c
  	return (OSL_ERROR(bcmerror));
  }
  
-diff -u -r src/wl/sys/wl_linux.h src/wl/sys/wl_linux.h
---- a/src/wl/sys/wl_linux.h	2021-01-25 09:06:15.188672391 -0800
-+++ b/src/wl/sys/wl_linux.h	2021-01-25 09:07:49.457810535 -0800
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.h
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.h
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.h
 @@ -29,6 +29,7 @@
  #define _wl_linux_h_
  
@@ -185,7 +189,7 @@ diff -u -r src/wl/sys/wl_linux.h src/wl/sys/wl_linux.h
  
  typedef struct wl_timer {
  	struct timer_list 	timer;
-@@ -194,6 +195,7 @@
+@@ -194,6 +195,7 @@ extern irqreturn_t wl_isr(int irq, void
  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);
@@ -193,9 +197,10 @@ diff -u -r src/wl/sys/wl_linux.h src/wl/sys/wl_linux.h
  extern struct net_device * wl_netdev_get(wl_info_t *wl);
  
  #endif 
-diff -u -r src/wl/sys/wlc_pub.h src/wl/sys/wlc_pub.h
---- a/src/wl/sys/wlc_pub.h	2021-01-25 09:07:54.543645032 -0800
-+++ b/src/wl/sys/wlc_pub.h	2021-01-25 09:08:10.772110464 -0800
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wlc_pub.h
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wlc_pub.h
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wlc_pub.h
 @@ -24,6 +24,7 @@
  
  #include <wlc_types.h>
diff --git a/srcpkgs/broadcom-wl-dkms/patches/013-linux-5.17.patch b/srcpkgs/broadcom-wl-dkms/patches/013-linux-5.17.patch
new file mode 100644
index 000000000000..c8223dbc008a
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/013-linux-5.17.patch
@@ -0,0 +1,56 @@
+Source: Arch Linux
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+@@ -93,6 +93,10 @@ struct iw_statistics *wl_get_wireless_st
+ 
+ #include <wlc_wowl.h>
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)
++#define PDE_DATA pde_data
++#endif
++
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ static void wl_timer(ulong data);
+ #else
+@@ -493,6 +497,12 @@ wl_if_setup(struct net_device *dev)
+ #endif
+ }
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
++static inline void eth_hw_addr_set(struct net_device *dev, const void *addr) {
++	memcpy(dev->dev_addr, addr, ETHER_ADDR_LEN);
++}
++#endif
++
+ static wl_info_t *
+ wl_attach(uint16 vendor, uint16 device, ulong regs,
+ 	uint bustype, void *btparam, uint irq, uchar* bar1_addr, uint32 bar1_size)
+@@ -637,7 +647,7 @@ wl_attach(uint16 vendor, uint16 device,
+ 			WL_ERROR(("wl%d: Error setting MAC ADDRESS\n", unit));
+ 	}
+ #endif 
+-	bcopy(&wl->pub->cur_etheraddr, dev->dev_addr, ETHER_ADDR_LEN);
++	eth_hw_addr_set(dev, wl->pub->cur_etheraddr.octet);
+ 
+ 	online_cpus = 1;
+ 
+@@ -1838,7 +1848,7 @@ wl_set_mac_address(struct net_device *de
+ 
+ 	WL_LOCK(wl);
+ 
+-	bcopy(sa->sa_data, dev->dev_addr, ETHER_ADDR_LEN);
++	eth_hw_addr_set(dev, sa->sa_data);
+ 	err = wlc_iovar_op(wl->wlc, "cur_etheraddr", NULL, 0, sa->sa_data, ETHER_ADDR_LEN,
+ 		IOV_SET, (WL_DEV_IF(dev))->wlcif);
+ 	WL_UNLOCK(wl);
+@@ -3021,7 +3031,7 @@ _wl_add_monitor_if(wl_task_t *task)
+ 	else
+ 		dev->type = ARPHRD_IEEE80211_RADIOTAP;
+ 
+-	bcopy(wl->dev->dev_addr, dev->dev_addr, ETHER_ADDR_LEN);
++	eth_hw_addr_set(dev, wl->dev->dev_addr);
+ 
+ #if defined(WL_USE_NETDEV_OPS)
+ 	dev->netdev_ops = &wl_netdev_monitor_ops;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.18.patch b/srcpkgs/broadcom-wl-dkms/patches/014-linux-5.18.patch
similarity index 76%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-5.18.patch
rename to srcpkgs/broadcom-wl-dkms/patches/014-linux-5.18.patch
index d837429a6899..c404f98fc9b5 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.18.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/014-linux-5.18.patch
@@ -1,7 +1,8 @@
-diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
---- a/src/shared/linux_osl.c	2022-05-24 20:51:15.662604980 +0000
-+++ b/src/shared/linux_osl.c	2022-05-24 21:13:38.264472425 +0000
-@@ -599,6 +599,8 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/shared/linux_osl.c
++++ broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+@@ -599,6 +599,8 @@ osl_dma_alloc_consistent(osl_t *osh, uin
  	va = kmalloc(size, GFP_ATOMIC | __GFP_ZERO);
  	if (va)
  		*pap = (ulong)__virt_to_phys(va);
@@ -10,7 +11,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  #else
  	va = pci_alloc_consistent(osh->pdev, size, (dma_addr_t*)pap);
  #endif
-@@ -612,6 +614,8 @@
+@@ -612,6 +614,8 @@ osl_dma_free_consistent(osl_t *osh, void
  
  #ifdef __ARM_ARCH_7A__
  	kfree(va);
@@ -19,7 +20,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  #else
  	pci_free_consistent(osh->pdev, size, va, (dma_addr_t)pa);
  #endif
-@@ -623,7 +627,11 @@
+@@ -623,7 +627,11 @@ osl_dma_map(osl_t *osh, void *va, uint s
  	int dir;
  
  	ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));
@@ -31,7 +32,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  
  #if defined(__ARM_ARCH_7A__) && defined(BCMDMASGLISTOSL)
  	if (dmah != NULL) {
-@@ -641,7 +649,11 @@
+@@ -641,7 +649,11 @@ osl_dma_map(osl_t *osh, void *va, uint s
  				ASSERT(totsegs + nsegs <= MAX_DMA_SEGS);
  				sg->page_link = 0;
  				sg_set_buf(sg, PKTDATA(osh, skb), PKTLEN(osh, skb));
@@ -43,7 +44,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  			}
  			totsegs += nsegs;
  			totlen += PKTLEN(osh, skb);
-@@ -656,7 +668,11 @@
+@@ -656,7 +668,11 @@ osl_dma_map(osl_t *osh, void *va, uint s
  	}
  #endif 
  
@@ -55,7 +56,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  }
  
  void BCMFASTPATH
-@@ -665,8 +681,13 @@
+@@ -665,8 +681,13 @@ osl_dma_unmap(osl_t *osh, uint pa, uint
  	int dir;
  
  	ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));
diff --git a/srcpkgs/broadcom-wl-dkms/patches/015-linux-6.0.patch b/srcpkgs/broadcom-wl-dkms/patches/015-linux-6.0.patch
new file mode 100644
index 000000000000..348eaf8e379b
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/015-linux-6.0.patch
@@ -0,0 +1,31 @@
+From 933540c63f33e6ac2825d65c4b681ef3387d9146 Mon Sep 17 00:00:00 2001
+From: Antoine Cotten <hello@acotten.com>
+Date: Mon, 15 Aug 2022 17:53:51 +0200
+Subject: [PATCH] cfg80211_roam_info compat for MLO APIs in Linux >= 6.0
+
+The 'bssid' struct field is now under 'links.bssid'.
+
+See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=efbabc11650040c64884ff3019b88c7bcc0ceb1d
+
+Original patch by Joan Bruguera:
+https://gist.github.com/joanbm/207210d74637870c01ef5a3c262a597d
+---
+ src/wl/sys/wl_cfg80211_hybrid.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -2364,7 +2364,11 @@ wl_bss_roaming_done(struct wl_cfg80211_p
+ 
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
+ 	roam_info.channel = &wl->conf->channel;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
++	roam_info.links[0].bssid = (u8 *)&wl->bssid;
++#else
+ 	roam_info.bssid = (u8 *)&wl->bssid;
++#endif
+ 	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;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/gcc-4.9.patch b/srcpkgs/broadcom-wl-dkms/patches/gcc-4.9.patch
deleted file mode 100644
index ec354cecdbb5..000000000000
--- a/srcpkgs/broadcom-wl-dkms/patches/gcc-4.9.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-https://github.com/voidlinux/xbps-packages/issues/412
-
---- a/Makefile	2014-05-21 12:47:46.915833131 +0200
-+++ b/Makefile	2014-05-21 12:48:54.027409879 +0200
-@@ -126,6 +126,8 @@ EXTRA_CFLAGS       += -I$(src)/src/wl/sy
- EXTRA_CFLAGS       += -I$(src)/src/shared/bcmwifi/include
- #EXTRA_CFLAGS       += -DBCMDBG_ASSERT
- 
-+EXTRA_CFLAGS       += -Wno-date-time
-+
- EXTRA_LDFLAGS      := $(src)/lib/wlc_hybrid.o_shipped
- 
- KBASE              ?= /lib/modules/`uname -r`
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.15.patch b/srcpkgs/broadcom-wl-dkms/patches/linux-4.15.patch
deleted file mode 100644
index 9fcd7176b50a..000000000000
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.15.patch
+++ /dev/null
@@ -1,44 +0,0 @@
---- a/src/wl/sys/wl_linux.c     2018-01-31 11:33:26.000000000 +0100 
-+++ b/src/wl/sys/wl_linux.c     2018-01-31 15:27:18.000000000 +0100 
-@@ -93,7 +93,11 @@ 
- 
- #include <wlc_wowl.h>
- 
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) 
- static void wl_timer(ulong data);
-+#else 
-+static void wl_timer(struct timer_list *tl); 
-+#endif 
- static void _wl_timer(wl_timer_t *t);
- static struct net_device *wl_alloc_linux_if(wl_if_t *wlif);
- 
-@@ -2301,9 +2305,17 @@ 
- }
- 
- static void
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) 
- wl_timer(ulong data)
-+#else 
-+wl_timer(struct timer_list *tl) 
-+#endif 
- {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) 
- 	wl_timer_t *t = (wl_timer_t *)data;
-+#else 
-+    wl_timer_t *t = from_timer(t, tl, timer); 
-+#endif 
- 
- 	if (!WL_ALL_PASSIVE_ENAB(t->wl))
- 		_wl_timer(t);
-@@ -2355,7 +2367,11 @@ 
- 
- 	bzero(t, sizeof(wl_timer_t));
- 
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) 
- 	init_timer(&t->timer);
- 	t->timer.data = (ulong) t;
- 	t->timer.function = wl_timer;
-+#else 
-+    timer_setup(&t->timer, wl_timer, 0); 
-+#endif 
- 	t->wl = wl;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.3.patch b/srcpkgs/broadcom-wl-dkms/patches/linux-4.3.patch
deleted file mode 100644
index 9487eb68f0bc..000000000000
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.3.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff -ru a/src/shared/linux_osl.c b/src/shared/linux_osl.c
---- a/src/shared/linux_osl.c	2015-09-18 15:47:30.000000000 -0700
-+++ b/src/shared/linux_osl.c	2015-11-14 15:38:10.484563014 -0800
-@@ -932,7 +932,11 @@
- 	uint cycles;
- 
- #if defined(__i386__)
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
-+	cycles = rdtsc();
-+#else
- 	rdtscl(cycles);
-+#endif
- #else
- 	cycles = 0;
- #endif 
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.17.patch b/srcpkgs/broadcom-wl-dkms/patches/linux-5.17.patch
deleted file mode 100644
index 74847cb6bb40..000000000000
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.17.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-diff -u -r a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c
---- a/src/wl/sys/wl_linux.c	2022-03-23 00:35:42.930416350 +0000
-+++ b/src/wl/sys/wl_linux.c	2022-03-23 00:40:12.903771013 +0000
-@@ -2980,7 +2980,11 @@
- 	else
- 		dev->type = ARPHRD_IEEE80211_RADIOTAP;
- 
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
- 	bcopy(wl->dev->dev_addr, dev->dev_addr, ETHER_ADDR_LEN);
-+#else
-+	eth_hw_addr_set(wl->dev, dev->dev_addr);
-+#endif
- 
- #if defined(WL_USE_NETDEV_OPS)
- 	dev->netdev_ops = &wl_netdev_monitor_ops;
-@@ -3261,7 +3265,11 @@
- static ssize_t
- wl_proc_read(struct file *filp, char __user *buffer, size_t length, loff_t *offp)
- {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
- 	wl_info_t * wl = PDE_DATA(file_inode(filp));
-+#else
-+	wl_info_t * wl = pde_data(file_inode(filp));
-+#endif
- #endif
- 	int bcmerror, len;
- 	int to_user = 0;
-@@ -3318,7 +3326,11 @@
- static ssize_t
- wl_proc_write(struct file *filp, const char __user *buff, size_t length, loff_t *offp)
- {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
- 	wl_info_t * wl = PDE_DATA(file_inode(filp));
-+#else
-+	wl_info_t * wl = pde_data(file_inode(filp));
-+#endif
- #endif
- 	int from_user = 0;
- 	int bcmerror;
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 68129b4a82a2..a1a700259fbe 100644
--- a/srcpkgs/broadcom-wl-dkms/template
+++ b/srcpkgs/broadcom-wl-dkms/template
@@ -1,7 +1,7 @@
 # Template file for 'broadcom-wl-dkms'
 pkgname=broadcom-wl-dkms
 version=6.30.223.271
-revision=13
+revision=14
 archs="i686* x86_64*"
 create_wrksrc=yes
 depends="dkms"

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Updated] broadcom-wl-dkms: patch for 6.0
  2022-10-14 11:56 [PR PATCH] broadcom-wl-dkms: patch for 6.0 sgn
  2022-10-14 16:37 ` [PR PATCH] [Updated] " sgn
@ 2022-10-14 16:56 ` sgn
  2022-10-14 17:01 ` sgn
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: sgn @ 2022-10-14 16:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1293 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages broadcom-wl-dkms
https://github.com/void-linux/void-packages/pull/39950

broadcom-wl-dkms: patch for 6.0
While we're at it, import change for 5.17

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **NO**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/39950.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-broadcom-wl-dkms-39950.patch --]
[-- Type: text/x-diff, Size: 37871 bytes --]

From 7efecf20a9ca26123e1f6db440f2c8b721f08e77 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 14 Oct 2022 18:54:43 +0700
Subject: [PATCH] broadcom-wl-dkms: patch for 6.0

While we're at it, import change for 5.17

Close: #39950
---
 .../patches/001-null-pointer-fix.patch        | 13 ++---
 .../patches/002-gcc-4.9.patch                 | 15 +++++
 .../patches/003-linux-4.3.patch               | 16 ++++++
 .../{linux-4.7.patch => 004-linux-4.7.patch}  | 35 +++++++-----
 .../{linux-4.8.patch => 005-linux-4.8.patch}  | 12 ++--
 ...{linux-4.11.patch => 006-linux-4.11.patch} | 20 +++----
 ...{linux-4.12.patch => 007-linux-4.12.patch} | 27 ++++-----
 .../patches/008-linux-4.14.patch              | 37 ++++++++++++
 .../patches/009-linux-4.15.patch              | 48 ++++++++++++++++
 .../{linux-5.1.patch => 010-linux-5.1.patch}  | 15 +++--
 .../{linux-5.6.patch => 011-linux-5.6.patch}  | 24 ++++----
 ...{linux-5.10.patch => 012-linux-5.10.patch} | 49 ++++++++--------
 .../patches/013-linux-5.17.patch              | 56 +++++++++++++++++++
 ...{linux-5.18.patch => 014-linux-5.18.patch} | 19 ++++---
 .../patches/015-linux-6.0.patch               | 33 +++++++++++
 .../broadcom-wl-dkms/patches/gcc-4.9.patch    | 13 -----
 .../broadcom-wl-dkms/patches/linux-4.15.patch | 44 ---------------
 .../broadcom-wl-dkms/patches/linux-4.3.patch  | 15 -----
 .../broadcom-wl-dkms/patches/linux-5.17.patch | 39 -------------
 19 files changed, 319 insertions(+), 211 deletions(-)
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/002-gcc-4.9.patch
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/003-linux-4.3.patch
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-4.7.patch => 004-linux-4.7.patch} (73%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-4.8.patch => 005-linux-4.8.patch} (71%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-4.11.patch => 006-linux-4.11.patch} (63%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-4.12.patch => 007-linux-4.12.patch} (68%)
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/008-linux-4.14.patch
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/009-linux-4.15.patch
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-5.1.patch => 010-linux-5.1.patch} (50%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-5.6.patch => 011-linux-5.6.patch} (63%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-5.10.patch => 012-linux-5.10.patch} (74%)
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/013-linux-5.17.patch
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-5.18.patch => 014-linux-5.18.patch} (76%)
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/015-linux-6.0.patch
 delete mode 100644 srcpkgs/broadcom-wl-dkms/patches/gcc-4.9.patch
 delete mode 100644 srcpkgs/broadcom-wl-dkms/patches/linux-4.15.patch
 delete mode 100644 srcpkgs/broadcom-wl-dkms/patches/linux-4.3.patch
 delete mode 100644 srcpkgs/broadcom-wl-dkms/patches/linux-5.17.patch

diff --git a/srcpkgs/broadcom-wl-dkms/patches/001-null-pointer-fix.patch b/srcpkgs/broadcom-wl-dkms/patches/001-null-pointer-fix.patch
index adef19f30af1..e9b4bc26d73a 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/001-null-pointer-fix.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/001-null-pointer-fix.patch
@@ -8,11 +8,11 @@ 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)
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+@@ -2165,8 +2165,8 @@ wl_start(struct sk_buff *skb, struct net
  	wlif = WL_DEV_IF(dev);
  	wl = WL_INFO(dev);
  
@@ -22,6 +22,3 @@ index 860b935..295156f 100644
  
  		TXQ_LOCK(wl);
  
--- 
-1.9.1
-
diff --git a/srcpkgs/broadcom-wl-dkms/patches/002-gcc-4.9.patch b/srcpkgs/broadcom-wl-dkms/patches/002-gcc-4.9.patch
new file mode 100644
index 000000000000..021f98a74a83
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/002-gcc-4.9.patch
@@ -0,0 +1,15 @@
+https://github.com/voidlinux/xbps-packages/issues/412
+
+Index: broadcom-wl-dkms-6.30.223.271/Makefile
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/Makefile
++++ broadcom-wl-dkms-6.30.223.271/Makefile
+@@ -145,6 +145,8 @@ ifeq "$(GE_49)" "1"
+ EXTRA_CFLAGS       += -Wno-date-time
+ endif
+ 
++EXTRA_CFLAGS       += -Wno-date-time
++
+ EXTRA_LDFLAGS      := $(src)/lib/wlc_hybrid.o_shipped
+ 
+ KBASE              ?= /lib/modules/`uname -r`
diff --git a/srcpkgs/broadcom-wl-dkms/patches/003-linux-4.3.patch b/srcpkgs/broadcom-wl-dkms/patches/003-linux-4.3.patch
new file mode 100644
index 000000000000..d041be223f35
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/003-linux-4.3.patch
@@ -0,0 +1,16 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/shared/linux_osl.c
++++ broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+@@ -932,7 +932,11 @@ osl_getcycles(void)
+ 	uint cycles;
+ 
+ #if defined(__i386__)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
++	cycles = rdtsc();
++#else
+ 	rdtscl(cycles);
++#endif
+ #else
+ 	cycles = 0;
+ #endif 
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.7.patch b/srcpkgs/broadcom-wl-dkms/patches/004-linux-4.7.patch
similarity index 73%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-4.7.patch
rename to srcpkgs/broadcom-wl-dkms/patches/004-linux-4.7.patch
index e2d0dfc23f22..dc8e12960af4 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.7.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/004-linux-4.7.patch
@@ -10,12 +10,14 @@ makes heavy use of that enum. The simple fix is to re-create the values.
 This patch came from the folks at Manjaro.
 https://github.com/manjaro/packages-extra/blob/master/broadcom-wl-dkms/linux-47.patch
 
---- a/src/wl/sys/wl_linux.h   2016-06-04 15:24:22.915341000 +0200
-+++ b/src/wl/sys/wl_linux.h   2016-06-04 15:29:36.236136244 +0200
-@@ -18,6 +18,13 @@
-  * $Id: wl_linux.h 369548 2012-11-19 09:01:01Z $
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.h
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.h
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.h
+@@ -19,6 +19,13 @@
+  * $Id: wl_cfg80211.h,v 1.1.8.1 2011-01-26 00:57:46 $
   */
-
+ 
 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
 +#define ieee80211_band nl80211_band
 +#define IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ
@@ -23,15 +25,17 @@ https://github.com/manjaro/packages-extra/blob/master/broadcom-wl-dkms/linux-47.
 +#define IEEE80211_NUM_BANDS NUM_NL80211_BANDS
 +#endif
 +
- #ifndef _wl_linux_h_
- #define _wl_linux_h_
-
---- a/src/wl/sys/wl_cfg80211_hybrid.h 2016-06-04 15:34:41.123022255 +0200
-+++ b/src/wl/sys/wl_cfg80211_hybrid.h 2016-06-04 15:37:25.391772105 +0200
-@@ -19,6 +19,13 @@
-  * $Id: wl_cfg80211.h,v 1.1.8.1 2011-01-26 00:57:46 $
+ #ifndef _wl_cfg80211_h_
+ #define _wl_cfg80211_h_
+ 
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.h
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.h
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.h
+@@ -18,6 +18,13 @@
+  * $Id: wl_linux.h 369548 2012-11-19 09:01:01Z $
   */
-
+ 
 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
 +#define ieee80211_band nl80211_band
 +#define IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ
@@ -39,5 +43,6 @@ https://github.com/manjaro/packages-extra/blob/master/broadcom-wl-dkms/linux-47.
 +#define IEEE80211_NUM_BANDS NUM_NL80211_BANDS
 +#endif
 +
- #ifndef _wl_cfg80211_h_
- #define _wl_cfg80211_h_
+ #ifndef _wl_linux_h_
+ #define _wl_linux_h_
+ 
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.8.patch b/srcpkgs/broadcom-wl-dkms/patches/005-linux-4.8.patch
similarity index 71%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-4.8.patch
rename to srcpkgs/broadcom-wl-dkms/patches/005-linux-4.8.patch
index 0f3e81906226..9047e2f88ded 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.8.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/005-linux-4.8.patch
@@ -1,8 +1,10 @@
 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 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -2386,8 +2386,15 @@ wl_bss_connect_done(struct wl_cfg80211_p
  	s32 err = 0;
  
  	if (wl->scan_request) {
@@ -19,7 +21,7 @@ Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=839629
  		wl->scan_request = NULL;
  	}
  
-@@ -2488,7 +2495,14 @@
+@@ -2488,7 +2495,14 @@ wl_notify_scan_status(struct wl_cfg80211
  
  scan_done_out:
  	if (wl->scan_request) {
@@ -34,7 +36,7 @@ Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=839629
  		wl->scan_request = NULL;
  	}
  	rtnl_unlock();
-@@ -2913,7 +2927,14 @@
+@@ -2913,7 +2927,14 @@ s32 wl_cfg80211_down(struct net_device *
  	s32 err = 0;
  
  	if (wl->scan_request) {
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.11.patch b/srcpkgs/broadcom-wl-dkms/patches/006-linux-4.11.patch
similarity index 63%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-4.11.patch
rename to srcpkgs/broadcom-wl-dkms/patches/006-linux-4.11.patch
index ae73bcf9b6b1..36b67681c8ca 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.11.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/006-linux-4.11.patch
@@ -1,7 +1,7 @@
-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
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
 @@ -30,6 +30,9 @@
  #include <linux/kthread.h>
  #include <linux/netdevice.h>
@@ -12,10 +12,10 @@ index a9671e2..da36405 100644
  #include <net/cfg80211.h>
  #include <linux/nl80211.h>
  #include <net/rtnetlink.h>
-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
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
 @@ -117,6 +117,9 @@ int wl_found = 0;
  
  typedef struct priv_link {
@@ -26,7 +26,7 @@ index 489c9f5..f8278ad 100644
  } 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)
+@@ -2449,6 +2452,9 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rx
  {
  	struct sk_buff *oskb = (struct sk_buff *)p;
  	struct sk_buff *skb;
@@ -36,7 +36,7 @@ index 489c9f5..f8278ad 100644
  	uchar *pdata;
  	uint len;
  
-@@ -2916,7 +2922,13 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rxsts, void *p)
+@@ -2915,7 +2921,13 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rx
  	if (skb == NULL) return;
  
  	skb->dev = wl->monitor_dev;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.12.patch b/srcpkgs/broadcom-wl-dkms/patches/007-linux-4.12.patch
similarity index 68%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-4.12.patch
rename to srcpkgs/broadcom-wl-dkms/patches/007-linux-4.12.patch
index bf9494a30fed..f529177ac2d5 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.12.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/007-linux-4.12.patch
@@ -1,7 +1,8 @@
-diff -ru work.orig/src/wl/sys/wl_cfg80211_hybrid.c work.patched/src/wl/sys/wl_cfg80211_hybrid.c
---- a/src/wl/sys/wl_cfg80211_hybrid.c	2017-06-10 15:50:27.328823384 -0700
-+++ b/src/wl/sys/wl_cfg80211_hybrid.c	2017-06-10 15:52:40.540809187 -0700
-@@ -52,8 +52,13 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -52,8 +52,13 @@ u32 wl_dbg_level = WL_DBG_ERR | WL_DBG_I
  u32 wl_dbg_level = WL_DBG_ERR;
  #endif
  
@@ -15,7 +16,7 @@ diff -ru work.orig/src/wl/sys/wl_cfg80211_hybrid.c work.patched/src/wl/sys/wl_cf
  #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
  static s32
  wl_cfg80211_scan(struct wiphy *wiphy,
-@@ -466,7 +471,11 @@
+@@ -466,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,7 +28,7 @@ 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 @@
+@@ -2361,12 +2370,26 @@ 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);
@@ -42,19 +43,19 @@ diff -ru work.orig/src/wl/sys/wl_cfg80211_hybrid.c work.patched/src/wl/sys/wl_cf
  	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,
++	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(2, 6, 39)
  			&wl->conf->channel,	 
-@@ -2374,6 +2397,7 @@
+@@ -2374,6 +2397,7 @@ wl_bss_roaming_done(struct wl_cfg80211_p
  			(u8 *)&wl->bssid,
  			conn_info->req_ie, conn_info->req_ie_len,
  			conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL);
diff --git a/srcpkgs/broadcom-wl-dkms/patches/008-linux-4.14.patch b/srcpkgs/broadcom-wl-dkms/patches/008-linux-4.14.patch
new file mode 100644
index 000000000000..0a3d021667bf
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/008-linux-4.14.patch
@@ -0,0 +1,37 @@
+From: Gerardo Esteban Malazdrewicz <gerardo@malazdrewicz.com.ar>
+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 files changed, 12 insertions(+), 1 deletion(-)
+
+Index: broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/shared/linux_osl.c
++++ broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+@@ -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/srcpkgs/broadcom-wl-dkms/patches/009-linux-4.15.patch b/srcpkgs/broadcom-wl-dkms/patches/009-linux-4.15.patch
new file mode 100644
index 000000000000..82fa33c89bf4
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/009-linux-4.15.patch
@@ -0,0 +1,48 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+@@ -93,7 +93,11 @@ struct iw_statistics *wl_get_wireless_st
+ 
+ #include <wlc_wowl.h>
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ static void wl_timer(ulong data);
++#else
++static void wl_timer(struct timer_list *tl);
++#endif
+ static void _wl_timer(wl_timer_t *t);
+ static struct net_device *wl_alloc_linux_if(wl_if_t *wlif);
+ 
+@@ -2301,9 +2305,17 @@ wl_timer_task(wl_task_t *task)
+ }
+ 
+ static void
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ wl_timer(ulong data)
++#else
++wl_timer(struct timer_list *tl)
++#endif
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ 	wl_timer_t *t = (wl_timer_t *)data;
++#else
++    wl_timer_t *t = from_timer(t, tl, timer);
++#endif
+ 
+ 	if (!WL_ALL_PASSIVE_ENAB(t->wl))
+ 		_wl_timer(t);
+@@ -2355,9 +2367,13 @@ wl_init_timer(wl_info_t *wl, void (*fn)(
+ 
+ 	bzero(t, sizeof(wl_timer_t));
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ 	init_timer(&t->timer);
+ 	t->timer.data = (ulong) t;
+ 	t->timer.function = wl_timer;
++#else
++    timer_setup(&t->timer, wl_timer, 0);
++#endif
+ 	t->wl = wl;
+ 	t->fn = fn;
+ 	t->arg = arg;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.1.patch b/srcpkgs/broadcom-wl-dkms/patches/010-linux-5.1.patch
similarity index 50%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-5.1.patch
rename to srcpkgs/broadcom-wl-dkms/patches/010-linux-5.1.patch
index 1820dff63c20..66dcbdc901c3 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.1.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/010-linux-5.1.patch
@@ -1,6 +1,8 @@
---- a/src/wl/sys/wl_cfg80211_hybrid.c
-+++ b/src/wl/sys/wl_cfg80211_hybrid.c
-@@ -43,6 +43,9 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -46,6 +46,9 @@
  #define EVENT_FLAGS(e) dtoh16((e)->flags)
  #define EVENT_STATUS(e) dtoh32((e)->status)
  
@@ -10,8 +12,10 @@
  #ifdef BCMDBG
  u32 wl_dbg_level = WL_DBG_ERR | WL_DBG_INFO;
  #else
---- a/src/wl/sys/wl_iw.c
-+++ b/src/wl/sys/wl_iw.c
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_iw.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_iw.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_iw.c
 @@ -61,6 +61,9 @@ typedef struct priv_link {
  	wl_iw_t *wliw;
  } priv_link_t;
@@ -22,4 +26,3 @@
  #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24))
  #define WL_DEV_LINK(dev)       (priv_link_t*)(dev->priv)
  #else
-
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.6.patch b/srcpkgs/broadcom-wl-dkms/patches/011-linux-5.6.patch
similarity index 63%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-5.6.patch
rename to srcpkgs/broadcom-wl-dkms/patches/011-linux-5.6.patch
index 113fd092ecce..09420647773b 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.6.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/011-linux-5.6.patch
@@ -1,8 +1,8 @@
-diff --git src/shared/linux_osl.c 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)
+Index: broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/shared/linux_osl.c
++++ broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+@@ -946,7 +946,7 @@ osl_getcycles(void)
  void *
  osl_reg_map(uint32 pa, uint size)
  {
@@ -11,11 +11,11 @@ index 6157d18..8237ec7 100644
  }
  
  void
-diff --git src/wl/sys/wl_linux.c 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,
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+@@ -589,7 +589,7 @@ wl_attach(uint16 vendor, uint16 device,
  	}
  	wl->bcm_bustype = bustype;
  
@@ -24,7 +24,7 @@ index 0d05100..2ed1f0d 100644
  		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)
+@@ -779,7 +779,7 @@ 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);
@@ -33,7 +33,7 @@ index 0d05100..2ed1f0d 100644
  			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
+@@ -3363,12 +3363,19 @@ wl_proc_write(struct file *filp, const c
  }
  
  #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch b/srcpkgs/broadcom-wl-dkms/patches/012-linux-5.10.patch
similarity index 74%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch
rename to srcpkgs/broadcom-wl-dkms/patches/012-linux-5.10.patch
index 53514bf020a1..20c043a7fcd7 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/012-linux-5.10.patch
@@ -25,9 +25,10 @@ Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
  src/wl/sys/wlc_pub.h            |  1 +
  5 files changed, 42 insertions(+), 51 deletions(-)
 
-diff -u -r src/wl/sys/wl_cfg80211_hybrid.c src/wl/sys/wl_cfg80211_hybrid.c
---- a/src/wl/sys/wl_cfg80211_hybrid.c	2021-01-25 08:55:05.625224400 -0800
-+++ b/src/wl/sys/wl_cfg80211_hybrid.c	2021-01-25 08:58:30.000982902 -0800
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
 @@ -41,6 +41,7 @@
  #include <wlioctl.h>
  #include <proto/802.11.h>
@@ -36,7 +37,7 @@ diff -u -r src/wl/sys/wl_cfg80211_hybrid.c src/wl/sys/wl_cfg80211_hybrid.c
  
  #define EVENT_TYPE(e) dtoh32((e)->event_type)
  #define EVENT_FLAGS(e) dtoh16((e)->flags)
-@@ -446,30 +447,8 @@
+@@ -446,30 +447,8 @@ static void key_endian_to_host(struct wl
  static s32
  wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len)
  {
@@ -68,10 +69,11 @@ diff -u -r src/wl/sys/wl_cfg80211_hybrid.c src/wl/sys/wl_cfg80211_hybrid.c
  }
  
  static s32
-diff -u -r src/wl/sys/wl_iw.c src/wl/sys/wl_iw.c
---- a/src/wl/sys/wl_iw.c	2021-01-25 09:00:13.163543809 -0800
-+++ b/src/wl/sys/wl_iw.c	2021-01-25 09:02:04.218646005 -0800
-@@ -37,6 +37,7 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_iw.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_iw.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_iw.c
+@@ -37,6 +37,7 @@ typedef const struct si_pub	si_t;
  
  #include <wl_dbg.h>
  #include <wl_iw.h>
@@ -79,7 +81,7 @@ diff -u -r src/wl/sys/wl_iw.c src/wl/sys/wl_iw.c
  
  extern bool wl_iw_conn_status_str(uint32 event_type, uint32 status,
  	uint32 reason, char* stringBuf, uint buflen);
-@@ -106,29 +107,7 @@
+@@ -106,29 +107,7 @@ dev_wlc_ioctl(
  	int len
  )
  {
@@ -110,10 +112,11 @@ diff -u -r src/wl/sys/wl_iw.c src/wl/sys/wl_iw.c
  }
  
  static int
-diff -u -r src/wl/sys/wl_linux.c src/wl/sys/wl_linux.c
---- a/src/wl/sys/wl_linux.c	2021-01-25 09:02:08.055475147 -0800
-+++ b/src/wl/sys/wl_linux.c	2021-01-25 09:06:11.894764339 -0800
-@@ -1650,10 +1650,7 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+@@ -1650,10 +1650,7 @@ wl_ioctl(struct net_device *dev, struct
  		goto done2;
  	}
  
@@ -125,7 +128,7 @@ diff -u -r src/wl/sys/wl_linux.c src/wl/sys/wl_linux.c
  		if (!(buf = (void *) MALLOC(wl->osh, MAX(ioc.len, WLC_IOCTL_MAXLEN)))) {
  			bcmerror = BCME_NORESOURCE;
  			goto done2;
-@@ -1674,7 +1671,7 @@
+@@ -1674,7 +1671,7 @@ wl_ioctl(struct net_device *dev, struct
  	WL_UNLOCK(wl);
  
  done1:
@@ -134,7 +137,7 @@ diff -u -r src/wl/sys/wl_linux.c src/wl/sys/wl_linux.c
  		if (copy_to_user(ioc.buf, buf, ioc.len))
  			bcmerror = BCME_BADADDR;
  		MFREE(wl->osh, buf, MAX(ioc.len, WLC_IOCTL_MAXLEN));
-@@ -1684,6 +1681,39 @@
+@@ -1684,6 +1681,39 @@ done2:
  	ASSERT(VALID_BCMERROR(bcmerror));
  	if (bcmerror != 0)
  		wl->pub->bcmerror = bcmerror;
@@ -174,9 +177,10 @@ diff -u -r src/wl/sys/wl_linux.c src/wl/sys/wl_linux.c
  	return (OSL_ERROR(bcmerror));
  }
  
-diff -u -r src/wl/sys/wl_linux.h src/wl/sys/wl_linux.h
---- a/src/wl/sys/wl_linux.h	2021-01-25 09:06:15.188672391 -0800
-+++ b/src/wl/sys/wl_linux.h	2021-01-25 09:07:49.457810535 -0800
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.h
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.h
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.h
 @@ -29,6 +29,7 @@
  #define _wl_linux_h_
  
@@ -185,7 +189,7 @@ diff -u -r src/wl/sys/wl_linux.h src/wl/sys/wl_linux.h
  
  typedef struct wl_timer {
  	struct timer_list 	timer;
-@@ -194,6 +195,7 @@
+@@ -194,6 +195,7 @@ extern irqreturn_t wl_isr(int irq, void
  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);
@@ -193,9 +197,10 @@ diff -u -r src/wl/sys/wl_linux.h src/wl/sys/wl_linux.h
  extern struct net_device * wl_netdev_get(wl_info_t *wl);
  
  #endif 
-diff -u -r src/wl/sys/wlc_pub.h src/wl/sys/wlc_pub.h
---- a/src/wl/sys/wlc_pub.h	2021-01-25 09:07:54.543645032 -0800
-+++ b/src/wl/sys/wlc_pub.h	2021-01-25 09:08:10.772110464 -0800
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wlc_pub.h
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wlc_pub.h
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wlc_pub.h
 @@ -24,6 +24,7 @@
  
  #include <wlc_types.h>
diff --git a/srcpkgs/broadcom-wl-dkms/patches/013-linux-5.17.patch b/srcpkgs/broadcom-wl-dkms/patches/013-linux-5.17.patch
new file mode 100644
index 000000000000..c8223dbc008a
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/013-linux-5.17.patch
@@ -0,0 +1,56 @@
+Source: Arch Linux
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+@@ -93,6 +93,10 @@ struct iw_statistics *wl_get_wireless_st
+ 
+ #include <wlc_wowl.h>
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)
++#define PDE_DATA pde_data
++#endif
++
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ static void wl_timer(ulong data);
+ #else
+@@ -493,6 +497,12 @@ wl_if_setup(struct net_device *dev)
+ #endif
+ }
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
++static inline void eth_hw_addr_set(struct net_device *dev, const void *addr) {
++	memcpy(dev->dev_addr, addr, ETHER_ADDR_LEN);
++}
++#endif
++
+ static wl_info_t *
+ wl_attach(uint16 vendor, uint16 device, ulong regs,
+ 	uint bustype, void *btparam, uint irq, uchar* bar1_addr, uint32 bar1_size)
+@@ -637,7 +647,7 @@ wl_attach(uint16 vendor, uint16 device,
+ 			WL_ERROR(("wl%d: Error setting MAC ADDRESS\n", unit));
+ 	}
+ #endif 
+-	bcopy(&wl->pub->cur_etheraddr, dev->dev_addr, ETHER_ADDR_LEN);
++	eth_hw_addr_set(dev, wl->pub->cur_etheraddr.octet);
+ 
+ 	online_cpus = 1;
+ 
+@@ -1838,7 +1848,7 @@ wl_set_mac_address(struct net_device *de
+ 
+ 	WL_LOCK(wl);
+ 
+-	bcopy(sa->sa_data, dev->dev_addr, ETHER_ADDR_LEN);
++	eth_hw_addr_set(dev, sa->sa_data);
+ 	err = wlc_iovar_op(wl->wlc, "cur_etheraddr", NULL, 0, sa->sa_data, ETHER_ADDR_LEN,
+ 		IOV_SET, (WL_DEV_IF(dev))->wlcif);
+ 	WL_UNLOCK(wl);
+@@ -3021,7 +3031,7 @@ _wl_add_monitor_if(wl_task_t *task)
+ 	else
+ 		dev->type = ARPHRD_IEEE80211_RADIOTAP;
+ 
+-	bcopy(wl->dev->dev_addr, dev->dev_addr, ETHER_ADDR_LEN);
++	eth_hw_addr_set(dev, wl->dev->dev_addr);
+ 
+ #if defined(WL_USE_NETDEV_OPS)
+ 	dev->netdev_ops = &wl_netdev_monitor_ops;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.18.patch b/srcpkgs/broadcom-wl-dkms/patches/014-linux-5.18.patch
similarity index 76%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-5.18.patch
rename to srcpkgs/broadcom-wl-dkms/patches/014-linux-5.18.patch
index d837429a6899..c404f98fc9b5 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.18.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/014-linux-5.18.patch
@@ -1,7 +1,8 @@
-diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
---- a/src/shared/linux_osl.c	2022-05-24 20:51:15.662604980 +0000
-+++ b/src/shared/linux_osl.c	2022-05-24 21:13:38.264472425 +0000
-@@ -599,6 +599,8 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/shared/linux_osl.c
++++ broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+@@ -599,6 +599,8 @@ osl_dma_alloc_consistent(osl_t *osh, uin
  	va = kmalloc(size, GFP_ATOMIC | __GFP_ZERO);
  	if (va)
  		*pap = (ulong)__virt_to_phys(va);
@@ -10,7 +11,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  #else
  	va = pci_alloc_consistent(osh->pdev, size, (dma_addr_t*)pap);
  #endif
-@@ -612,6 +614,8 @@
+@@ -612,6 +614,8 @@ osl_dma_free_consistent(osl_t *osh, void
  
  #ifdef __ARM_ARCH_7A__
  	kfree(va);
@@ -19,7 +20,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  #else
  	pci_free_consistent(osh->pdev, size, va, (dma_addr_t)pa);
  #endif
-@@ -623,7 +627,11 @@
+@@ -623,7 +627,11 @@ osl_dma_map(osl_t *osh, void *va, uint s
  	int dir;
  
  	ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));
@@ -31,7 +32,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  
  #if defined(__ARM_ARCH_7A__) && defined(BCMDMASGLISTOSL)
  	if (dmah != NULL) {
-@@ -641,7 +649,11 @@
+@@ -641,7 +649,11 @@ osl_dma_map(osl_t *osh, void *va, uint s
  				ASSERT(totsegs + nsegs <= MAX_DMA_SEGS);
  				sg->page_link = 0;
  				sg_set_buf(sg, PKTDATA(osh, skb), PKTLEN(osh, skb));
@@ -43,7 +44,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  			}
  			totsegs += nsegs;
  			totlen += PKTLEN(osh, skb);
-@@ -656,7 +668,11 @@
+@@ -656,7 +668,11 @@ osl_dma_map(osl_t *osh, void *va, uint s
  	}
  #endif 
  
@@ -55,7 +56,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  }
  
  void BCMFASTPATH
-@@ -665,8 +681,13 @@
+@@ -665,8 +681,13 @@ osl_dma_unmap(osl_t *osh, uint pa, uint
  	int dir;
  
  	ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));
diff --git a/srcpkgs/broadcom-wl-dkms/patches/015-linux-6.0.patch b/srcpkgs/broadcom-wl-dkms/patches/015-linux-6.0.patch
new file mode 100644
index 000000000000..cde1a941fc3a
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/015-linux-6.0.patch
@@ -0,0 +1,33 @@
+From 933540c63f33e6ac2825d65c4b681ef3387d9146 Mon Sep 17 00:00:00 2001
+From: Antoine Cotten <hello@acotten.com>
+Date: Mon, 15 Aug 2022 17:53:51 +0200
+Subject: [PATCH] cfg80211_roam_info compat for MLO APIs in Linux >= 6.0
+
+The 'bssid' struct field is now under 'links.bssid'.
+
+See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=efbabc11650040c64884ff3019b88c7bcc0ceb1d
+
+Original patch by Joan Bruguera:
+https://gist.github.com/joanbm/207210d74637870c01ef5a3c262a597d
+---
+ src/wl/sys/wl_cfg80211_hybrid.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -2363,8 +2363,13 @@ wl_bss_roaming_done(struct wl_cfg80211_p
+ 	wl_update_bss_info(wl);
+ 
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
++	roam_info.links[0].channel = &wl->conf->channel;
++	roam_info.links[0].bssid = (u8 *)&wl->bssid;
++#else
+ 	roam_info.channel = &wl->conf->channel;
+ 	roam_info.bssid = (u8 *)&wl->bssid;
++#endif
+ 	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;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/gcc-4.9.patch b/srcpkgs/broadcom-wl-dkms/patches/gcc-4.9.patch
deleted file mode 100644
index ec354cecdbb5..000000000000
--- a/srcpkgs/broadcom-wl-dkms/patches/gcc-4.9.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-https://github.com/voidlinux/xbps-packages/issues/412
-
---- a/Makefile	2014-05-21 12:47:46.915833131 +0200
-+++ b/Makefile	2014-05-21 12:48:54.027409879 +0200
-@@ -126,6 +126,8 @@ EXTRA_CFLAGS       += -I$(src)/src/wl/sy
- EXTRA_CFLAGS       += -I$(src)/src/shared/bcmwifi/include
- #EXTRA_CFLAGS       += -DBCMDBG_ASSERT
- 
-+EXTRA_CFLAGS       += -Wno-date-time
-+
- EXTRA_LDFLAGS      := $(src)/lib/wlc_hybrid.o_shipped
- 
- KBASE              ?= /lib/modules/`uname -r`
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.15.patch b/srcpkgs/broadcom-wl-dkms/patches/linux-4.15.patch
deleted file mode 100644
index 9fcd7176b50a..000000000000
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.15.patch
+++ /dev/null
@@ -1,44 +0,0 @@
---- a/src/wl/sys/wl_linux.c     2018-01-31 11:33:26.000000000 +0100 
-+++ b/src/wl/sys/wl_linux.c     2018-01-31 15:27:18.000000000 +0100 
-@@ -93,7 +93,11 @@ 
- 
- #include <wlc_wowl.h>
- 
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) 
- static void wl_timer(ulong data);
-+#else 
-+static void wl_timer(struct timer_list *tl); 
-+#endif 
- static void _wl_timer(wl_timer_t *t);
- static struct net_device *wl_alloc_linux_if(wl_if_t *wlif);
- 
-@@ -2301,9 +2305,17 @@ 
- }
- 
- static void
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) 
- wl_timer(ulong data)
-+#else 
-+wl_timer(struct timer_list *tl) 
-+#endif 
- {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) 
- 	wl_timer_t *t = (wl_timer_t *)data;
-+#else 
-+    wl_timer_t *t = from_timer(t, tl, timer); 
-+#endif 
- 
- 	if (!WL_ALL_PASSIVE_ENAB(t->wl))
- 		_wl_timer(t);
-@@ -2355,7 +2367,11 @@ 
- 
- 	bzero(t, sizeof(wl_timer_t));
- 
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) 
- 	init_timer(&t->timer);
- 	t->timer.data = (ulong) t;
- 	t->timer.function = wl_timer;
-+#else 
-+    timer_setup(&t->timer, wl_timer, 0); 
-+#endif 
- 	t->wl = wl;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.3.patch b/srcpkgs/broadcom-wl-dkms/patches/linux-4.3.patch
deleted file mode 100644
index 9487eb68f0bc..000000000000
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.3.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff -ru a/src/shared/linux_osl.c b/src/shared/linux_osl.c
---- a/src/shared/linux_osl.c	2015-09-18 15:47:30.000000000 -0700
-+++ b/src/shared/linux_osl.c	2015-11-14 15:38:10.484563014 -0800
-@@ -932,7 +932,11 @@
- 	uint cycles;
- 
- #if defined(__i386__)
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
-+	cycles = rdtsc();
-+#else
- 	rdtscl(cycles);
-+#endif
- #else
- 	cycles = 0;
- #endif 
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.17.patch b/srcpkgs/broadcom-wl-dkms/patches/linux-5.17.patch
deleted file mode 100644
index 74847cb6bb40..000000000000
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.17.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-diff -u -r a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c
---- a/src/wl/sys/wl_linux.c	2022-03-23 00:35:42.930416350 +0000
-+++ b/src/wl/sys/wl_linux.c	2022-03-23 00:40:12.903771013 +0000
-@@ -2980,7 +2980,11 @@
- 	else
- 		dev->type = ARPHRD_IEEE80211_RADIOTAP;
- 
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
- 	bcopy(wl->dev->dev_addr, dev->dev_addr, ETHER_ADDR_LEN);
-+#else
-+	eth_hw_addr_set(wl->dev, dev->dev_addr);
-+#endif
- 
- #if defined(WL_USE_NETDEV_OPS)
- 	dev->netdev_ops = &wl_netdev_monitor_ops;
-@@ -3261,7 +3265,11 @@
- static ssize_t
- wl_proc_read(struct file *filp, char __user *buffer, size_t length, loff_t *offp)
- {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
- 	wl_info_t * wl = PDE_DATA(file_inode(filp));
-+#else
-+	wl_info_t * wl = pde_data(file_inode(filp));
-+#endif
- #endif
- 	int bcmerror, len;
- 	int to_user = 0;
-@@ -3318,7 +3326,11 @@
- static ssize_t
- wl_proc_write(struct file *filp, const char __user *buff, size_t length, loff_t *offp)
- {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
- 	wl_info_t * wl = PDE_DATA(file_inode(filp));
-+#else
-+	wl_info_t * wl = pde_data(file_inode(filp));
-+#endif
- #endif
- 	int from_user = 0;
- 	int bcmerror;

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Updated] broadcom-wl-dkms: patch for 6.0
  2022-10-14 11:56 [PR PATCH] broadcom-wl-dkms: patch for 6.0 sgn
  2022-10-14 16:37 ` [PR PATCH] [Updated] " sgn
  2022-10-14 16:56 ` sgn
@ 2022-10-14 17:01 ` sgn
  2022-10-14 17:03 ` sgn
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: sgn @ 2022-10-14 17:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1293 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages broadcom-wl-dkms
https://github.com/void-linux/void-packages/pull/39950

broadcom-wl-dkms: patch for 6.0
While we're at it, import change for 5.17

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **NO**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/39950.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-broadcom-wl-dkms-39950.patch --]
[-- Type: text/x-diff, Size: 36977 bytes --]

From f8985cca356e2e7719eb9bbeaf436e31236b12d2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 14 Oct 2022 18:54:43 +0700
Subject: [PATCH] broadcom-wl-dkms: patch for 6.0

While we're at it, import change for 5.17

Close: #39950
---
 .../patches/001-null-pointer-fix.patch        | 13 ++---
 .../patches/003-linux-4.3.patch               | 16 ++++++
 .../{linux-4.7.patch => 004-linux-4.7.patch}  | 35 +++++++-----
 .../{linux-4.8.patch => 005-linux-4.8.patch}  | 12 ++--
 ...{linux-4.11.patch => 006-linux-4.11.patch} | 20 +++----
 ...{linux-4.12.patch => 007-linux-4.12.patch} | 27 ++++-----
 .../patches/008-linux-4.14.patch              | 37 ++++++++++++
 .../patches/009-linux-4.15.patch              | 48 ++++++++++++++++
 .../{linux-5.1.patch => 010-linux-5.1.patch}  | 15 +++--
 .../{linux-5.6.patch => 011-linux-5.6.patch}  | 24 ++++----
 ...{linux-5.10.patch => 012-linux-5.10.patch} | 49 ++++++++--------
 .../patches/013-linux-5.17.patch              | 56 +++++++++++++++++++
 ...{linux-5.18.patch => 014-linux-5.18.patch} | 19 ++++---
 .../patches/015-linux-6.0.patch               | 33 +++++++++++
 .../broadcom-wl-dkms/patches/gcc-4.9.patch    | 13 -----
 .../broadcom-wl-dkms/patches/linux-4.15.patch | 44 ---------------
 .../broadcom-wl-dkms/patches/linux-4.3.patch  | 15 -----
 .../broadcom-wl-dkms/patches/linux-5.17.patch | 39 -------------
 18 files changed, 304 insertions(+), 211 deletions(-)
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/003-linux-4.3.patch
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-4.7.patch => 004-linux-4.7.patch} (73%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-4.8.patch => 005-linux-4.8.patch} (71%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-4.11.patch => 006-linux-4.11.patch} (63%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-4.12.patch => 007-linux-4.12.patch} (68%)
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/008-linux-4.14.patch
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/009-linux-4.15.patch
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-5.1.patch => 010-linux-5.1.patch} (50%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-5.6.patch => 011-linux-5.6.patch} (63%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-5.10.patch => 012-linux-5.10.patch} (74%)
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/013-linux-5.17.patch
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-5.18.patch => 014-linux-5.18.patch} (76%)
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/015-linux-6.0.patch
 delete mode 100644 srcpkgs/broadcom-wl-dkms/patches/gcc-4.9.patch
 delete mode 100644 srcpkgs/broadcom-wl-dkms/patches/linux-4.15.patch
 delete mode 100644 srcpkgs/broadcom-wl-dkms/patches/linux-4.3.patch
 delete mode 100644 srcpkgs/broadcom-wl-dkms/patches/linux-5.17.patch

diff --git a/srcpkgs/broadcom-wl-dkms/patches/001-null-pointer-fix.patch b/srcpkgs/broadcom-wl-dkms/patches/001-null-pointer-fix.patch
index adef19f30af1..e9b4bc26d73a 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/001-null-pointer-fix.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/001-null-pointer-fix.patch
@@ -8,11 +8,11 @@ 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)
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+@@ -2165,8 +2165,8 @@ wl_start(struct sk_buff *skb, struct net
  	wlif = WL_DEV_IF(dev);
  	wl = WL_INFO(dev);
  
@@ -22,6 +22,3 @@ index 860b935..295156f 100644
  
  		TXQ_LOCK(wl);
  
--- 
-1.9.1
-
diff --git a/srcpkgs/broadcom-wl-dkms/patches/003-linux-4.3.patch b/srcpkgs/broadcom-wl-dkms/patches/003-linux-4.3.patch
new file mode 100644
index 000000000000..d041be223f35
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/003-linux-4.3.patch
@@ -0,0 +1,16 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/shared/linux_osl.c
++++ broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+@@ -932,7 +932,11 @@ osl_getcycles(void)
+ 	uint cycles;
+ 
+ #if defined(__i386__)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
++	cycles = rdtsc();
++#else
+ 	rdtscl(cycles);
++#endif
+ #else
+ 	cycles = 0;
+ #endif 
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.7.patch b/srcpkgs/broadcom-wl-dkms/patches/004-linux-4.7.patch
similarity index 73%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-4.7.patch
rename to srcpkgs/broadcom-wl-dkms/patches/004-linux-4.7.patch
index e2d0dfc23f22..dc8e12960af4 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.7.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/004-linux-4.7.patch
@@ -10,12 +10,14 @@ makes heavy use of that enum. The simple fix is to re-create the values.
 This patch came from the folks at Manjaro.
 https://github.com/manjaro/packages-extra/blob/master/broadcom-wl-dkms/linux-47.patch
 
---- a/src/wl/sys/wl_linux.h   2016-06-04 15:24:22.915341000 +0200
-+++ b/src/wl/sys/wl_linux.h   2016-06-04 15:29:36.236136244 +0200
-@@ -18,6 +18,13 @@
-  * $Id: wl_linux.h 369548 2012-11-19 09:01:01Z $
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.h
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.h
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.h
+@@ -19,6 +19,13 @@
+  * $Id: wl_cfg80211.h,v 1.1.8.1 2011-01-26 00:57:46 $
   */
-
+ 
 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
 +#define ieee80211_band nl80211_band
 +#define IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ
@@ -23,15 +25,17 @@ https://github.com/manjaro/packages-extra/blob/master/broadcom-wl-dkms/linux-47.
 +#define IEEE80211_NUM_BANDS NUM_NL80211_BANDS
 +#endif
 +
- #ifndef _wl_linux_h_
- #define _wl_linux_h_
-
---- a/src/wl/sys/wl_cfg80211_hybrid.h 2016-06-04 15:34:41.123022255 +0200
-+++ b/src/wl/sys/wl_cfg80211_hybrid.h 2016-06-04 15:37:25.391772105 +0200
-@@ -19,6 +19,13 @@
-  * $Id: wl_cfg80211.h,v 1.1.8.1 2011-01-26 00:57:46 $
+ #ifndef _wl_cfg80211_h_
+ #define _wl_cfg80211_h_
+ 
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.h
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.h
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.h
+@@ -18,6 +18,13 @@
+  * $Id: wl_linux.h 369548 2012-11-19 09:01:01Z $
   */
-
+ 
 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
 +#define ieee80211_band nl80211_band
 +#define IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ
@@ -39,5 +43,6 @@ https://github.com/manjaro/packages-extra/blob/master/broadcom-wl-dkms/linux-47.
 +#define IEEE80211_NUM_BANDS NUM_NL80211_BANDS
 +#endif
 +
- #ifndef _wl_cfg80211_h_
- #define _wl_cfg80211_h_
+ #ifndef _wl_linux_h_
+ #define _wl_linux_h_
+ 
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.8.patch b/srcpkgs/broadcom-wl-dkms/patches/005-linux-4.8.patch
similarity index 71%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-4.8.patch
rename to srcpkgs/broadcom-wl-dkms/patches/005-linux-4.8.patch
index 0f3e81906226..9047e2f88ded 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.8.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/005-linux-4.8.patch
@@ -1,8 +1,10 @@
 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 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -2386,8 +2386,15 @@ wl_bss_connect_done(struct wl_cfg80211_p
  	s32 err = 0;
  
  	if (wl->scan_request) {
@@ -19,7 +21,7 @@ Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=839629
  		wl->scan_request = NULL;
  	}
  
-@@ -2488,7 +2495,14 @@
+@@ -2488,7 +2495,14 @@ wl_notify_scan_status(struct wl_cfg80211
  
  scan_done_out:
  	if (wl->scan_request) {
@@ -34,7 +36,7 @@ Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=839629
  		wl->scan_request = NULL;
  	}
  	rtnl_unlock();
-@@ -2913,7 +2927,14 @@
+@@ -2913,7 +2927,14 @@ s32 wl_cfg80211_down(struct net_device *
  	s32 err = 0;
  
  	if (wl->scan_request) {
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.11.patch b/srcpkgs/broadcom-wl-dkms/patches/006-linux-4.11.patch
similarity index 63%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-4.11.patch
rename to srcpkgs/broadcom-wl-dkms/patches/006-linux-4.11.patch
index ae73bcf9b6b1..36b67681c8ca 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.11.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/006-linux-4.11.patch
@@ -1,7 +1,7 @@
-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
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
 @@ -30,6 +30,9 @@
  #include <linux/kthread.h>
  #include <linux/netdevice.h>
@@ -12,10 +12,10 @@ index a9671e2..da36405 100644
  #include <net/cfg80211.h>
  #include <linux/nl80211.h>
  #include <net/rtnetlink.h>
-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
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
 @@ -117,6 +117,9 @@ int wl_found = 0;
  
  typedef struct priv_link {
@@ -26,7 +26,7 @@ index 489c9f5..f8278ad 100644
  } 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)
+@@ -2449,6 +2452,9 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rx
  {
  	struct sk_buff *oskb = (struct sk_buff *)p;
  	struct sk_buff *skb;
@@ -36,7 +36,7 @@ index 489c9f5..f8278ad 100644
  	uchar *pdata;
  	uint len;
  
-@@ -2916,7 +2922,13 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rxsts, void *p)
+@@ -2915,7 +2921,13 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rx
  	if (skb == NULL) return;
  
  	skb->dev = wl->monitor_dev;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.12.patch b/srcpkgs/broadcom-wl-dkms/patches/007-linux-4.12.patch
similarity index 68%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-4.12.patch
rename to srcpkgs/broadcom-wl-dkms/patches/007-linux-4.12.patch
index bf9494a30fed..f529177ac2d5 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.12.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/007-linux-4.12.patch
@@ -1,7 +1,8 @@
-diff -ru work.orig/src/wl/sys/wl_cfg80211_hybrid.c work.patched/src/wl/sys/wl_cfg80211_hybrid.c
---- a/src/wl/sys/wl_cfg80211_hybrid.c	2017-06-10 15:50:27.328823384 -0700
-+++ b/src/wl/sys/wl_cfg80211_hybrid.c	2017-06-10 15:52:40.540809187 -0700
-@@ -52,8 +52,13 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -52,8 +52,13 @@ u32 wl_dbg_level = WL_DBG_ERR | WL_DBG_I
  u32 wl_dbg_level = WL_DBG_ERR;
  #endif
  
@@ -15,7 +16,7 @@ diff -ru work.orig/src/wl/sys/wl_cfg80211_hybrid.c work.patched/src/wl/sys/wl_cf
  #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
  static s32
  wl_cfg80211_scan(struct wiphy *wiphy,
-@@ -466,7 +471,11 @@
+@@ -466,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,7 +28,7 @@ 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 @@
+@@ -2361,12 +2370,26 @@ 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);
@@ -42,19 +43,19 @@ diff -ru work.orig/src/wl/sys/wl_cfg80211_hybrid.c work.patched/src/wl/sys/wl_cf
  	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,
++	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(2, 6, 39)
  			&wl->conf->channel,	 
-@@ -2374,6 +2397,7 @@
+@@ -2374,6 +2397,7 @@ wl_bss_roaming_done(struct wl_cfg80211_p
  			(u8 *)&wl->bssid,
  			conn_info->req_ie, conn_info->req_ie_len,
  			conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL);
diff --git a/srcpkgs/broadcom-wl-dkms/patches/008-linux-4.14.patch b/srcpkgs/broadcom-wl-dkms/patches/008-linux-4.14.patch
new file mode 100644
index 000000000000..0a3d021667bf
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/008-linux-4.14.patch
@@ -0,0 +1,37 @@
+From: Gerardo Esteban Malazdrewicz <gerardo@malazdrewicz.com.ar>
+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 files changed, 12 insertions(+), 1 deletion(-)
+
+Index: broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/shared/linux_osl.c
++++ broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+@@ -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/srcpkgs/broadcom-wl-dkms/patches/009-linux-4.15.patch b/srcpkgs/broadcom-wl-dkms/patches/009-linux-4.15.patch
new file mode 100644
index 000000000000..82fa33c89bf4
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/009-linux-4.15.patch
@@ -0,0 +1,48 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+@@ -93,7 +93,11 @@ struct iw_statistics *wl_get_wireless_st
+ 
+ #include <wlc_wowl.h>
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ static void wl_timer(ulong data);
++#else
++static void wl_timer(struct timer_list *tl);
++#endif
+ static void _wl_timer(wl_timer_t *t);
+ static struct net_device *wl_alloc_linux_if(wl_if_t *wlif);
+ 
+@@ -2301,9 +2305,17 @@ wl_timer_task(wl_task_t *task)
+ }
+ 
+ static void
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ wl_timer(ulong data)
++#else
++wl_timer(struct timer_list *tl)
++#endif
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ 	wl_timer_t *t = (wl_timer_t *)data;
++#else
++    wl_timer_t *t = from_timer(t, tl, timer);
++#endif
+ 
+ 	if (!WL_ALL_PASSIVE_ENAB(t->wl))
+ 		_wl_timer(t);
+@@ -2355,9 +2367,13 @@ wl_init_timer(wl_info_t *wl, void (*fn)(
+ 
+ 	bzero(t, sizeof(wl_timer_t));
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ 	init_timer(&t->timer);
+ 	t->timer.data = (ulong) t;
+ 	t->timer.function = wl_timer;
++#else
++    timer_setup(&t->timer, wl_timer, 0);
++#endif
+ 	t->wl = wl;
+ 	t->fn = fn;
+ 	t->arg = arg;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.1.patch b/srcpkgs/broadcom-wl-dkms/patches/010-linux-5.1.patch
similarity index 50%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-5.1.patch
rename to srcpkgs/broadcom-wl-dkms/patches/010-linux-5.1.patch
index 1820dff63c20..66dcbdc901c3 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.1.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/010-linux-5.1.patch
@@ -1,6 +1,8 @@
---- a/src/wl/sys/wl_cfg80211_hybrid.c
-+++ b/src/wl/sys/wl_cfg80211_hybrid.c
-@@ -43,6 +43,9 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -46,6 +46,9 @@
  #define EVENT_FLAGS(e) dtoh16((e)->flags)
  #define EVENT_STATUS(e) dtoh32((e)->status)
  
@@ -10,8 +12,10 @@
  #ifdef BCMDBG
  u32 wl_dbg_level = WL_DBG_ERR | WL_DBG_INFO;
  #else
---- a/src/wl/sys/wl_iw.c
-+++ b/src/wl/sys/wl_iw.c
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_iw.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_iw.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_iw.c
 @@ -61,6 +61,9 @@ typedef struct priv_link {
  	wl_iw_t *wliw;
  } priv_link_t;
@@ -22,4 +26,3 @@
  #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24))
  #define WL_DEV_LINK(dev)       (priv_link_t*)(dev->priv)
  #else
-
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.6.patch b/srcpkgs/broadcom-wl-dkms/patches/011-linux-5.6.patch
similarity index 63%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-5.6.patch
rename to srcpkgs/broadcom-wl-dkms/patches/011-linux-5.6.patch
index 113fd092ecce..09420647773b 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.6.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/011-linux-5.6.patch
@@ -1,8 +1,8 @@
-diff --git src/shared/linux_osl.c 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)
+Index: broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/shared/linux_osl.c
++++ broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+@@ -946,7 +946,7 @@ osl_getcycles(void)
  void *
  osl_reg_map(uint32 pa, uint size)
  {
@@ -11,11 +11,11 @@ index 6157d18..8237ec7 100644
  }
  
  void
-diff --git src/wl/sys/wl_linux.c 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,
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+@@ -589,7 +589,7 @@ wl_attach(uint16 vendor, uint16 device,
  	}
  	wl->bcm_bustype = bustype;
  
@@ -24,7 +24,7 @@ index 0d05100..2ed1f0d 100644
  		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)
+@@ -779,7 +779,7 @@ 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);
@@ -33,7 +33,7 @@ index 0d05100..2ed1f0d 100644
  			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
+@@ -3363,12 +3363,19 @@ wl_proc_write(struct file *filp, const c
  }
  
  #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch b/srcpkgs/broadcom-wl-dkms/patches/012-linux-5.10.patch
similarity index 74%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch
rename to srcpkgs/broadcom-wl-dkms/patches/012-linux-5.10.patch
index 53514bf020a1..20c043a7fcd7 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/012-linux-5.10.patch
@@ -25,9 +25,10 @@ Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
  src/wl/sys/wlc_pub.h            |  1 +
  5 files changed, 42 insertions(+), 51 deletions(-)
 
-diff -u -r src/wl/sys/wl_cfg80211_hybrid.c src/wl/sys/wl_cfg80211_hybrid.c
---- a/src/wl/sys/wl_cfg80211_hybrid.c	2021-01-25 08:55:05.625224400 -0800
-+++ b/src/wl/sys/wl_cfg80211_hybrid.c	2021-01-25 08:58:30.000982902 -0800
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
 @@ -41,6 +41,7 @@
  #include <wlioctl.h>
  #include <proto/802.11.h>
@@ -36,7 +37,7 @@ diff -u -r src/wl/sys/wl_cfg80211_hybrid.c src/wl/sys/wl_cfg80211_hybrid.c
  
  #define EVENT_TYPE(e) dtoh32((e)->event_type)
  #define EVENT_FLAGS(e) dtoh16((e)->flags)
-@@ -446,30 +447,8 @@
+@@ -446,30 +447,8 @@ static void key_endian_to_host(struct wl
  static s32
  wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len)
  {
@@ -68,10 +69,11 @@ diff -u -r src/wl/sys/wl_cfg80211_hybrid.c src/wl/sys/wl_cfg80211_hybrid.c
  }
  
  static s32
-diff -u -r src/wl/sys/wl_iw.c src/wl/sys/wl_iw.c
---- a/src/wl/sys/wl_iw.c	2021-01-25 09:00:13.163543809 -0800
-+++ b/src/wl/sys/wl_iw.c	2021-01-25 09:02:04.218646005 -0800
-@@ -37,6 +37,7 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_iw.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_iw.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_iw.c
+@@ -37,6 +37,7 @@ typedef const struct si_pub	si_t;
  
  #include <wl_dbg.h>
  #include <wl_iw.h>
@@ -79,7 +81,7 @@ diff -u -r src/wl/sys/wl_iw.c src/wl/sys/wl_iw.c
  
  extern bool wl_iw_conn_status_str(uint32 event_type, uint32 status,
  	uint32 reason, char* stringBuf, uint buflen);
-@@ -106,29 +107,7 @@
+@@ -106,29 +107,7 @@ dev_wlc_ioctl(
  	int len
  )
  {
@@ -110,10 +112,11 @@ diff -u -r src/wl/sys/wl_iw.c src/wl/sys/wl_iw.c
  }
  
  static int
-diff -u -r src/wl/sys/wl_linux.c src/wl/sys/wl_linux.c
---- a/src/wl/sys/wl_linux.c	2021-01-25 09:02:08.055475147 -0800
-+++ b/src/wl/sys/wl_linux.c	2021-01-25 09:06:11.894764339 -0800
-@@ -1650,10 +1650,7 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+@@ -1650,10 +1650,7 @@ wl_ioctl(struct net_device *dev, struct
  		goto done2;
  	}
  
@@ -125,7 +128,7 @@ diff -u -r src/wl/sys/wl_linux.c src/wl/sys/wl_linux.c
  		if (!(buf = (void *) MALLOC(wl->osh, MAX(ioc.len, WLC_IOCTL_MAXLEN)))) {
  			bcmerror = BCME_NORESOURCE;
  			goto done2;
-@@ -1674,7 +1671,7 @@
+@@ -1674,7 +1671,7 @@ wl_ioctl(struct net_device *dev, struct
  	WL_UNLOCK(wl);
  
  done1:
@@ -134,7 +137,7 @@ diff -u -r src/wl/sys/wl_linux.c src/wl/sys/wl_linux.c
  		if (copy_to_user(ioc.buf, buf, ioc.len))
  			bcmerror = BCME_BADADDR;
  		MFREE(wl->osh, buf, MAX(ioc.len, WLC_IOCTL_MAXLEN));
-@@ -1684,6 +1681,39 @@
+@@ -1684,6 +1681,39 @@ done2:
  	ASSERT(VALID_BCMERROR(bcmerror));
  	if (bcmerror != 0)
  		wl->pub->bcmerror = bcmerror;
@@ -174,9 +177,10 @@ diff -u -r src/wl/sys/wl_linux.c src/wl/sys/wl_linux.c
  	return (OSL_ERROR(bcmerror));
  }
  
-diff -u -r src/wl/sys/wl_linux.h src/wl/sys/wl_linux.h
---- a/src/wl/sys/wl_linux.h	2021-01-25 09:06:15.188672391 -0800
-+++ b/src/wl/sys/wl_linux.h	2021-01-25 09:07:49.457810535 -0800
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.h
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.h
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.h
 @@ -29,6 +29,7 @@
  #define _wl_linux_h_
  
@@ -185,7 +189,7 @@ diff -u -r src/wl/sys/wl_linux.h src/wl/sys/wl_linux.h
  
  typedef struct wl_timer {
  	struct timer_list 	timer;
-@@ -194,6 +195,7 @@
+@@ -194,6 +195,7 @@ extern irqreturn_t wl_isr(int irq, void
  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);
@@ -193,9 +197,10 @@ diff -u -r src/wl/sys/wl_linux.h src/wl/sys/wl_linux.h
  extern struct net_device * wl_netdev_get(wl_info_t *wl);
  
  #endif 
-diff -u -r src/wl/sys/wlc_pub.h src/wl/sys/wlc_pub.h
---- a/src/wl/sys/wlc_pub.h	2021-01-25 09:07:54.543645032 -0800
-+++ b/src/wl/sys/wlc_pub.h	2021-01-25 09:08:10.772110464 -0800
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wlc_pub.h
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wlc_pub.h
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wlc_pub.h
 @@ -24,6 +24,7 @@
  
  #include <wlc_types.h>
diff --git a/srcpkgs/broadcom-wl-dkms/patches/013-linux-5.17.patch b/srcpkgs/broadcom-wl-dkms/patches/013-linux-5.17.patch
new file mode 100644
index 000000000000..c8223dbc008a
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/013-linux-5.17.patch
@@ -0,0 +1,56 @@
+Source: Arch Linux
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_linux.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_linux.c
+@@ -93,6 +93,10 @@ struct iw_statistics *wl_get_wireless_st
+ 
+ #include <wlc_wowl.h>
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)
++#define PDE_DATA pde_data
++#endif
++
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ static void wl_timer(ulong data);
+ #else
+@@ -493,6 +497,12 @@ wl_if_setup(struct net_device *dev)
+ #endif
+ }
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
++static inline void eth_hw_addr_set(struct net_device *dev, const void *addr) {
++	memcpy(dev->dev_addr, addr, ETHER_ADDR_LEN);
++}
++#endif
++
+ static wl_info_t *
+ wl_attach(uint16 vendor, uint16 device, ulong regs,
+ 	uint bustype, void *btparam, uint irq, uchar* bar1_addr, uint32 bar1_size)
+@@ -637,7 +647,7 @@ wl_attach(uint16 vendor, uint16 device,
+ 			WL_ERROR(("wl%d: Error setting MAC ADDRESS\n", unit));
+ 	}
+ #endif 
+-	bcopy(&wl->pub->cur_etheraddr, dev->dev_addr, ETHER_ADDR_LEN);
++	eth_hw_addr_set(dev, wl->pub->cur_etheraddr.octet);
+ 
+ 	online_cpus = 1;
+ 
+@@ -1838,7 +1848,7 @@ wl_set_mac_address(struct net_device *de
+ 
+ 	WL_LOCK(wl);
+ 
+-	bcopy(sa->sa_data, dev->dev_addr, ETHER_ADDR_LEN);
++	eth_hw_addr_set(dev, sa->sa_data);
+ 	err = wlc_iovar_op(wl->wlc, "cur_etheraddr", NULL, 0, sa->sa_data, ETHER_ADDR_LEN,
+ 		IOV_SET, (WL_DEV_IF(dev))->wlcif);
+ 	WL_UNLOCK(wl);
+@@ -3021,7 +3031,7 @@ _wl_add_monitor_if(wl_task_t *task)
+ 	else
+ 		dev->type = ARPHRD_IEEE80211_RADIOTAP;
+ 
+-	bcopy(wl->dev->dev_addr, dev->dev_addr, ETHER_ADDR_LEN);
++	eth_hw_addr_set(dev, wl->dev->dev_addr);
+ 
+ #if defined(WL_USE_NETDEV_OPS)
+ 	dev->netdev_ops = &wl_netdev_monitor_ops;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.18.patch b/srcpkgs/broadcom-wl-dkms/patches/014-linux-5.18.patch
similarity index 76%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-5.18.patch
rename to srcpkgs/broadcom-wl-dkms/patches/014-linux-5.18.patch
index d837429a6899..c404f98fc9b5 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.18.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/014-linux-5.18.patch
@@ -1,7 +1,8 @@
-diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
---- a/src/shared/linux_osl.c	2022-05-24 20:51:15.662604980 +0000
-+++ b/src/shared/linux_osl.c	2022-05-24 21:13:38.264472425 +0000
-@@ -599,6 +599,8 @@
+Index: broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/shared/linux_osl.c
++++ broadcom-wl-dkms-6.30.223.271/src/shared/linux_osl.c
+@@ -599,6 +599,8 @@ osl_dma_alloc_consistent(osl_t *osh, uin
  	va = kmalloc(size, GFP_ATOMIC | __GFP_ZERO);
  	if (va)
  		*pap = (ulong)__virt_to_phys(va);
@@ -10,7 +11,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  #else
  	va = pci_alloc_consistent(osh->pdev, size, (dma_addr_t*)pap);
  #endif
-@@ -612,6 +614,8 @@
+@@ -612,6 +614,8 @@ osl_dma_free_consistent(osl_t *osh, void
  
  #ifdef __ARM_ARCH_7A__
  	kfree(va);
@@ -19,7 +20,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  #else
  	pci_free_consistent(osh->pdev, size, va, (dma_addr_t)pa);
  #endif
-@@ -623,7 +627,11 @@
+@@ -623,7 +627,11 @@ osl_dma_map(osl_t *osh, void *va, uint s
  	int dir;
  
  	ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));
@@ -31,7 +32,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  
  #if defined(__ARM_ARCH_7A__) && defined(BCMDMASGLISTOSL)
  	if (dmah != NULL) {
-@@ -641,7 +649,11 @@
+@@ -641,7 +649,11 @@ osl_dma_map(osl_t *osh, void *va, uint s
  				ASSERT(totsegs + nsegs <= MAX_DMA_SEGS);
  				sg->page_link = 0;
  				sg_set_buf(sg, PKTDATA(osh, skb), PKTLEN(osh, skb));
@@ -43,7 +44,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  			}
  			totsegs += nsegs;
  			totlen += PKTLEN(osh, skb);
-@@ -656,7 +668,11 @@
+@@ -656,7 +668,11 @@ osl_dma_map(osl_t *osh, void *va, uint s
  	}
  #endif 
  
@@ -55,7 +56,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  }
  
  void BCMFASTPATH
-@@ -665,8 +681,13 @@
+@@ -665,8 +681,13 @@ osl_dma_unmap(osl_t *osh, uint pa, uint
  	int dir;
  
  	ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));
diff --git a/srcpkgs/broadcom-wl-dkms/patches/015-linux-6.0.patch b/srcpkgs/broadcom-wl-dkms/patches/015-linux-6.0.patch
new file mode 100644
index 000000000000..cde1a941fc3a
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/015-linux-6.0.patch
@@ -0,0 +1,33 @@
+From 933540c63f33e6ac2825d65c4b681ef3387d9146 Mon Sep 17 00:00:00 2001
+From: Antoine Cotten <hello@acotten.com>
+Date: Mon, 15 Aug 2022 17:53:51 +0200
+Subject: [PATCH] cfg80211_roam_info compat for MLO APIs in Linux >= 6.0
+
+The 'bssid' struct field is now under 'links.bssid'.
+
+See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=efbabc11650040c64884ff3019b88c7bcc0ceb1d
+
+Original patch by Joan Bruguera:
+https://gist.github.com/joanbm/207210d74637870c01ef5a3c262a597d
+---
+ src/wl/sys/wl_cfg80211_hybrid.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+Index: broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+===================================================================
+--- broadcom-wl-dkms-6.30.223.271.orig/src/wl/sys/wl_cfg80211_hybrid.c
++++ broadcom-wl-dkms-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -2363,8 +2363,13 @@ wl_bss_roaming_done(struct wl_cfg80211_p
+ 	wl_update_bss_info(wl);
+ 
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
++	roam_info.links[0].channel = &wl->conf->channel;
++	roam_info.links[0].bssid = (u8 *)&wl->bssid;
++#else
+ 	roam_info.channel = &wl->conf->channel;
+ 	roam_info.bssid = (u8 *)&wl->bssid;
++#endif
+ 	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;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/gcc-4.9.patch b/srcpkgs/broadcom-wl-dkms/patches/gcc-4.9.patch
deleted file mode 100644
index ec354cecdbb5..000000000000
--- a/srcpkgs/broadcom-wl-dkms/patches/gcc-4.9.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-https://github.com/voidlinux/xbps-packages/issues/412
-
---- a/Makefile	2014-05-21 12:47:46.915833131 +0200
-+++ b/Makefile	2014-05-21 12:48:54.027409879 +0200
-@@ -126,6 +126,8 @@ EXTRA_CFLAGS       += -I$(src)/src/wl/sy
- EXTRA_CFLAGS       += -I$(src)/src/shared/bcmwifi/include
- #EXTRA_CFLAGS       += -DBCMDBG_ASSERT
- 
-+EXTRA_CFLAGS       += -Wno-date-time
-+
- EXTRA_LDFLAGS      := $(src)/lib/wlc_hybrid.o_shipped
- 
- KBASE              ?= /lib/modules/`uname -r`
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.15.patch b/srcpkgs/broadcom-wl-dkms/patches/linux-4.15.patch
deleted file mode 100644
index 9fcd7176b50a..000000000000
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.15.patch
+++ /dev/null
@@ -1,44 +0,0 @@
---- a/src/wl/sys/wl_linux.c     2018-01-31 11:33:26.000000000 +0100 
-+++ b/src/wl/sys/wl_linux.c     2018-01-31 15:27:18.000000000 +0100 
-@@ -93,7 +93,11 @@ 
- 
- #include <wlc_wowl.h>
- 
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) 
- static void wl_timer(ulong data);
-+#else 
-+static void wl_timer(struct timer_list *tl); 
-+#endif 
- static void _wl_timer(wl_timer_t *t);
- static struct net_device *wl_alloc_linux_if(wl_if_t *wlif);
- 
-@@ -2301,9 +2305,17 @@ 
- }
- 
- static void
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) 
- wl_timer(ulong data)
-+#else 
-+wl_timer(struct timer_list *tl) 
-+#endif 
- {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) 
- 	wl_timer_t *t = (wl_timer_t *)data;
-+#else 
-+    wl_timer_t *t = from_timer(t, tl, timer); 
-+#endif 
- 
- 	if (!WL_ALL_PASSIVE_ENAB(t->wl))
- 		_wl_timer(t);
-@@ -2355,7 +2367,11 @@ 
- 
- 	bzero(t, sizeof(wl_timer_t));
- 
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) 
- 	init_timer(&t->timer);
- 	t->timer.data = (ulong) t;
- 	t->timer.function = wl_timer;
-+#else 
-+    timer_setup(&t->timer, wl_timer, 0); 
-+#endif 
- 	t->wl = wl;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.3.patch b/srcpkgs/broadcom-wl-dkms/patches/linux-4.3.patch
deleted file mode 100644
index 9487eb68f0bc..000000000000
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.3.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff -ru a/src/shared/linux_osl.c b/src/shared/linux_osl.c
---- a/src/shared/linux_osl.c	2015-09-18 15:47:30.000000000 -0700
-+++ b/src/shared/linux_osl.c	2015-11-14 15:38:10.484563014 -0800
-@@ -932,7 +932,11 @@
- 	uint cycles;
- 
- #if defined(__i386__)
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
-+	cycles = rdtsc();
-+#else
- 	rdtscl(cycles);
-+#endif
- #else
- 	cycles = 0;
- #endif 
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.17.patch b/srcpkgs/broadcom-wl-dkms/patches/linux-5.17.patch
deleted file mode 100644
index 74847cb6bb40..000000000000
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.17.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-diff -u -r a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c
---- a/src/wl/sys/wl_linux.c	2022-03-23 00:35:42.930416350 +0000
-+++ b/src/wl/sys/wl_linux.c	2022-03-23 00:40:12.903771013 +0000
-@@ -2980,7 +2980,11 @@
- 	else
- 		dev->type = ARPHRD_IEEE80211_RADIOTAP;
- 
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
- 	bcopy(wl->dev->dev_addr, dev->dev_addr, ETHER_ADDR_LEN);
-+#else
-+	eth_hw_addr_set(wl->dev, dev->dev_addr);
-+#endif
- 
- #if defined(WL_USE_NETDEV_OPS)
- 	dev->netdev_ops = &wl_netdev_monitor_ops;
-@@ -3261,7 +3265,11 @@
- static ssize_t
- wl_proc_read(struct file *filp, char __user *buffer, size_t length, loff_t *offp)
- {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
- 	wl_info_t * wl = PDE_DATA(file_inode(filp));
-+#else
-+	wl_info_t * wl = pde_data(file_inode(filp));
-+#endif
- #endif
- 	int bcmerror, len;
- 	int to_user = 0;
-@@ -3318,7 +3326,11 @@
- static ssize_t
- wl_proc_write(struct file *filp, const char __user *buff, size_t length, loff_t *offp)
- {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
- 	wl_info_t * wl = PDE_DATA(file_inode(filp));
-+#else
-+	wl_info_t * wl = pde_data(file_inode(filp));
-+#endif
- #endif
- 	int from_user = 0;
- 	int bcmerror;

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Updated] broadcom-wl-dkms: patch for 6.0
  2022-10-14 11:56 [PR PATCH] broadcom-wl-dkms: patch for 6.0 sgn
                   ` (2 preceding siblings ...)
  2022-10-14 17:01 ` sgn
@ 2022-10-14 17:03 ` sgn
  2022-10-14 23:39 ` sgn
  2022-10-14 23:39 ` [PR PATCH] [Merged]: " sgn
  5 siblings, 0 replies; 7+ messages in thread
From: sgn @ 2022-10-14 17:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1293 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages broadcom-wl-dkms
https://github.com/void-linux/void-packages/pull/39950

broadcom-wl-dkms: patch for 6.0
While we're at it, import change for 5.17

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **NO**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/39950.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-broadcom-wl-dkms-39950.patch --]
[-- Type: text/x-diff, Size: 31946 bytes --]

From 6c0c9b1ecdbe6536f48ac1396eaadbdb093b3f72 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 14 Oct 2022 18:54:43 +0700
Subject: [PATCH] broadcom-wl-dkms: patch for 6.0

While we're at it, import change for 5.17

Close: #39950
---
 .../patches/001-null-pointer-fix.patch        |  7 +--
 .../patches/003-linux-4.3.patch               | 14 +++++
 .../{linux-4.7.patch => 004-linux-4.7.patch}  | 31 +++++------
 .../{linux-4.8.patch => 005-linux-4.8.patch}  | 10 ++--
 ...{linux-4.11.patch => 006-linux-4.11.patch} |  8 +--
 ...{linux-4.12.patch => 007-linux-4.12.patch} | 25 +++++----
 .../patches/008-linux-4.14.patch              | 35 ++++++++++++
 .../patches/009-linux-4.15.patch              | 46 ++++++++++++++++
 .../{linux-5.1.patch => 010-linux-5.1.patch}  |  3 +-
 .../{linux-5.6.patch => 011-linux-5.6.patch}  | 12 ++---
 ...{linux-5.10.patch => 012-linux-5.10.patch} | 39 ++++++--------
 .../patches/013-linux-5.17.patch              | 54 +++++++++++++++++++
 ...{linux-5.18.patch => 014-linux-5.18.patch} | 17 +++---
 .../patches/015-linux-6.0.patch               | 31 +++++++++++
 .../broadcom-wl-dkms/patches/gcc-4.9.patch    | 13 -----
 .../broadcom-wl-dkms/patches/linux-4.15.patch | 44 ---------------
 .../broadcom-wl-dkms/patches/linux-4.3.patch  | 15 ------
 .../broadcom-wl-dkms/patches/linux-5.17.patch | 39 --------------
 18 files changed, 246 insertions(+), 197 deletions(-)
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/003-linux-4.3.patch
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-4.7.patch => 004-linux-4.7.patch} (83%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-4.8.patch => 005-linux-4.8.patch} (81%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-4.11.patch => 006-linux-4.11.patch} (77%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-4.12.patch => 007-linux-4.12.patch} (74%)
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/008-linux-4.14.patch
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/009-linux-4.15.patch
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-5.1.patch => 010-linux-5.1.patch} (97%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-5.6.patch => 011-linux-5.6.patch} (74%)
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-5.10.patch => 012-linux-5.10.patch} (81%)
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/013-linux-5.17.patch
 rename srcpkgs/broadcom-wl-dkms/patches/{linux-5.18.patch => 014-linux-5.18.patch} (82%)
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/015-linux-6.0.patch
 delete mode 100644 srcpkgs/broadcom-wl-dkms/patches/gcc-4.9.patch
 delete mode 100644 srcpkgs/broadcom-wl-dkms/patches/linux-4.15.patch
 delete mode 100644 srcpkgs/broadcom-wl-dkms/patches/linux-4.3.patch
 delete mode 100644 srcpkgs/broadcom-wl-dkms/patches/linux-5.17.patch

diff --git a/srcpkgs/broadcom-wl-dkms/patches/001-null-pointer-fix.patch b/srcpkgs/broadcom-wl-dkms/patches/001-null-pointer-fix.patch
index adef19f30af1..2b47ef5282e9 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/001-null-pointer-fix.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/001-null-pointer-fix.patch
@@ -8,11 +8,9 @@ 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)
+@@ -2165,8 +2165,8 @@ wl_start(struct sk_buff *skb, struct net
  	wlif = WL_DEV_IF(dev);
  	wl = WL_INFO(dev);
  
@@ -22,6 +20,3 @@ index 860b935..295156f 100644
  
  		TXQ_LOCK(wl);
  
--- 
-1.9.1
-
diff --git a/srcpkgs/broadcom-wl-dkms/patches/003-linux-4.3.patch b/srcpkgs/broadcom-wl-dkms/patches/003-linux-4.3.patch
new file mode 100644
index 000000000000..c6421d5739f4
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/003-linux-4.3.patch
@@ -0,0 +1,14 @@
+--- a/src/shared/linux_osl.c
++++ b/src/shared/linux_osl.c
+@@ -932,7 +932,11 @@ osl_getcycles(void)
+ 	uint cycles;
+ 
+ #if defined(__i386__)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
++	cycles = rdtsc();
++#else
+ 	rdtscl(cycles);
++#endif
+ #else
+ 	cycles = 0;
+ #endif 
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.7.patch b/srcpkgs/broadcom-wl-dkms/patches/004-linux-4.7.patch
similarity index 83%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-4.7.patch
rename to srcpkgs/broadcom-wl-dkms/patches/004-linux-4.7.patch
index e2d0dfc23f22..3f53c90b5758 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.7.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/004-linux-4.7.patch
@@ -10,12 +10,12 @@ makes heavy use of that enum. The simple fix is to re-create the values.
 This patch came from the folks at Manjaro.
 https://github.com/manjaro/packages-extra/blob/master/broadcom-wl-dkms/linux-47.patch
 
---- a/src/wl/sys/wl_linux.h   2016-06-04 15:24:22.915341000 +0200
-+++ b/src/wl/sys/wl_linux.h   2016-06-04 15:29:36.236136244 +0200
-@@ -18,6 +18,13 @@
-  * $Id: wl_linux.h 369548 2012-11-19 09:01:01Z $
+--- a/src/wl/sys/wl_cfg80211_hybrid.h
++++ b/src/wl/sys/wl_cfg80211_hybrid.h
+@@ -19,6 +19,13 @@
+  * $Id: wl_cfg80211.h,v 1.1.8.1 2011-01-26 00:57:46 $
   */
-
+ 
 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
 +#define ieee80211_band nl80211_band
 +#define IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ
@@ -23,15 +23,15 @@ https://github.com/manjaro/packages-extra/blob/master/broadcom-wl-dkms/linux-47.
 +#define IEEE80211_NUM_BANDS NUM_NL80211_BANDS
 +#endif
 +
- #ifndef _wl_linux_h_
- #define _wl_linux_h_
-
---- a/src/wl/sys/wl_cfg80211_hybrid.h 2016-06-04 15:34:41.123022255 +0200
-+++ b/src/wl/sys/wl_cfg80211_hybrid.h 2016-06-04 15:37:25.391772105 +0200
-@@ -19,6 +19,13 @@
-  * $Id: wl_cfg80211.h,v 1.1.8.1 2011-01-26 00:57:46 $
+ #ifndef _wl_cfg80211_h_
+ #define _wl_cfg80211_h_
+ 
+--- a/src/wl/sys/wl_linux.h
++++ b/src/wl/sys/wl_linux.h
+@@ -18,6 +18,13 @@
+  * $Id: wl_linux.h 369548 2012-11-19 09:01:01Z $
   */
-
+ 
 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
 +#define ieee80211_band nl80211_band
 +#define IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ
@@ -39,5 +39,6 @@ https://github.com/manjaro/packages-extra/blob/master/broadcom-wl-dkms/linux-47.
 +#define IEEE80211_NUM_BANDS NUM_NL80211_BANDS
 +#endif
 +
- #ifndef _wl_cfg80211_h_
- #define _wl_cfg80211_h_
+ #ifndef _wl_linux_h_
+ #define _wl_linux_h_
+ 
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.8.patch b/srcpkgs/broadcom-wl-dkms/patches/005-linux-4.8.patch
similarity index 81%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-4.8.patch
rename to srcpkgs/broadcom-wl-dkms/patches/005-linux-4.8.patch
index 0f3e81906226..4b1c95b7cc0a 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.8.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/005-linux-4.8.patch
@@ -1,8 +1,8 @@
 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 @@
+--- a/src/wl/sys/wl_cfg80211_hybrid.c
++++ b/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -2386,8 +2386,15 @@ wl_bss_connect_done(struct wl_cfg80211_p
  	s32 err = 0;
  
  	if (wl->scan_request) {
@@ -19,7 +19,7 @@ Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=839629
  		wl->scan_request = NULL;
  	}
  
-@@ -2488,7 +2495,14 @@
+@@ -2488,7 +2495,14 @@ wl_notify_scan_status(struct wl_cfg80211
  
  scan_done_out:
  	if (wl->scan_request) {
@@ -34,7 +34,7 @@ Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=839629
  		wl->scan_request = NULL;
  	}
  	rtnl_unlock();
-@@ -2913,7 +2927,14 @@
+@@ -2913,7 +2927,14 @@ s32 wl_cfg80211_down(struct net_device *
  	s32 err = 0;
  
  	if (wl->scan_request) {
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.11.patch b/srcpkgs/broadcom-wl-dkms/patches/006-linux-4.11.patch
similarity index 77%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-4.11.patch
rename to srcpkgs/broadcom-wl-dkms/patches/006-linux-4.11.patch
index ae73bcf9b6b1..b4bad06bd765 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.11.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/006-linux-4.11.patch
@@ -1,5 +1,3 @@
-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 @@
@@ -12,8 +10,6 @@ index a9671e2..da36405 100644
  #include <net/cfg80211.h>
  #include <linux/nl80211.h>
  #include <net/rtnetlink.h>
-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;
@@ -26,7 +22,7 @@ index 489c9f5..f8278ad 100644
  } 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)
+@@ -2449,6 +2452,9 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rx
  {
  	struct sk_buff *oskb = (struct sk_buff *)p;
  	struct sk_buff *skb;
@@ -36,7 +32,7 @@ index 489c9f5..f8278ad 100644
  	uchar *pdata;
  	uint len;
  
-@@ -2916,7 +2922,13 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rxsts, void *p)
+@@ -2915,7 +2921,13 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rx
  	if (skb == NULL) return;
  
  	skb->dev = wl->monitor_dev;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.12.patch b/srcpkgs/broadcom-wl-dkms/patches/007-linux-4.12.patch
similarity index 74%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-4.12.patch
rename to srcpkgs/broadcom-wl-dkms/patches/007-linux-4.12.patch
index bf9494a30fed..f876fbc16612 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.12.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/007-linux-4.12.patch
@@ -1,7 +1,6 @@
-diff -ru work.orig/src/wl/sys/wl_cfg80211_hybrid.c work.patched/src/wl/sys/wl_cfg80211_hybrid.c
---- a/src/wl/sys/wl_cfg80211_hybrid.c	2017-06-10 15:50:27.328823384 -0700
-+++ b/src/wl/sys/wl_cfg80211_hybrid.c	2017-06-10 15:52:40.540809187 -0700
-@@ -52,8 +52,13 @@
+--- a/src/wl/sys/wl_cfg80211_hybrid.c
++++ b/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -52,8 +52,13 @@ u32 wl_dbg_level = WL_DBG_ERR | WL_DBG_I
  u32 wl_dbg_level = WL_DBG_ERR;
  #endif
  
@@ -15,7 +14,7 @@ diff -ru work.orig/src/wl/sys/wl_cfg80211_hybrid.c work.patched/src/wl/sys/wl_cf
  #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
  static s32
  wl_cfg80211_scan(struct wiphy *wiphy,
-@@ -466,7 +471,11 @@
+@@ -466,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,7 +26,7 @@ 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 @@
+@@ -2361,12 +2370,26 @@ 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);
@@ -42,19 +41,19 @@ diff -ru work.orig/src/wl/sys/wl_cfg80211_hybrid.c work.patched/src/wl/sys/wl_cf
  	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,
++	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(2, 6, 39)
  			&wl->conf->channel,	 
-@@ -2374,6 +2397,7 @@
+@@ -2374,6 +2397,7 @@ wl_bss_roaming_done(struct wl_cfg80211_p
  			(u8 *)&wl->bssid,
  			conn_info->req_ie, conn_info->req_ie_len,
  			conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL);
diff --git a/srcpkgs/broadcom-wl-dkms/patches/008-linux-4.14.patch b/srcpkgs/broadcom-wl-dkms/patches/008-linux-4.14.patch
new file mode 100644
index 000000000000..884ed34b3c26
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/008-linux-4.14.patch
@@ -0,0 +1,35 @@
+From: Gerardo Esteban Malazdrewicz <gerardo@malazdrewicz.com.ar>
+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 files changed, 12 insertions(+), 1 deletion(-)
+
+--- a/src/shared/linux_osl.c
++++ b/src/shared/linux_osl.c
+@@ -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/srcpkgs/broadcom-wl-dkms/patches/009-linux-4.15.patch b/srcpkgs/broadcom-wl-dkms/patches/009-linux-4.15.patch
new file mode 100644
index 000000000000..de4f7014c929
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/009-linux-4.15.patch
@@ -0,0 +1,46 @@
+--- a/src/wl/sys/wl_linux.c
++++ b/src/wl/sys/wl_linux.c
+@@ -93,7 +93,11 @@ struct iw_statistics *wl_get_wireless_st
+ 
+ #include <wlc_wowl.h>
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ static void wl_timer(ulong data);
++#else
++static void wl_timer(struct timer_list *tl);
++#endif
+ static void _wl_timer(wl_timer_t *t);
+ static struct net_device *wl_alloc_linux_if(wl_if_t *wlif);
+ 
+@@ -2301,9 +2305,17 @@ wl_timer_task(wl_task_t *task)
+ }
+ 
+ static void
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ wl_timer(ulong data)
++#else
++wl_timer(struct timer_list *tl)
++#endif
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ 	wl_timer_t *t = (wl_timer_t *)data;
++#else
++    wl_timer_t *t = from_timer(t, tl, timer);
++#endif
+ 
+ 	if (!WL_ALL_PASSIVE_ENAB(t->wl))
+ 		_wl_timer(t);
+@@ -2355,9 +2367,13 @@ wl_init_timer(wl_info_t *wl, void (*fn)(
+ 
+ 	bzero(t, sizeof(wl_timer_t));
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ 	init_timer(&t->timer);
+ 	t->timer.data = (ulong) t;
+ 	t->timer.function = wl_timer;
++#else
++    timer_setup(&t->timer, wl_timer, 0);
++#endif
+ 	t->wl = wl;
+ 	t->fn = fn;
+ 	t->arg = arg;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.1.patch b/srcpkgs/broadcom-wl-dkms/patches/010-linux-5.1.patch
similarity index 97%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-5.1.patch
rename to srcpkgs/broadcom-wl-dkms/patches/010-linux-5.1.patch
index 1820dff63c20..bd4cc1ce2477 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.1.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/010-linux-5.1.patch
@@ -1,6 +1,6 @@
 --- a/src/wl/sys/wl_cfg80211_hybrid.c
 +++ b/src/wl/sys/wl_cfg80211_hybrid.c
-@@ -43,6 +43,9 @@
+@@ -46,6 +46,9 @@
  #define EVENT_FLAGS(e) dtoh16((e)->flags)
  #define EVENT_STATUS(e) dtoh32((e)->status)
  
@@ -22,4 +22,3 @@
  #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24))
  #define WL_DEV_LINK(dev)       (priv_link_t*)(dev->priv)
  #else
-
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.6.patch b/srcpkgs/broadcom-wl-dkms/patches/011-linux-5.6.patch
similarity index 74%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-5.6.patch
rename to srcpkgs/broadcom-wl-dkms/patches/011-linux-5.6.patch
index 113fd092ecce..4aa4c1a3b55a 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.6.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/011-linux-5.6.patch
@@ -1,8 +1,6 @@
-diff --git src/shared/linux_osl.c 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)
+@@ -946,7 +946,7 @@ osl_getcycles(void)
  void *
  osl_reg_map(uint32 pa, uint size)
  {
@@ -11,11 +9,9 @@ index 6157d18..8237ec7 100644
  }
  
  void
-diff --git src/wl/sys/wl_linux.c 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,
+@@ -589,7 +589,7 @@ wl_attach(uint16 vendor, uint16 device,
  	}
  	wl->bcm_bustype = bustype;
  
@@ -24,7 +20,7 @@ index 0d05100..2ed1f0d 100644
  		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)
+@@ -779,7 +779,7 @@ 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);
@@ -33,7 +29,7 @@ index 0d05100..2ed1f0d 100644
  			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
+@@ -3363,12 +3363,19 @@ wl_proc_write(struct file *filp, const c
  }
  
  #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch b/srcpkgs/broadcom-wl-dkms/patches/012-linux-5.10.patch
similarity index 81%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch
rename to srcpkgs/broadcom-wl-dkms/patches/012-linux-5.10.patch
index 53514bf020a1..6c22a0011491 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/012-linux-5.10.patch
@@ -25,9 +25,8 @@ Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
  src/wl/sys/wlc_pub.h            |  1 +
  5 files changed, 42 insertions(+), 51 deletions(-)
 
-diff -u -r src/wl/sys/wl_cfg80211_hybrid.c src/wl/sys/wl_cfg80211_hybrid.c
---- a/src/wl/sys/wl_cfg80211_hybrid.c	2021-01-25 08:55:05.625224400 -0800
-+++ b/src/wl/sys/wl_cfg80211_hybrid.c	2021-01-25 08:58:30.000982902 -0800
+--- a/src/wl/sys/wl_cfg80211_hybrid.c
++++ b/src/wl/sys/wl_cfg80211_hybrid.c
 @@ -41,6 +41,7 @@
  #include <wlioctl.h>
  #include <proto/802.11.h>
@@ -36,7 +35,7 @@ diff -u -r src/wl/sys/wl_cfg80211_hybrid.c src/wl/sys/wl_cfg80211_hybrid.c
  
  #define EVENT_TYPE(e) dtoh32((e)->event_type)
  #define EVENT_FLAGS(e) dtoh16((e)->flags)
-@@ -446,30 +447,8 @@
+@@ -446,30 +447,8 @@ static void key_endian_to_host(struct wl
  static s32
  wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len)
  {
@@ -68,10 +67,9 @@ diff -u -r src/wl/sys/wl_cfg80211_hybrid.c src/wl/sys/wl_cfg80211_hybrid.c
  }
  
  static s32
-diff -u -r src/wl/sys/wl_iw.c src/wl/sys/wl_iw.c
---- a/src/wl/sys/wl_iw.c	2021-01-25 09:00:13.163543809 -0800
-+++ b/src/wl/sys/wl_iw.c	2021-01-25 09:02:04.218646005 -0800
-@@ -37,6 +37,7 @@
+--- 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 <wl_dbg.h>
  #include <wl_iw.h>
@@ -79,7 +77,7 @@ diff -u -r src/wl/sys/wl_iw.c src/wl/sys/wl_iw.c
  
  extern bool wl_iw_conn_status_str(uint32 event_type, uint32 status,
  	uint32 reason, char* stringBuf, uint buflen);
-@@ -106,29 +107,7 @@
+@@ -106,29 +107,7 @@ dev_wlc_ioctl(
  	int len
  )
  {
@@ -110,10 +108,9 @@ diff -u -r src/wl/sys/wl_iw.c src/wl/sys/wl_iw.c
  }
  
  static int
-diff -u -r src/wl/sys/wl_linux.c src/wl/sys/wl_linux.c
---- a/src/wl/sys/wl_linux.c	2021-01-25 09:02:08.055475147 -0800
-+++ b/src/wl/sys/wl_linux.c	2021-01-25 09:06:11.894764339 -0800
-@@ -1650,10 +1650,7 @@
+--- a/src/wl/sys/wl_linux.c
++++ b/src/wl/sys/wl_linux.c
+@@ -1650,10 +1650,7 @@ wl_ioctl(struct net_device *dev, struct
  		goto done2;
  	}
  
@@ -125,7 +122,7 @@ diff -u -r src/wl/sys/wl_linux.c src/wl/sys/wl_linux.c
  		if (!(buf = (void *) MALLOC(wl->osh, MAX(ioc.len, WLC_IOCTL_MAXLEN)))) {
  			bcmerror = BCME_NORESOURCE;
  			goto done2;
-@@ -1674,7 +1671,7 @@
+@@ -1674,7 +1671,7 @@ wl_ioctl(struct net_device *dev, struct
  	WL_UNLOCK(wl);
  
  done1:
@@ -134,7 +131,7 @@ diff -u -r src/wl/sys/wl_linux.c src/wl/sys/wl_linux.c
  		if (copy_to_user(ioc.buf, buf, ioc.len))
  			bcmerror = BCME_BADADDR;
  		MFREE(wl->osh, buf, MAX(ioc.len, WLC_IOCTL_MAXLEN));
-@@ -1684,6 +1681,39 @@
+@@ -1684,6 +1681,39 @@ done2:
  	ASSERT(VALID_BCMERROR(bcmerror));
  	if (bcmerror != 0)
  		wl->pub->bcmerror = bcmerror;
@@ -174,9 +171,8 @@ diff -u -r src/wl/sys/wl_linux.c src/wl/sys/wl_linux.c
  	return (OSL_ERROR(bcmerror));
  }
  
-diff -u -r src/wl/sys/wl_linux.h src/wl/sys/wl_linux.h
---- a/src/wl/sys/wl_linux.h	2021-01-25 09:06:15.188672391 -0800
-+++ b/src/wl/sys/wl_linux.h	2021-01-25 09:07:49.457810535 -0800
+--- a/src/wl/sys/wl_linux.h
++++ b/src/wl/sys/wl_linux.h
 @@ -29,6 +29,7 @@
  #define _wl_linux_h_
  
@@ -185,7 +181,7 @@ diff -u -r src/wl/sys/wl_linux.h src/wl/sys/wl_linux.h
  
  typedef struct wl_timer {
  	struct timer_list 	timer;
-@@ -194,6 +195,7 @@
+@@ -194,6 +195,7 @@ extern irqreturn_t wl_isr(int irq, void
  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);
@@ -193,9 +189,8 @@ diff -u -r src/wl/sys/wl_linux.h src/wl/sys/wl_linux.h
  extern struct net_device * wl_netdev_get(wl_info_t *wl);
  
  #endif 
-diff -u -r src/wl/sys/wlc_pub.h src/wl/sys/wlc_pub.h
---- a/src/wl/sys/wlc_pub.h	2021-01-25 09:07:54.543645032 -0800
-+++ b/src/wl/sys/wlc_pub.h	2021-01-25 09:08:10.772110464 -0800
+--- a/src/wl/sys/wlc_pub.h
++++ b/src/wl/sys/wlc_pub.h
 @@ -24,6 +24,7 @@
  
  #include <wlc_types.h>
diff --git a/srcpkgs/broadcom-wl-dkms/patches/013-linux-5.17.patch b/srcpkgs/broadcom-wl-dkms/patches/013-linux-5.17.patch
new file mode 100644
index 000000000000..70eea27b0a74
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/013-linux-5.17.patch
@@ -0,0 +1,54 @@
+Source: Arch Linux
+--- a/src/wl/sys/wl_linux.c
++++ b/src/wl/sys/wl_linux.c
+@@ -93,6 +93,10 @@ struct iw_statistics *wl_get_wireless_st
+ 
+ #include <wlc_wowl.h>
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)
++#define PDE_DATA pde_data
++#endif
++
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ static void wl_timer(ulong data);
+ #else
+@@ -493,6 +497,12 @@ wl_if_setup(struct net_device *dev)
+ #endif
+ }
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
++static inline void eth_hw_addr_set(struct net_device *dev, const void *addr) {
++	memcpy(dev->dev_addr, addr, ETHER_ADDR_LEN);
++}
++#endif
++
+ static wl_info_t *
+ wl_attach(uint16 vendor, uint16 device, ulong regs,
+ 	uint bustype, void *btparam, uint irq, uchar* bar1_addr, uint32 bar1_size)
+@@ -637,7 +647,7 @@ wl_attach(uint16 vendor, uint16 device,
+ 			WL_ERROR(("wl%d: Error setting MAC ADDRESS\n", unit));
+ 	}
+ #endif 
+-	bcopy(&wl->pub->cur_etheraddr, dev->dev_addr, ETHER_ADDR_LEN);
++	eth_hw_addr_set(dev, wl->pub->cur_etheraddr.octet);
+ 
+ 	online_cpus = 1;
+ 
+@@ -1838,7 +1848,7 @@ wl_set_mac_address(struct net_device *de
+ 
+ 	WL_LOCK(wl);
+ 
+-	bcopy(sa->sa_data, dev->dev_addr, ETHER_ADDR_LEN);
++	eth_hw_addr_set(dev, sa->sa_data);
+ 	err = wlc_iovar_op(wl->wlc, "cur_etheraddr", NULL, 0, sa->sa_data, ETHER_ADDR_LEN,
+ 		IOV_SET, (WL_DEV_IF(dev))->wlcif);
+ 	WL_UNLOCK(wl);
+@@ -3021,7 +3031,7 @@ _wl_add_monitor_if(wl_task_t *task)
+ 	else
+ 		dev->type = ARPHRD_IEEE80211_RADIOTAP;
+ 
+-	bcopy(wl->dev->dev_addr, dev->dev_addr, ETHER_ADDR_LEN);
++	eth_hw_addr_set(dev, wl->dev->dev_addr);
+ 
+ #if defined(WL_USE_NETDEV_OPS)
+ 	dev->netdev_ops = &wl_netdev_monitor_ops;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.18.patch b/srcpkgs/broadcom-wl-dkms/patches/014-linux-5.18.patch
similarity index 82%
rename from srcpkgs/broadcom-wl-dkms/patches/linux-5.18.patch
rename to srcpkgs/broadcom-wl-dkms/patches/014-linux-5.18.patch
index d837429a6899..01dbc5d5d46d 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.18.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/014-linux-5.18.patch
@@ -1,7 +1,6 @@
-diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
---- a/src/shared/linux_osl.c	2022-05-24 20:51:15.662604980 +0000
-+++ b/src/shared/linux_osl.c	2022-05-24 21:13:38.264472425 +0000
-@@ -599,6 +599,8 @@
+--- a/src/shared/linux_osl.c
++++ b/src/shared/linux_osl.c
+@@ -599,6 +599,8 @@ osl_dma_alloc_consistent(osl_t *osh, uin
  	va = kmalloc(size, GFP_ATOMIC | __GFP_ZERO);
  	if (va)
  		*pap = (ulong)__virt_to_phys(va);
@@ -10,7 +9,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  #else
  	va = pci_alloc_consistent(osh->pdev, size, (dma_addr_t*)pap);
  #endif
-@@ -612,6 +614,8 @@
+@@ -612,6 +614,8 @@ osl_dma_free_consistent(osl_t *osh, void
  
  #ifdef __ARM_ARCH_7A__
  	kfree(va);
@@ -19,7 +18,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  #else
  	pci_free_consistent(osh->pdev, size, va, (dma_addr_t)pa);
  #endif
-@@ -623,7 +627,11 @@
+@@ -623,7 +627,11 @@ osl_dma_map(osl_t *osh, void *va, uint s
  	int dir;
  
  	ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));
@@ -31,7 +30,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  
  #if defined(__ARM_ARCH_7A__) && defined(BCMDMASGLISTOSL)
  	if (dmah != NULL) {
-@@ -641,7 +649,11 @@
+@@ -641,7 +649,11 @@ osl_dma_map(osl_t *osh, void *va, uint s
  				ASSERT(totsegs + nsegs <= MAX_DMA_SEGS);
  				sg->page_link = 0;
  				sg_set_buf(sg, PKTDATA(osh, skb), PKTLEN(osh, skb));
@@ -43,7 +42,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  			}
  			totsegs += nsegs;
  			totlen += PKTLEN(osh, skb);
-@@ -656,7 +668,11 @@
+@@ -656,7 +668,11 @@ osl_dma_map(osl_t *osh, void *va, uint s
  	}
  #endif 
  
@@ -55,7 +54,7 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c
  }
  
  void BCMFASTPATH
-@@ -665,8 +681,13 @@
+@@ -665,8 +681,13 @@ osl_dma_unmap(osl_t *osh, uint pa, uint
  	int dir;
  
  	ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));
diff --git a/srcpkgs/broadcom-wl-dkms/patches/015-linux-6.0.patch b/srcpkgs/broadcom-wl-dkms/patches/015-linux-6.0.patch
new file mode 100644
index 000000000000..f1a1144cdd10
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/015-linux-6.0.patch
@@ -0,0 +1,31 @@
+From 933540c63f33e6ac2825d65c4b681ef3387d9146 Mon Sep 17 00:00:00 2001
+From: Antoine Cotten <hello@acotten.com>
+Date: Mon, 15 Aug 2022 17:53:51 +0200
+Subject: [PATCH] cfg80211_roam_info compat for MLO APIs in Linux >= 6.0
+
+The 'bssid' struct field is now under 'links.bssid'.
+
+See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=efbabc11650040c64884ff3019b88c7bcc0ceb1d
+
+Original patch by Joan Bruguera:
+https://gist.github.com/joanbm/207210d74637870c01ef5a3c262a597d
+---
+ src/wl/sys/wl_cfg80211_hybrid.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/src/wl/sys/wl_cfg80211_hybrid.c
++++ b/src/wl/sys/wl_cfg80211_hybrid.c
+@@ -2363,8 +2363,13 @@ wl_bss_roaming_done(struct wl_cfg80211_p
+ 	wl_update_bss_info(wl);
+ 
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
++	roam_info.links[0].channel = &wl->conf->channel;
++	roam_info.links[0].bssid = (u8 *)&wl->bssid;
++#else
+ 	roam_info.channel = &wl->conf->channel;
+ 	roam_info.bssid = (u8 *)&wl->bssid;
++#endif
+ 	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;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/gcc-4.9.patch b/srcpkgs/broadcom-wl-dkms/patches/gcc-4.9.patch
deleted file mode 100644
index ec354cecdbb5..000000000000
--- a/srcpkgs/broadcom-wl-dkms/patches/gcc-4.9.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-https://github.com/voidlinux/xbps-packages/issues/412
-
---- a/Makefile	2014-05-21 12:47:46.915833131 +0200
-+++ b/Makefile	2014-05-21 12:48:54.027409879 +0200
-@@ -126,6 +126,8 @@ EXTRA_CFLAGS       += -I$(src)/src/wl/sy
- EXTRA_CFLAGS       += -I$(src)/src/shared/bcmwifi/include
- #EXTRA_CFLAGS       += -DBCMDBG_ASSERT
- 
-+EXTRA_CFLAGS       += -Wno-date-time
-+
- EXTRA_LDFLAGS      := $(src)/lib/wlc_hybrid.o_shipped
- 
- KBASE              ?= /lib/modules/`uname -r`
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.15.patch b/srcpkgs/broadcom-wl-dkms/patches/linux-4.15.patch
deleted file mode 100644
index 9fcd7176b50a..000000000000
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.15.patch
+++ /dev/null
@@ -1,44 +0,0 @@
---- a/src/wl/sys/wl_linux.c     2018-01-31 11:33:26.000000000 +0100 
-+++ b/src/wl/sys/wl_linux.c     2018-01-31 15:27:18.000000000 +0100 
-@@ -93,7 +93,11 @@ 
- 
- #include <wlc_wowl.h>
- 
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) 
- static void wl_timer(ulong data);
-+#else 
-+static void wl_timer(struct timer_list *tl); 
-+#endif 
- static void _wl_timer(wl_timer_t *t);
- static struct net_device *wl_alloc_linux_if(wl_if_t *wlif);
- 
-@@ -2301,9 +2305,17 @@ 
- }
- 
- static void
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) 
- wl_timer(ulong data)
-+#else 
-+wl_timer(struct timer_list *tl) 
-+#endif 
- {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) 
- 	wl_timer_t *t = (wl_timer_t *)data;
-+#else 
-+    wl_timer_t *t = from_timer(t, tl, timer); 
-+#endif 
- 
- 	if (!WL_ALL_PASSIVE_ENAB(t->wl))
- 		_wl_timer(t);
-@@ -2355,7 +2367,11 @@ 
- 
- 	bzero(t, sizeof(wl_timer_t));
- 
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) 
- 	init_timer(&t->timer);
- 	t->timer.data = (ulong) t;
- 	t->timer.function = wl_timer;
-+#else 
-+    timer_setup(&t->timer, wl_timer, 0); 
-+#endif 
- 	t->wl = wl;
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-4.3.patch b/srcpkgs/broadcom-wl-dkms/patches/linux-4.3.patch
deleted file mode 100644
index 9487eb68f0bc..000000000000
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-4.3.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff -ru a/src/shared/linux_osl.c b/src/shared/linux_osl.c
---- a/src/shared/linux_osl.c	2015-09-18 15:47:30.000000000 -0700
-+++ b/src/shared/linux_osl.c	2015-11-14 15:38:10.484563014 -0800
-@@ -932,7 +932,11 @@
- 	uint cycles;
- 
- #if defined(__i386__)
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
-+	cycles = rdtsc();
-+#else
- 	rdtscl(cycles);
-+#endif
- #else
- 	cycles = 0;
- #endif 
diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.17.patch b/srcpkgs/broadcom-wl-dkms/patches/linux-5.17.patch
deleted file mode 100644
index 74847cb6bb40..000000000000
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.17.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-diff -u -r a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c
---- a/src/wl/sys/wl_linux.c	2022-03-23 00:35:42.930416350 +0000
-+++ b/src/wl/sys/wl_linux.c	2022-03-23 00:40:12.903771013 +0000
-@@ -2980,7 +2980,11 @@
- 	else
- 		dev->type = ARPHRD_IEEE80211_RADIOTAP;
- 
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
- 	bcopy(wl->dev->dev_addr, dev->dev_addr, ETHER_ADDR_LEN);
-+#else
-+	eth_hw_addr_set(wl->dev, dev->dev_addr);
-+#endif
- 
- #if defined(WL_USE_NETDEV_OPS)
- 	dev->netdev_ops = &wl_netdev_monitor_ops;
-@@ -3261,7 +3265,11 @@
- static ssize_t
- wl_proc_read(struct file *filp, char __user *buffer, size_t length, loff_t *offp)
- {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
- 	wl_info_t * wl = PDE_DATA(file_inode(filp));
-+#else
-+	wl_info_t * wl = pde_data(file_inode(filp));
-+#endif
- #endif
- 	int bcmerror, len;
- 	int to_user = 0;
-@@ -3318,7 +3326,11 @@
- static ssize_t
- wl_proc_write(struct file *filp, const char __user *buff, size_t length, loff_t *offp)
- {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
- 	wl_info_t * wl = PDE_DATA(file_inode(filp));
-+#else
-+	wl_info_t * wl = pde_data(file_inode(filp));
-+#endif
- #endif
- 	int from_user = 0;
- 	int bcmerror;

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: broadcom-wl-dkms: patch for 6.0
  2022-10-14 11:56 [PR PATCH] broadcom-wl-dkms: patch for 6.0 sgn
                   ` (3 preceding siblings ...)
  2022-10-14 17:03 ` sgn
@ 2022-10-14 23:39 ` sgn
  2022-10-14 23:39 ` [PR PATCH] [Merged]: " sgn
  5 siblings, 0 replies; 7+ messages in thread
From: sgn @ 2022-10-14 23:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 213 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/39950#issuecomment-1279595127

Comment:
Now, `line-mainline` has been moved to `6.0`. Let's merge and see complain.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Merged]: broadcom-wl-dkms: patch for 6.0
  2022-10-14 11:56 [PR PATCH] broadcom-wl-dkms: patch for 6.0 sgn
                   ` (4 preceding siblings ...)
  2022-10-14 23:39 ` sgn
@ 2022-10-14 23:39 ` sgn
  5 siblings, 0 replies; 7+ messages in thread
From: sgn @ 2022-10-14 23:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1136 bytes --]

There's a merged pull request on the void-packages repository

broadcom-wl-dkms: patch for 6.0
https://github.com/void-linux/void-packages/pull/39950

Description:
While we're at it, import change for 5.17

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **NO**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-10-14 23:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-14 11:56 [PR PATCH] broadcom-wl-dkms: patch for 6.0 sgn
2022-10-14 16:37 ` [PR PATCH] [Updated] " sgn
2022-10-14 16:56 ` sgn
2022-10-14 17:01 ` sgn
2022-10-14 17:03 ` sgn
2022-10-14 23:39 ` sgn
2022-10-14 23:39 ` [PR PATCH] [Merged]: " sgn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).