From 9080e9067e5101d6c3f116b8a67162c77dbeb8b8 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Wed, 19 Jun 2024 11:55:24 -0700 Subject: [PATCH 1/3] linuxPackages.broadcom_sta: remove i686-build-failure.patch since it was applied upstream --- .../os-specific/linux/broadcom-sta/default.nix | 1 - .../broadcom-sta/i686-build-failure.patch | 18 ------------------ 2 files changed, 19 deletions(-) delete mode 100644 pkgs/os-specific/linux/broadcom-sta/i686-build-failure.patch diff --git a/pkgs/os-specific/linux/broadcom-sta/default.nix b/pkgs/os-specific/linux/broadcom-sta/default.nix index 6b7d8b912fa2..bb482d34e79f 100644 --- a/pkgs/os-specific/linux/broadcom-sta/default.nix +++ b/pkgs/os-specific/linux/broadcom-sta/default.nix @@ -24,7 +24,6 @@ stdenv.mkDerivation { nativeBuildInputs = kernel.moduleBuildDependencies; patches = [ - ./i686-build-failure.patch ./license.patch ./linux-4.7.patch # source: https://git.archlinux.org/svntogit/community.git/tree/trunk/004-linux48.patch?h=packages/broadcom-wl-dkms diff --git a/pkgs/os-specific/linux/broadcom-sta/i686-build-failure.patch b/pkgs/os-specific/linux/broadcom-sta/i686-build-failure.patch deleted file mode 100644 index 9bb093ca49c5..000000000000 --- a/pkgs/os-specific/linux/broadcom-sta/i686-build-failure.patch +++ /dev/null @@ -1,18 +0,0 @@ -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=fe47ae6e1a5005b2e82f7eab57b5c3820453293a -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=4ea1636b04dbd66536fa387bae2eea463efc705b - -diff -ru a/src/shared/linux_osl.c b/src/shared/linux_osl.c ---- a/src/shared/linux_osl.c 2015-09-19 01:47:15.000000000 +0300 -+++ b/src/shared/linux_osl.c 2015-11-21 15:20:30.585902518 +0200 -@@ -932,7 +932,11 @@ - uint cycles; - - #if defined(__i386__) -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) -+ cycles = (u32)rdtsc(); -+#else - rdtscl(cycles); -+#endif - #else - cycles = 0; - #endif From d4854eb63289740cc96c7063a0fc9be8f63016cd Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Wed, 19 Jun 2024 16:24:43 -0700 Subject: [PATCH 2/3] linuxPackages.broadcom_sta: use git format-patch to make all the patches trivially applicable I did the research: the commit times and authors are as correct as an afternoon of internet spelunking can make them. --- pkgs/os-specific/linux/broadcom-sta/gcc.patch | 31 ++++++++--- .../linux/broadcom-sta/license.patch | 21 ++++++-- .../linux/broadcom-sta/linux-4.11.patch | 21 ++++++-- .../linux/broadcom-sta/linux-4.12.patch | 26 +++++++++- .../linux/broadcom-sta/linux-4.15.patch | 38 +++++++++----- .../linux/broadcom-sta/linux-4.7.patch | 52 +++++++++++++------ .../linux/broadcom-sta/linux-4.8.patch | 18 ++++--- .../linux/broadcom-sta/linux-5.1.patch | 19 ++++--- .../linux/broadcom-sta/linux-5.18.patch | 31 +++++++---- .../linux/broadcom-sta/linux-5.6.patch | 19 ++++--- .../linux/broadcom-sta/linux-5.9.patch | 32 +++++++++++- .../linux/broadcom-sta/linux-6.0.patch | 14 +++-- .../linux/broadcom-sta/linux-6.1.patch | 14 +++-- .../linux/broadcom-sta/null-pointer-fix.patch | 29 +++++++++-- .../linux/broadcom-sta/pedantic-fix.patch | 26 ++++++++-- 15 files changed, 297 insertions(+), 94 deletions(-) diff --git a/pkgs/os-specific/linux/broadcom-sta/gcc.patch b/pkgs/os-specific/linux/broadcom-sta/gcc.patch index f93e3f1d3a3f..ec8a2fa3a09c 100644 --- a/pkgs/os-specific/linux/broadcom-sta/gcc.patch +++ b/pkgs/os-specific/linux/broadcom-sta/gcc.patch @@ -1,11 +1,28 @@ ---- a/Makefile 2014-06-26 10:42:08.000000000 +0000 -+++ b/Makefile 2014-07-17 22:44:01.662297228 +0000 -@@ -126,6 +126,8 @@ +From 3e28c2a24c3b3b011506bcaa4fee7e8da347c5ff Mon Sep 17 00:00:00 2001 +From: Charles Strahan +Date: Tue, 5 May 2015 15:09:51 -0400 +Subject: [PATCH 01/16] linuxPackages.broadcom_sta: since GCC respects + SOURCE_DATE_EPOCH, set in the stdenv, set -Wno-date-time + +--- + Makefile | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/Makefile b/Makefile +index a323a0d..15e85c8 100644 +--- a/Makefile ++++ b/Makefile +@@ -140,10 +140,7 @@ wl-objs += src/wl/sys/wl_cfg80211_hybrid.o + EXTRA_CFLAGS += -I$(src)/src/include -I$(src)/src/common/include + EXTRA_CFLAGS += -I$(src)/src/wl/sys -I$(src)/src/wl/phy -I$(src)/src/wl/ppr/include EXTRA_CFLAGS += -I$(src)/src/shared/bcmwifi/include - #EXTRA_CFLAGS += -DBCMDBG_ASSERT -DBCMDBG_ERR +-#EXTRA_CFLAGS += -DBCMDBG_ASSERT -DBCMDBG_ERR +-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` +-- +2.45.1 + diff --git a/pkgs/os-specific/linux/broadcom-sta/license.patch b/pkgs/os-specific/linux/broadcom-sta/license.patch index aebb46365195..58ff5dba644b 100644 --- a/pkgs/os-specific/linux/broadcom-sta/license.patch +++ b/pkgs/os-specific/linux/broadcom-sta/license.patch @@ -1,7 +1,18 @@ -diff -Naur hybrid-portsrc-x86_32-v5_10_91_9.orig/src/wl/sys/wl_linux.c hybrid-portsrc-x86_32-v5_10_91_9/src/wl/sys/wl_linux.c ---- hybrid-portsrc-x86_32-v5_10_91_9.orig/src/wl/sys/wl_linux.c 2009-04-23 02:48:59.000000000 +0900 -+++ hybrid-portsrc-x86_32-v5_10_91_9/src/wl/sys/wl_linux.c 2009-05-08 00:48:20.000000000 +0900 -@@ -171,6 +171,8 @@ +From 5a964e14474e4482a4d24c015371856560dacabc Mon Sep 17 00:00:00 2001 +From: Shea Levy +Date: Sat, 4 Jan 2014 20:57:21 -0500 +Subject: [PATCH 02/16] linuxPackages.broadcom_sta: apply MIXED/Proprietary + license + +--- + src/wl/sys/wl_linux.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c +index 0d05100..14922c0 100644 +--- a/src/wl/sys/wl_linux.c ++++ b/src/wl/sys/wl_linux.c +@@ -148,6 +148,8 @@ static struct wl_if *wl_alloc_if(wl_info_t *wl, int iftype, uint unit, struct wl static void wl_free_if(wl_info_t *wl, wl_if_t *wlif); static void wl_get_driver_info(struct net_device *dev, struct ethtool_drvinfo *info); @@ -10,4 +21,6 @@ diff -Naur hybrid-portsrc-x86_32-v5_10_91_9.orig/src/wl/sys/wl_linux.c hybrid-po #if defined(WL_CONFIG_RFKILL) #include static int wl_init_rfkill(wl_info_t *wl); +-- +2.45.1 diff --git a/pkgs/os-specific/linux/broadcom-sta/linux-4.11.patch b/pkgs/os-specific/linux/broadcom-sta/linux-4.11.patch index a779f8c84cfd..5e95edecf1ea 100644 --- a/pkgs/os-specific/linux/broadcom-sta/linux-4.11.patch +++ b/pkgs/os-specific/linux/broadcom-sta/linux-4.11.patch @@ -1,5 +1,15 @@ +From 5a0301c2d9c65dbb3c5b8990e635d37f071d26c4 Mon Sep 17 00:00:00 2001 +From: georgewhewell +Date: Fri, 2 Jun 2017 14:19:04 +0100 +Subject: [PATCH 06/16] linuxPackages.broadcom_sta: fix build for kernel 4.11+ + +--- + src/wl/sys/wl_cfg80211_hybrid.c | 3 +++ + src/wl/sys/wl_linux.c | 12 ++++++++++++ + 2 files changed, 15 insertions(+) + diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c -index a9671e2..da36405 100644 +index 84f0068..9fd8ed1 100644 --- a/src/wl/sys/wl_cfg80211_hybrid.c +++ b/src/wl/sys/wl_cfg80211_hybrid.c @@ -30,6 +30,9 @@ @@ -13,7 +23,7 @@ index a9671e2..da36405 100644 #include #include diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c -index 489c9f5..f8278ad 100644 +index 65d7a22..18841d9 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 +36,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) +@@ -2451,6 +2454,9 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rxsts, void *p) { struct sk_buff *oskb = (struct sk_buff *)p; struct sk_buff *skb; @@ -36,7 +46,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) +@@ -2917,7 +2923,13 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rxsts, void *p) if (skb == NULL) return; skb->dev = wl->monitor_dev; @@ -50,3 +60,6 @@ index 489c9f5..f8278ad 100644 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) skb_reset_mac_header(skb); #else +-- +2.45.1 + diff --git a/pkgs/os-specific/linux/broadcom-sta/linux-4.12.patch b/pkgs/os-specific/linux/broadcom-sta/linux-4.12.patch index 8abc73db4db1..aa67a281f45e 100644 --- a/pkgs/os-specific/linux/broadcom-sta/linux-4.12.patch +++ b/pkgs/os-specific/linux/broadcom-sta/linux-4.12.patch @@ -1,5 +1,26 @@ +From 2e9c7bd146fbc3b4a62940140eafb47df16b6cb4 Mon Sep 17 00:00:00 2001 +From: aszlig +Date: Tue, 18 Jul 2017 21:32:13 +0200 +Subject: [PATCH 07/16] linuxPackages.broadcom_sta: fix build for kernel 4.12+ + +The patch is from Arch Linux at: + +https://aur.archlinux.org/cgit/aur.git/tree/linux412.patch?h=broadcom-wl + +Tested this by building against the following attributes: + + * linuxPackages.broadcom_sta + * linuxPackages_latest.broadcom_sta + * pkgsI686Linux.linuxPackages.broadcom_sta + * pkgsI686Linux.linuxPackages_latest.broadcom_sta + +I have not tested whether this works at runtime, because I do not possess the hardware. +--- + src/wl/sys/wl_cfg80211_hybrid.c | 29 ++++++++++++++++++++++++++++- + 1 file changed, 28 insertions(+), 1 deletion(-) + diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c -index da36405..d3741eb 100644 +index 9fd8ed1..1893a53 100644 --- a/src/wl/sys/wl_cfg80211_hybrid.c +++ b/src/wl/sys/wl_cfg80211_hybrid.c @@ -53,7 +53,11 @@ u32 wl_dbg_level = WL_DBG_ERR; @@ -66,3 +87,6 @@ index da36405..d3741eb 100644 WL_DBG(("Report roaming result\n")); set_bit(WL_STATUS_CONNECTED, &wl->status); +-- +2.45.1 + diff --git a/pkgs/os-specific/linux/broadcom-sta/linux-4.15.patch b/pkgs/os-specific/linux/broadcom-sta/linux-4.15.patch index 523fa291d525..24de530cec5e 100644 --- a/pkgs/os-specific/linux/broadcom-sta/linux-4.15.patch +++ b/pkgs/os-specific/linux/broadcom-sta/linux-4.15.patch @@ -1,12 +1,21 @@ +From ae88c3c0c91d26ca5e4dc1e498a370747d2c3b03 Mon Sep 17 00:00:00 2001 +From: Yegor Timoshenko +Date: Wed, 31 Jan 2018 22:59:09 +0000 +Subject: [PATCH 08/16] linuxPackages.broadcom_sta: fix build for kernel 4.15+ + See: https://lkml.org/lkml/2017/11/25/90 +--- + src/wl/sys/wl_linux.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) -diff -urNZ a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c ---- a/src/wl/sys/wl_linux.c 2015-09-18 22:47:30.000000000 +0000 -+++ b/src/wl/sys/wl_linux.c 2018-01-31 22:52:10.859856221 +0000 -@@ -93,7 +93,11 @@ - +diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c +index 18841d9..83b8859 100644 +--- a/src/wl/sys/wl_linux.c ++++ b/src/wl/sys/wl_linux.c +@@ -93,7 +93,11 @@ struct iw_statistics *wl_get_wireless_stats(struct net_device *dev); + #include - + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) +static void wl_timer(struct timer_list *tl); +#else @@ -14,10 +23,10 @@ diff -urNZ a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c +#endif static void _wl_timer(wl_timer_t *t); static struct net_device *wl_alloc_linux_if(wl_if_t *wlif); - -@@ -2298,9 +2302,15 @@ + +@@ -2303,9 +2307,15 @@ wl_timer_task(wl_task_t *task) } - + static void +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) +wl_timer(struct timer_list *tl) @@ -28,13 +37,13 @@ diff -urNZ a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c { wl_timer_t *t = (wl_timer_t *)data; +#endif - + if (!WL_ALL_PASSIVE_ENAB(t->wl)) _wl_timer(t); -@@ -2352,9 +2362,13 @@ - +@@ -2357,9 +2367,13 @@ wl_init_timer(wl_info_t *wl, void (*fn)(void *arg), void *arg, const char *tname + bzero(t, sizeof(wl_timer_t)); - + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) + timer_setup(&t->timer, wl_timer, 0); +#else @@ -45,3 +54,6 @@ diff -urNZ a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c t->wl = wl; t->fn = fn; t->arg = arg; +-- +2.45.1 + diff --git a/pkgs/os-specific/linux/broadcom-sta/linux-4.7.patch b/pkgs/os-specific/linux/broadcom-sta/linux-4.7.patch index 44222b3324bf..77e8ad1f024f 100644 --- a/pkgs/os-specific/linux/broadcom-sta/linux-4.7.patch +++ b/pkgs/os-specific/linux/broadcom-sta/linux-4.7.patch @@ -1,17 +1,36 @@ +From bc408ef546b08443dabbe8fcdfec5e1e48494ed8 Mon Sep 17 00:00:00 2001 +From: aszlig +Date: Mon, 1 Aug 2016 20:45:47 +0200 +Subject: [PATCH 04/16] linuxPackages.broadcom_sta: fix build for kernel 4.7+ + +Patch is from Arch Linux at: + +https://aur.archlinux.org/cgit/aur.git/tree/?h=broadcom-wl + +I've tested building against 3.18.36, 4.4.16 and 4.7.0. + +Signed-off-by: aszlig +Cc: @phreedom, @vcunat + Since Linux 4.7, the enum ieee80211_band is no longer used This shall cause no problem's since both enums ieee80211_band and nl80211_band were added in the same commit: -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=13ae75b103e07304a34ab40c9136e9f53e06475c +https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=13ae75b103e07304a34ab40c9136e9f53e06475c This patch refactors the references of IEEE80211_BAND_* to NL80211_BAND_* Reference: -https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=57fbcce37be7c1d2622b56587c10ade00e96afa3 +https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=57fbcce37be7c1d2622b56587c10ade00e96afa3 +--- + src/wl/sys/wl_cfg80211_hybrid.c | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) ---- a/src/wl/sys/wl_cfg80211_hybrid.c 2016-06-13 11:57:36.159340297 -0500 -+++ b/src/wl/sys/wl_cfg80211_hybrid.c 2016-06-13 11:58:18.442323435 -0500 -@@ -236,7 +236,7 @@ +diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c +index 7b606e0..3b438ba 100644 +--- a/src/wl/sys/wl_cfg80211_hybrid.c ++++ b/src/wl/sys/wl_cfg80211_hybrid.c +@@ -236,7 +236,7 @@ static s8 wl_dbg_estr[][WL_DBG_ESTR_MAX] = { #endif #define CHAN2G(_channel, _freq, _flags) { \ @@ -20,7 +39,7 @@ https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=57f .center_freq = (_freq), \ .hw_value = (_channel), \ .flags = (_flags), \ -@@ -245,7 +245,7 @@ +@@ -245,7 +245,7 @@ static s8 wl_dbg_estr[][WL_DBG_ESTR_MAX] = { } #define CHAN5G(_channel, _flags) { \ @@ -29,7 +48,7 @@ https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=57f .center_freq = 5000 + (5 * (_channel)), \ .hw_value = (_channel), \ .flags = (_flags), \ -@@ -379,7 +379,7 @@ +@@ -379,7 +379,7 @@ static struct ieee80211_channel __wl_5ghz_n_channels[] = { }; static struct ieee80211_supported_band __wl_band_2ghz = { @@ -38,7 +57,7 @@ https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=57f .channels = __wl_2ghz_channels, .n_channels = ARRAY_SIZE(__wl_2ghz_channels), .bitrates = wl_g_rates, -@@ -387,7 +387,7 @@ +@@ -387,7 +387,7 @@ static struct ieee80211_supported_band __wl_band_2ghz = { }; static struct ieee80211_supported_band __wl_band_5ghz_a = { @@ -47,7 +66,7 @@ https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=57f .channels = __wl_5ghz_a_channels, .n_channels = ARRAY_SIZE(__wl_5ghz_a_channels), .bitrates = wl_a_rates, -@@ -395,7 +395,7 @@ +@@ -395,7 +395,7 @@ static struct ieee80211_supported_band __wl_band_5ghz_a = { }; static struct ieee80211_supported_band __wl_band_5ghz_n = { @@ -56,18 +75,18 @@ https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=57f .channels = __wl_5ghz_n_channels, .n_channels = ARRAY_SIZE(__wl_5ghz_n_channels), .bitrates = wl_a_rates, -@@ -1876,8 +1876,8 @@ +@@ -1876,8 +1876,8 @@ static s32 wl_alloc_wdev(struct device *dev, struct wireless_dev **rwdev) wdev->wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX; #endif wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC); - wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = &__wl_band_2ghz; - wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_a; + wdev->wiphy->bands[NL80211_BAND_2GHZ] = &__wl_band_2ghz; -+ wdev->wiphy->bands[NL80211_BAND_5GHZ] = &__wl_band_5ghz_a; ++ wdev->wiphy->bands[NL80211_BAND_5GHZ] = &__wl_band_5ghz_a; wdev->wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; wdev->wiphy->cipher_suites = __wl_cipher_suites; wdev->wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites); -@@ -2000,7 +2000,7 @@ +@@ -2000,7 +2000,7 @@ static s32 wl_inform_single_bss(struct wl_cfg80211_priv *wl, struct wl_bss_info #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39) freq = ieee80211_channel_to_frequency(notif_bss_info->channel, (notif_bss_info->channel <= CH_MAX_2G_CHANNEL) ? @@ -76,7 +95,7 @@ https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=57f #else freq = ieee80211_channel_to_frequency(notif_bss_info->channel); #endif -@@ -2116,7 +2116,7 @@ +@@ -2116,7 +2116,7 @@ wl_notify_connect_status(struct wl_cfg80211_priv *wl, struct net_device *ndev, return err; } chan = wf_chspec_ctlchan(chanspec); @@ -85,7 +104,7 @@ https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=57f freq = ieee80211_channel_to_frequency(chan, band); channel = ieee80211_get_channel(wiphy, freq); cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, channel, GFP_KERNEL); -@@ -2250,10 +2250,10 @@ +@@ -2250,10 +2250,10 @@ static void wl_ch_to_chanspec(struct ieee80211_channel *chan, struct wl_join_par join_params->params.chanspec_list[0] = ieee80211_frequency_to_channel(chan->center_freq); @@ -98,7 +117,7 @@ https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=57f chanspec |= WL_CHANSPEC_BAND_5G; } else { -@@ -2885,7 +2885,7 @@ +@@ -2885,7 +2885,7 @@ static s32 wl_update_wiphybands(struct wl_cfg80211_priv *wl) if (phy == 'n' || phy == 'a' || phy == 'v') { wiphy = wl_to_wiphy(wl); @@ -107,3 +126,6 @@ https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=57f } return err; +-- +2.45.1 + diff --git a/pkgs/os-specific/linux/broadcom-sta/linux-4.8.patch b/pkgs/os-specific/linux/broadcom-sta/linux-4.8.patch index 20e8a9ae49d2..b5a1f8961107 100644 --- a/pkgs/os-specific/linux/broadcom-sta/linux-4.8.patch +++ b/pkgs/os-specific/linux/broadcom-sta/linux-4.8.patch @@ -1,18 +1,20 @@ -From d3f93542326a06d920c6eb89b703384290d37b8b Mon Sep 17 00:00:00 2001 +From 8c536235639010135f8dc11a8ec0968f9b200a6e Mon Sep 17 00:00:00 2001 From: Alberto Milone Date: Fri, 2 Sep 2016 17:35:34 +0200 -Subject: [PATCH 1/1] Add support for Linux 4.8 +Subject: [PATCH 05/16] linuxPackages.broadcom_sta: fix build for kernel 4.8+ -Orginal author: Krzysztof Kolasa +Original author: Krzysztof Kolasa + +Source: https://git.archlinux.org/svntogit/community.git/tree/trunk/004-linux48.patch?h=packages/broadcom-wl-dkms --- src/wl/sys/wl_cfg80211_hybrid.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c -index 2fc71fe..ec5e472 100644 +index 3b438ba..84f0068 100644 --- a/src/wl/sys/wl_cfg80211_hybrid.c +++ b/src/wl/sys/wl_cfg80211_hybrid.c -@@ -2388,8 +2388,16 @@ wl_bss_connect_done(struct wl_cfg80211_priv *wl, struct net_device *ndev, +@@ -2386,8 +2386,16 @@ wl_bss_connect_done(struct wl_cfg80211_priv *wl, struct net_device *ndev, s32 err = 0; if (wl->scan_request) { @@ -29,7 +31,7 @@ index 2fc71fe..ec5e472 100644 wl->scan_request = NULL; } -@@ -2490,7 +2498,14 @@ wl_notify_scan_status(struct wl_cfg80211_priv *wl, struct net_device *ndev, +@@ -2488,7 +2496,14 @@ wl_notify_scan_status(struct wl_cfg80211_priv *wl, struct net_device *ndev, scan_done_out: if (wl->scan_request) { @@ -44,7 +46,7 @@ index 2fc71fe..ec5e472 100644 wl->scan_request = NULL; } rtnl_unlock(); -@@ -2909,7 +2924,14 @@ s32 wl_cfg80211_down(struct net_device *ndev) +@@ -2913,7 +2928,14 @@ s32 wl_cfg80211_down(struct net_device *ndev) s32 err = 0; if (wl->scan_request) { @@ -60,5 +62,5 @@ index 2fc71fe..ec5e472 100644 } -- -2.7.4 +2.45.1 diff --git a/pkgs/os-specific/linux/broadcom-sta/linux-5.1.patch b/pkgs/os-specific/linux/broadcom-sta/linux-5.1.patch index 8f04a737cab8..8932903a9735 100644 --- a/pkgs/os-specific/linux/broadcom-sta/linux-5.1.patch +++ b/pkgs/os-specific/linux/broadcom-sta/linux-5.1.patch @@ -1,14 +1,18 @@ -commit bcb06af629a36eb84f9a35ac599ec7e51e2d39fb -Author: georgewhewell -Date: Sat May 18 21:22:37 2019 +0100 +From 35c712b7ad2b20088a1a4e233f1d22d7f6dc2525 Mon Sep 17 00:00:00 2001 +From: georgewhewell +Date: Sat, 18 May 2019 21:36:26 +0100 +Subject: [PATCH 09/16] linuxPackages.broadcom_sta: fix build for kernel 5.1+ - find src -type f -name \'*.c\' -exec sed -i "s/get_ds()/KERNEL_DS/g" {} \; +--- + src/wl/sys/wl_cfg80211_hybrid.c | 2 +- + src/wl/sys/wl_iw.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c -index 7b606e0..51c81bc 100644 +index 1893a53..4b3298f 100644 --- a/src/wl/sys/wl_cfg80211_hybrid.c +++ b/src/wl/sys/wl_cfg80211_hybrid.c -@@ -450,7 +450,7 @@ wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len) +@@ -457,7 +457,7 @@ wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len) ifr.ifr_data = (caddr_t)&ioc; fs = get_fs(); @@ -30,3 +34,6 @@ index c4c610b..9c3c74e 100644 #if defined(WL_USE_NETDEV_OPS) ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE); #else +-- +2.45.1 + diff --git a/pkgs/os-specific/linux/broadcom-sta/linux-5.18.patch b/pkgs/os-specific/linux/broadcom-sta/linux-5.18.patch index d837429a6899..6e72d47a842a 100644 --- a/pkgs/os-specific/linux/broadcom-sta/linux-5.18.patch +++ b/pkgs/os-specific/linux/broadcom-sta/linux-5.18.patch @@ -1,7 +1,17 @@ -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 @@ +From 6c66b0eaaa3e6ebaa84891298715b71f7b2f0b1c Mon Sep 17 00:00:00 2001 +From: X9VoiD +Date: Mon, 13 Jun 2022 17:38:18 +0800 +Subject: [PATCH 13/16] linuxPackages.broadcom_sta: fix build for kernel 5.18+ + +--- + src/shared/linux_osl.c | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +diff --git a/src/shared/linux_osl.c b/src/shared/linux_osl.c +index dcfc075..5a25b82 100644 +--- a/src/shared/linux_osl.c ++++ b/src/shared/linux_osl.c +@@ -599,6 +599,8 @@ osl_dma_alloc_consistent(osl_t *osh, uint size, uint16 align_bits, uint *alloced va = kmalloc(size, GFP_ATOMIC | __GFP_ZERO); if (va) *pap = (ulong)__virt_to_phys(va); @@ -10,7 +20,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 *va, uint size, ulong pa) #ifdef __ARM_ARCH_7A__ kfree(va); @@ -19,7 +29,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 size, int direction, void *p, hnddma_seg_ int dir; ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC))); @@ -31,7 +41,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 size, int direction, void *p, hnddma_seg_ ASSERT(totsegs + nsegs <= MAX_DMA_SEGS); sg->page_link = 0; sg_set_buf(sg, PKTDATA(osh, skb), PKTLEN(osh, skb)); @@ -43,7 +53,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 size, int direction, void *p, hnddma_seg_ } #endif @@ -55,7 +65,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 size, int direction) int dir; ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC))); @@ -69,3 +79,6 @@ diff -u -r a/src/shared/linux_osl.c b/src/shared/linux_osl.c } #if defined(BCMDBG_ASSERT) +-- +2.45.1 + diff --git a/pkgs/os-specific/linux/broadcom-sta/linux-5.6.patch b/pkgs/os-specific/linux/broadcom-sta/linux-5.6.patch index df5af79f77c6..f922cdd97ecd 100644 --- a/pkgs/os-specific/linux/broadcom-sta/linux-5.6.patch +++ b/pkgs/os-specific/linux/broadcom-sta/linux-5.6.patch @@ -1,11 +1,13 @@ -From dd057e40a167f4febb1a7c77dd32b7d36056952c Mon Sep 17 00:00:00 2001 +From 24decccfadc0d95b973e6dd8d476ddde2f0a4b21 Mon Sep 17 00:00:00 2001 From: Herman van Hazendonk Date: Tue, 31 Mar 2020 17:09:55 +0200 -Subject: [PATCH] Add fixes for 5.6 kernel +Subject: [PATCH 10/16] linuxPackages.broadcom_sta: fix build for kernel 5.6+ Use ioremap instead of ioremap_nocache and proc_ops instead of file_operations on Linux kernel 5.6 and above. Signed-off-by: Herman van Hazendonk + +Source: https://salsa.debian.org/Herrie82-guest/broadcom-sta/-/commit/247307926e5540ad574a17c062c8da76990d056f --- src/shared/linux_osl.c | 6 +++++- src/wl/sys/wl_linux.c | 21 ++++++++++++++++++++- @@ -29,10 +31,10 @@ index 6157d18..dcfc075 100644 void diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c -index 0d05100..6d9dd0d 100644 +index 83b8859..646f1d9 100644 --- a/src/wl/sys/wl_linux.c +++ b/src/wl/sys/wl_linux.c -@@ -582,10 +582,17 @@ wl_attach(uint16 vendor, uint16 device, ulong regs, +@@ -591,10 +591,17 @@ wl_attach(uint16 vendor, uint16 device, ulong regs, } wl->bcm_bustype = bustype; @@ -41,7 +43,7 @@ index 0d05100..6d9dd0d 100644 + WL_ERROR(("wl%d: ioremap() failed\n", unit)); + goto fail; + } -+ #else ++ #else if ((wl->regsva = ioremap_nocache(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) { WL_ERROR(("wl%d: ioremap() failed\n", unit)); goto fail; @@ -50,7 +52,7 @@ index 0d05100..6d9dd0d 100644 wl->bar1_addr = bar1_addr; wl->bar1_size = bar1_size; -@@ -772,8 +779,13 @@ wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) +@@ -781,8 +788,13 @@ wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if ((val & 0x0000ff00) != 0) pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); bar1_size = pci_resource_len(pdev, 2); @@ -64,7 +66,7 @@ index 0d05100..6d9dd0d 100644 wl = wl_attach(pdev->vendor, pdev->device, pci_resource_start(pdev, 0), PCI_BUS, pdev, pdev->irq, bar1_addr, bar1_size); -@@ -3335,12 +3347,19 @@ wl_proc_write(struct file *filp, const char __user *buff, size_t length, loff_t +@@ -3363,12 +3375,19 @@ wl_proc_write(struct file *filp, const char __user *buff, size_t length, loff_t } #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) @@ -85,3 +87,6 @@ index 0d05100..6d9dd0d 100644 static int wl_reg_proc_entry(wl_info_t *wl) +-- +2.45.1 + diff --git a/pkgs/os-specific/linux/broadcom-sta/linux-5.9.patch b/pkgs/os-specific/linux/broadcom-sta/linux-5.9.patch index 2a4e6fa89cc3..d3e32c6b3e24 100644 --- a/pkgs/os-specific/linux/broadcom-sta/linux-5.9.patch +++ b/pkgs/os-specific/linux/broadcom-sta/linux-5.9.patch @@ -1,3 +1,30 @@ +From 34d611f2dcf7d34db2cb413cc7b4f86f3706fec6 Mon Sep 17 00:00:00 2001 +From: Joan Bruguera +Date: Tue, 13 Oct 2020 19:35:55 +0200 +Subject: [PATCH 11/16] linuxPackages.broadcom_sta: fix build for kernel 5.9+ + +Get rid of get_fs/set_fs calls in Broadcom WL driver. + +Tentative patch for broadcom-wl 6.30.223.271 driver for Linux 5.10 (tested -rc1 up to 5.10.1) + +Applies on top of all the patches applied to broadcom-wl-dkms 6.30.223.271-23 on Arch Linux. + +NB: Some checks in wlc_ioctl_internal are likely superfluous, + but I'm not familiar enough with the driver to remove them with confidence. + +See also: https://lwn.net/Articles/722267/ + https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=47058bb54b57962b3958a936ddbc59355e4c5504 + https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5e6e9852d6f76e01b2e6803c74258afa5b432bc5 + +Signed-off-by: Joan Bruguera +--- + src/wl/sys/wl_cfg80211_hybrid.c | 26 ++------------------- + src/wl/sys/wl_iw.c | 25 ++------------------- + src/wl/sys/wl_linux.c | 40 ++++++++++++++++++++++++++++----- + src/wl/sys/wl_linux.h | 2 ++ + src/wl/sys/wlc_pub.h | 1 + + 5 files changed, 42 insertions(+), 52 deletions(-) + diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c index 4b3298f..c45ad48 100644 --- a/src/wl/sys/wl_cfg80211_hybrid.c @@ -86,7 +113,7 @@ index 9c3c74e..e346b15 100644 static int diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c -index c990c70..5bb9480 100644 +index 646f1d9..26ba9fa 100644 --- a/src/wl/sys/wl_linux.c +++ b/src/wl/sys/wl_linux.c @@ -1664,10 +1664,7 @@ wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) @@ -182,3 +209,6 @@ index 53a98b8..2b5a029 100644 #include "proto/802.11.h" #include "proto/bcmevent.h" +-- +2.45.1 + diff --git a/pkgs/os-specific/linux/broadcom-sta/linux-6.0.patch b/pkgs/os-specific/linux/broadcom-sta/linux-6.0.patch index dcb5515264d3..12436c9fd852 100644 --- a/pkgs/os-specific/linux/broadcom-sta/linux-6.0.patch +++ b/pkgs/os-specific/linux/broadcom-sta/linux-6.0.patch @@ -1,18 +1,22 @@ -From dbee29df729e543a89b3f95c1436e982eb0047c1 Mon Sep 17 00:00:00 2001 +From cec136ba06039aa2e4441771df855894391db298 Mon Sep 17 00:00:00 2001 From: Joan Bruguera Date: Thu, 30 Jun 2022 02:15:35 +0200 -Subject: [PATCH] Tentative patch for broadcom-wl 6.30.223.271 driver for Linux 6.0-rc1 +Subject: [PATCH 14/16] linuxPackages.broadcom_sta: fix build for kernel 6.0+ + +Tentative patch for broadcom-wl 6.30.223.271 driver for Linux 6.0-rc1 Applies on top of all the patches applied to broadcom-wl-dkms 6.30.223.271-33 on Arch Linux. + +Source: https://gist.github.com/joanbm/207210d74637870c01ef5a3c262a597d --- src/wl/sys/wl_cfg80211_hybrid.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c -index d815b33..7faa735 100644 +index c45ad48..9ae56a1 100644 --- a/src/wl/sys/wl_cfg80211_hybrid.c +++ b/src/wl/sys/wl_cfg80211_hybrid.c -@@ -2381,7 +2381,12 @@ wl_bss_roaming_done(struct wl_cfg80211_priv *wl, struct net_device *ndev, +@@ -2354,7 +2354,12 @@ wl_bss_roaming_done(struct wl_cfg80211_priv *wl, struct net_device *ndev, bss = cfg80211_get_bss(wl_to_wiphy(wl), NULL, (s8 *)&wl->bssid, ssid->SSID, ssid->SSID_len, WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); struct cfg80211_roam_info roam_info = { @@ -26,5 +30,5 @@ index d815b33..7faa735 100644 .req_ie_len = conn_info->req_ie_len, .resp_ie = conn_info->resp_ie, -- -2.37.0 +2.45.1 diff --git a/pkgs/os-specific/linux/broadcom-sta/linux-6.1.patch b/pkgs/os-specific/linux/broadcom-sta/linux-6.1.patch index 5ececd487d74..8991efe8b27c 100644 --- a/pkgs/os-specific/linux/broadcom-sta/linux-6.1.patch +++ b/pkgs/os-specific/linux/broadcom-sta/linux-6.1.patch @@ -1,18 +1,22 @@ -From a63a5f70e5cf05f6bce4cda2e0dd67462e1d76a5 Mon Sep 17 00:00:00 2001 +From febe94b43294a3155e39e844db4ac4ee81614ad1 Mon Sep 17 00:00:00 2001 From: Joan Bruguera Date: Mon, 29 Aug 2022 00:06:53 +0200 -Subject: [PATCH] Tentative patch for broadcom-wl 6.30.223.271 driver for Linux 6.1-rc1 +Subject: [PATCH 16/16] linuxPackages.broadcom_sta: fix build for kernel 6.1+ + +Tentative patch for broadcom-wl 6.30.223.271 driver for Linux 6.1-rc1 Applies on top of all the patches applied to broadcom-wl-dkms 6.30.223.271-35 on Arch Linux + +Source: https://gist.github.com/joanbm/94323ea99eff1e1d1c51241b5b651549 --- src/wl/sys/wl_cfg80211_hybrid.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c -index 4fef22a..50d1e34 100644 +index a6b2ca2..333866c 100644 --- a/src/wl/sys/wl_cfg80211_hybrid.c +++ b/src/wl/sys/wl_cfg80211_hybrid.c -@@ -105,20 +105,25 @@ static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, struct wireless_dev *wd +@@ -104,20 +104,25 @@ static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, struct wireless_dev *wd static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm); #endif @@ -79,5 +83,5 @@ index 4fef22a..50d1e34 100644 #else static s32 -- -2.37.2 +2.45.1 diff --git a/pkgs/os-specific/linux/broadcom-sta/null-pointer-fix.patch b/pkgs/os-specific/linux/broadcom-sta/null-pointer-fix.patch index 763797294307..ff15d295a8c7 100644 --- a/pkgs/os-specific/linux/broadcom-sta/null-pointer-fix.patch +++ b/pkgs/os-specific/linux/broadcom-sta/null-pointer-fix.patch @@ -1,7 +1,25 @@ -diff -urN a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c ---- a/src/wl/sys/wl_linux.c 2015-01-06 12:33:42.981659618 +0100 -+++ b/src/wl/sys/wl_linux.c 2015-01-06 12:34:05.647395418 +0100 -@@ -2157,8 +2157,8 @@ +From 507d93e3651d78c1df8bd185b0703872d0c2585b Mon Sep 17 00:00:00 2001 +From: aszlig +Date: Mon, 1 Aug 2016 21:00:02 +0200 +Subject: [PATCH 03/16] linuxPackages.broadcom_sta: fix NULL pointer deref + +The patch is from the following Gentoo bug: + +https://bugs.gentoo.org/show_bug.cgi?id=523326#c24 + +Built successfully against Linux 3.18.36, 4.4.16 and 4.7.0. + +Signed-off-by: aszlig +Cc: @phreedom, @vcunat +--- + 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 14922c0..65d7a22 100644 +--- a/src/wl/sys/wl_linux.c ++++ b/src/wl/sys/wl_linux.c +@@ -2167,8 +2167,8 @@ wl_start(struct sk_buff *skb, struct net_device *dev) wlif = WL_DEV_IF(dev); wl = WL_INFO(dev); @@ -11,3 +29,6 @@ diff -urN a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c TXQ_LOCK(wl); +-- +2.45.1 + diff --git a/pkgs/os-specific/linux/broadcom-sta/pedantic-fix.patch b/pkgs/os-specific/linux/broadcom-sta/pedantic-fix.patch index 3d190b9d1f82..dfe2cf18bcae 100644 --- a/pkgs/os-specific/linux/broadcom-sta/pedantic-fix.patch +++ b/pkgs/os-specific/linux/broadcom-sta/pedantic-fix.patch @@ -1,8 +1,21 @@ +From 99b1bbc01ea0611e93cb94c2a2532aef96676976 Mon Sep 17 00:00:00 2001 +From: X9VoiD +Date: Wed, 19 Oct 2022 00:29:28 +0800 +Subject: [PATCH 15/16] linuxPackages.broadcom_sta: fix build issues with + kernel 6.0+ + +--- + src/shared/linux_osl.c | 2 +- + src/wl/sys/wl_cfg80211_hybrid.c | 17 ++++++++--------- + src/wl/sys/wl_iw.h | 1 - + src/wl/sys/wl_linux.c | 17 +++++++++-------- + 4 files changed, 18 insertions(+), 19 deletions(-) + diff --git a/src/shared/linux_osl.c b/src/shared/linux_osl.c -index 711b771..5a2636a 100644 +index 5a25b82..18bacb6 100644 --- a/src/shared/linux_osl.c +++ b/src/shared/linux_osl.c -@@ -1105,7 +1105,7 @@ osl_os_get_image_block(char *buf, int len, void *image) +@@ -1101,7 +1101,7 @@ osl_os_get_image_block(char *buf, int len, void *image) if (!image) return 0; @@ -12,7 +25,7 @@ index 711b771..5a2636a 100644 fp->f_pos += rdlen; diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c -index 2b3c290..093dce6 100644 +index 9ae56a1..a6b2ca2 100644 --- a/src/wl/sys/wl_cfg80211_hybrid.c +++ b/src/wl/sys/wl_cfg80211_hybrid.c @@ -790,6 +790,7 @@ wl_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme) @@ -70,10 +83,10 @@ index 3ab084f..471d11f 100644 #define WL_IW_GET_RSSI (SIOCIWFIRSTPRIV+3) #define WL_IW_SET_PASSIVE_SCAN (SIOCIWFIRSTPRIV+5) diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c -index d13fb98..97ae2a6 100644 +index 25c4706..4c7e238 100644 --- a/src/wl/sys/wl_linux.c +++ b/src/wl/sys/wl_linux.c -@@ -797,14 +797,15 @@ wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) +@@ -791,14 +791,15 @@ wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) pci_read_config_dword(pdev, 0x40, &val); if ((val & 0x0000ff00) != 0) pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); @@ -97,3 +110,6 @@ index d13fb98..97ae2a6 100644 wl = wl_attach(pdev->vendor, pdev->device, pci_resource_start(pdev, 0), PCI_BUS, pdev, pdev->irq, bar1_addr, bar1_size); +-- +2.45.1 + From 5d78a89291f2dc45f26776ed4d74e31b5106f6b9 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Wed, 19 Jun 2024 16:25:22 -0700 Subject: [PATCH 3/3] linuxPackages.broadcom_sta: amend a patch that introduced a local copy of eth_hw_addr_set; it is no longer needed These derivations now successfully build: * `linuxKernel.packages.linux_4_19.broadcom_sta` * `linuxKernel.packages.linux_4_19_hardened.broadcom_sta` * `linuxKernel.packages.linux_5_10.broadcom_sta` * `linuxKernel.packages.linux_5_10_hardened.broadcom_sta` * `linuxKernel.packages.linux_5_15.broadcom_sta` * `linuxKernel.packages.linux_5_15_hardened.broadcom_sta` * `linuxKernel.packages.linux_5_4.broadcom_sta` * `linuxKernel.packages.linux_5_4_hardened.broadcom_sta` * `linuxKernel.packages.linux_6_1.broadcom_sta` * `linuxKernel.packages.linux_6_1_hardened.broadcom_sta` * `linuxKernel.packages.linux_6_6.broadcom_sta` * `linuxKernel.packages.linux_6_8.broadcom_sta` * `linuxKernel.packages.linux_6_8_hardened.broadcom_sta` * `linuxKernel.packages.linux_6_9.broadcom_sta` * `linuxKernel.packages.linux_6_9_hardened.broadcom_sta` * `linuxKernel.packages.linux_hardened.broadcom_sta` * `linuxKernel.packages.linux_latest_libre.broadcom_sta` * `linuxKernel.packages.linux_libre.broadcom_sta` * `linuxKernel.packages.linux_lqx.broadcom_sta` * `linuxKernel.packages.linux_xanmod.broadcom_sta` * `linuxKernel.packages.linux_xanmod_latest.broadcom_sta` * `linuxKernel.packages.linux_zen.broadcom_sta` As I do not have hardware to test this driver out, building will have to do as far as testing is concerned. --- .../linux/broadcom-sta/linux-5.17.patch | 33 +++++++------------ 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/pkgs/os-specific/linux/broadcom-sta/linux-5.17.patch b/pkgs/os-specific/linux/broadcom-sta/linux-5.17.patch index 6f23316691c8..6299ec752e67 100644 --- a/pkgs/os-specific/linux/broadcom-sta/linux-5.17.patch +++ b/pkgs/os-specific/linux/broadcom-sta/linux-5.17.patch @@ -1,7 +1,9 @@ -From 31b7849092c43805c7fbaf7518b99874aa1b310c Mon Sep 17 00:00:00 2001 +From a5e450dcdc7bc4ce06379189c3577f8c7a36fbde Mon Sep 17 00:00:00 2001 From: Joan Bruguera Date: Wed, 12 Jan 2022 20:49:20 +0100 -Subject: [PATCH] Tentative fix for broadcom-wl 6.30.223.271 driver for Linux 5.17-rc1 +Subject: [PATCH 12/16] linuxPackages.broadcom_sta: fix build for kernel 5.17+ + +Tentative fix for broadcom-wl 6.30.223.271 driver for Linux 5.17-rc1 Set netdev->dev_addr through dev_addr_mod + PDE_DATA fix @@ -17,11 +19,11 @@ Applies on top of all the patches applied to broadcom-wl-dkms 6.30.223.271-28 on See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=adeef3e32146a8d2a73c399dc6f5d76a449131b1 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=359745d78351c6f5442435f81549f0207ece28aa --- - src/wl/sys/wl_linux.c | 16 +++++++++++++--- - 1 file changed, 13 insertions(+), 3 deletions(-) + src/wl/sys/wl_linux.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c -index e491df7..e4614fb 100644 +index 26ba9fa..25c4706 100644 --- a/src/wl/sys/wl_linux.c +++ b/src/wl/sys/wl_linux.c @@ -93,6 +93,10 @@ struct iw_statistics *wl_get_wireless_stats(struct net_device *dev); @@ -35,20 +37,7 @@ index e491df7..e4614fb 100644 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) static void wl_timer(struct timer_list *tl); #else -@@ -490,6 +494,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) -@@ -634,7 +644,7 @@ wl_attach(uint16 vendor, uint16 device, ulong regs, +@@ -646,7 +650,7 @@ wl_attach(uint16 vendor, uint16 device, ulong regs, WL_ERROR(("wl%d: Error setting MAC ADDRESS\n", unit)); } #endif @@ -57,7 +46,7 @@ index e491df7..e4614fb 100644 online_cpus = 1; -@@ -1835,7 +1845,7 @@ wl_set_mac_address(struct net_device *dev, void *addr) +@@ -1852,7 +1856,7 @@ wl_set_mac_address(struct net_device *dev, void *addr) WL_LOCK(wl); @@ -66,7 +55,7 @@ index e491df7..e4614fb 100644 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); -@@ -3010,7 +3020,7 @@ _wl_add_monitor_if(wl_task_t *task) +@@ -3033,7 +3037,7 @@ _wl_add_monitor_if(wl_task_t *task) else dev->type = ARPHRD_IEEE80211_RADIOTAP; @@ -76,5 +65,5 @@ index e491df7..e4614fb 100644 #if defined(WL_USE_NETDEV_OPS) dev->netdev_ops = &wl_netdev_monitor_ops; -- -2.35.1 +2.45.1