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?= 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 adef19f30af1a1..2b47ef5282e92e 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 00000000000000..c6421d5739f4e1 --- /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 e2d0dfc23f22c8..3f53c90b57581a 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 0f3e8190622685..4b1c95b7cc0a81 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 ae73bcf9b6b11b..b4bad06bd7655e 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 #include #include -diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c -index 489c9f5..f8278ad 100644 --- a/src/wl/sys/wl_linux.c +++ b/src/wl/sys/wl_linux.c @@ -117,6 +117,9 @@ int wl_found = 0; @@ -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 bf9494a30fedbf..f876fbc16612f7 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 00000000000000..884ed34b3c26bc --- /dev/null +++ b/srcpkgs/broadcom-wl-dkms/patches/008-linux-4.14.patch @@ -0,0 +1,35 @@ +From: Gerardo Esteban Malazdrewicz +Date: Fri, 29 Dec 2017 23:44:24 -0400 +Subject: linux414 +Origin: https://bugs.debian.org/885885 + +linux 4.14 changed the kernel_read function prototype. +--- + src/shared/linux_osl.c | 12 +++++++++++- + 1 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 00000000000000..de4f7014c92966 --- /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 + ++#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 1820dff63c203f..bd4cc1ce2477a8 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 113fd092ecce41..4aa4c1a3b55a62 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 53514bf020a148..6c22a00114911a 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 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 #include @@ -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 #include @@ -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 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 00000000000000..70eea27b0a74aa --- /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 + ++#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 d837429a689963..01dbc5d5d46dfb 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 00000000000000..f1a1144cdd107e --- /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 +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 ec354cecdbb5a9..00000000000000 --- 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 9fcd7176b50ac1..00000000000000 --- 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 - -+#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 9487eb68f0bcf8..00000000000000 --- 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 74847cb6bb407c..00000000000000 --- 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;