Unverified Commit 5d78a892 authored by Philip Taron's avatar Philip Taron
Browse files

linuxPackages.broadcom_sta: amend a patch that introduced a local copy of...

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.
parent d4854eb6
Loading
Loading
Loading
Loading
+11 −22
Original line number Diff line number Diff line
From 31b7849092c43805c7fbaf7518b99874aa1b310c Mon Sep 17 00:00:00 2001
From a5e450dcdc7bc4ce06379189c3577f8c7a36fbde Mon Sep 17 00:00:00 2001
From: Joan Bruguera <joanbrugueram@gmail.com>
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