# HG changeset patch # User Stanislas Leduc # Date 1709571441 0 # Node ID 91035b7cc26493056eb14176408ac7edb9d2d99a # Parent d1dd7ab934428b19ae98c64d6d9b4e812e979db9 Up broadcom-wl drivers, add miss driver for mesa-dri (iris, crocus, virtio) diff -r d1dd7ab93442 -r 91035b7cc264 broadcom-wl-pae/receipt --- a/broadcom-wl-pae/receipt Sun Mar 03 17:58:42 2024 +0000 +++ b/broadcom-wl-pae/receipt Mon Mar 04 16:57:21 2024 +0000 @@ -37,6 +37,9 @@ 008-linux415.patch 009-fix_mac_profile_discrepancy.patch 014-linux414.patch +016-linux51.patch +017-linux56.patch +018-linux59.patch EOT KBUILD_NOPEDANTIC=1 make -C /usr/src/linux M=`pwd` diff -r d1dd7ab93442 -r 91035b7cc264 broadcom-wl-pae/stuff/017-linux56.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/broadcom-wl-pae/stuff/017-linux56.patch Mon Mar 04 16:57:21 2024 +0000 @@ -0,0 +1,55 @@ +diff --git a/src/shared/linux_osl.c b/src/shared/linux_osl.c +index 6157d18..8237ec7 100644 +--- a/src/shared/linux_osl.c ++++ b/src/shared/linux_osl.c +@@ -942,7 +942,7 @@ osl_getcycles(void) + void * + osl_reg_map(uint32 pa, uint size) + { +- return (ioremap_nocache((unsigned long)pa, (unsigned long)size)); ++ return (ioremap((unsigned long)pa, (unsigned long)size)); + } + + void +diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c +index 0d05100..2ed1f0d 100644 +--- a/src/wl/sys/wl_linux.c ++++ b/src/wl/sys/wl_linux.c +@@ -582,7 +582,7 @@ wl_attach(uint16 vendor, uint16 device, ulong regs, + } + wl->bcm_bustype = bustype; + +- if ((wl->regsva = ioremap_nocache(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) { ++ if ((wl->regsva = ioremap(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) { + 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) + if ((val & 0x0000ff00) != 0) + pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); + bar1_size = pci_resource_len(pdev, 2); +- bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2), ++ bar1_addr = (uchar *)ioremap(pci_resource_start(pdev, 2), + 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 + } + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) ++static struct proc_ops wl_fops = { ++ .proc_read = wl_proc_read, ++ .proc_write = wl_proc_write, ++}; ++#else + static const struct file_operations wl_fops = { + .owner = THIS_MODULE, + .read = wl_proc_read, + .write = wl_proc_write, + }; + #endif ++#endif + + static int + wl_reg_proc_entry(wl_info_t *wl) diff -r d1dd7ab93442 -r 91035b7cc264 broadcom-wl-pae/stuff/018-linux59.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/broadcom-wl-pae/stuff/018-linux59.patch Mon Mar 04 16:57:21 2024 +0000 @@ -0,0 +1,211 @@ +From f3d652840f8dd959395065a1cf67ca40b04ec69b Mon Sep 17 00:00:00 2001 +From: Joan Bruguera +Date: Tue, 13 Oct 2020 19:35:55 +0200 +Subject: [PATCH] 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 | 25 ++------------------- + 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(+), 51 deletions(-) + +diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c +index 7b606e0..1e0adb7 100644 +--- a/src/wl/sys/wl_cfg80211_hybrid.c ++++ b/src/wl/sys/wl_cfg80211_hybrid.c +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + + #define EVENT_TYPE(e) dtoh32((e)->event_type) + #define EVENT_FLAGS(e) dtoh16((e)->flags) +@@ -435,30 +436,7 @@ static void key_endian_to_host(struct wl_wsec_key *key) + static s32 + wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len) + { +- struct ifreq ifr; +- struct wl_ioctl ioc; +- mm_segment_t fs; +- s32 err = 0; +- +- BUG_ON(len < sizeof(int)); +- +- memset(&ioc, 0, sizeof(ioc)); +- ioc.cmd = cmd; +- ioc.buf = arg; +- ioc.len = len; +- strcpy(ifr.ifr_name, dev->name); +- ifr.ifr_data = (caddr_t)&ioc; +- +- fs = get_fs(); +- set_fs(get_ds()); +-#if defined(WL_USE_NETDEV_OPS) +- err = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#else +- err = dev->do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#endif +- set_fs(fs); +- +- return err; ++ return wlc_ioctl_internal(dev, cmd, arg, len); + } + + static s32 +diff --git a/src/wl/sys/wl_iw.c b/src/wl/sys/wl_iw.c +index c4c610b..e346b15 100644 +--- a/src/wl/sys/wl_iw.c ++++ b/src/wl/sys/wl_iw.c +@@ -37,6 +37,7 @@ typedef const struct si_pub si_t; + + #include + #include ++#include + + extern bool wl_iw_conn_status_str(uint32 event_type, uint32 status, + uint32 reason, char* stringBuf, uint buflen); +@@ -103,29 +104,7 @@ dev_wlc_ioctl( + int len + ) + { +- struct ifreq ifr; +- wl_ioctl_t ioc; +- mm_segment_t fs; +- int ret; +- +- memset(&ioc, 0, sizeof(ioc)); +- ioc.cmd = cmd; +- ioc.buf = arg; +- ioc.len = len; +- +- strcpy(ifr.ifr_name, dev->name); +- ifr.ifr_data = (caddr_t) &ioc; +- +- fs = get_fs(); +- set_fs(get_ds()); +-#if defined(WL_USE_NETDEV_OPS) +- ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#else +- ret = dev->do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#endif +- set_fs(fs); +- +- return ret; ++ return wlc_ioctl_internal(dev, cmd, arg, len); + } + + static int +diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c +index 947cef3..f04c148 100644 +--- a/src/wl/sys/wl_linux.c ++++ b/src/wl/sys/wl_linux.c +@@ -1643,10 +1643,7 @@ wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) + goto done2; + } + +- if (segment_eq(get_fs(), KERNEL_DS)) +- buf = ioc.buf; +- +- else if (ioc.buf) { ++ if (ioc.buf) { + if (!(buf = (void *) MALLOC(wl->osh, MAX(ioc.len, WLC_IOCTL_MAXLEN)))) { + bcmerror = BCME_NORESOURCE; + goto done2; +@@ -1667,7 +1664,7 @@ wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) + WL_UNLOCK(wl); + + done1: +- if (ioc.buf && (ioc.buf != buf)) { ++ if (ioc.buf) { + if (copy_to_user(ioc.buf, buf, ioc.len)) + bcmerror = BCME_BADADDR; + MFREE(wl->osh, buf, MAX(ioc.len, WLC_IOCTL_MAXLEN)); +@@ -1680,6 +1677,39 @@ done2: + return (OSL_ERROR(bcmerror)); + } + ++int ++wlc_ioctl_internal(struct net_device *dev, int cmd, void *buf, int len) ++{ ++ wl_info_t *wl; ++ wl_if_t *wlif; ++ int bcmerror; ++ ++ if (!dev) ++ return -ENETDOWN; ++ ++ wl = WL_INFO(dev); ++ wlif = WL_DEV_IF(dev); ++ if (wlif == NULL || wl == NULL || wl->dev == NULL) ++ return -ENETDOWN; ++ ++ bcmerror = 0; ++ ++ WL_TRACE(("wl%d: wlc_ioctl_internal: cmd 0x%x\n", wl->pub->unit, cmd)); ++ ++ WL_LOCK(wl); ++ if (!capable(CAP_NET_ADMIN)) { ++ bcmerror = BCME_EPERM; ++ } else { ++ bcmerror = wlc_ioctl(wl->wlc, cmd, buf, len, wlif->wlcif); ++ } ++ WL_UNLOCK(wl); ++ ++ ASSERT(VALID_BCMERROR(bcmerror)); ++ if (bcmerror != 0) ++ wl->pub->bcmerror = bcmerror; ++ return (OSL_ERROR(bcmerror)); ++} ++ + static struct net_device_stats* + wl_get_stats(struct net_device *dev) + { +diff --git a/src/wl/sys/wl_linux.h b/src/wl/sys/wl_linux.h +index 5b1048e..c8c1f41 100644 +--- a/src/wl/sys/wl_linux.h ++++ b/src/wl/sys/wl_linux.h +@@ -22,6 +22,7 @@ + #define _wl_linux_h_ + + #include ++#include + + typedef struct wl_timer { + struct timer_list timer; +@@ -187,6 +188,7 @@ extern irqreturn_t wl_isr(int irq, void *dev_id, struct pt_regs *ptregs); + extern int __devinit wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent); + extern void wl_free(wl_info_t *wl); + extern int wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); ++extern int wlc_ioctl_internal(struct net_device *dev, int cmd, void *buf, int len); + extern struct net_device * wl_netdev_get(wl_info_t *wl); + + #endif +diff --git a/src/wl/sys/wlc_pub.h b/src/wl/sys/wlc_pub.h +index 53a98b8..2b5a029 100644 +--- a/src/wl/sys/wlc_pub.h ++++ b/src/wl/sys/wlc_pub.h +@@ -24,6 +24,7 @@ + + #include + #include ++#include + #include "proto/802.11.h" + #include "proto/bcmevent.h" + +-- +2.28.0 diff -r d1dd7ab93442 -r 91035b7cc264 broadcom-wl/receipt --- a/broadcom-wl/receipt Sun Mar 03 17:58:42 2024 +0000 +++ b/broadcom-wl/receipt Mon Mar 04 16:57:21 2024 +0000 @@ -36,6 +36,9 @@ 008-linux415.patch 009-fix_mac_profile_discrepancy.patch 014-linux414.patch +016-linux51.patch +017-linux56.patch +018-linux59.patch EOT KBUILD_NOPEDANTIC=1 make -C /usr/src/linux M=`pwd` diff -r d1dd7ab93442 -r 91035b7cc264 broadcom-wl/stuff/017-linux56.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/broadcom-wl/stuff/017-linux56.patch Mon Mar 04 16:57:21 2024 +0000 @@ -0,0 +1,55 @@ +diff --git a/src/shared/linux_osl.c b/src/shared/linux_osl.c +index 6157d18..8237ec7 100644 +--- a/src/shared/linux_osl.c ++++ b/src/shared/linux_osl.c +@@ -942,7 +942,7 @@ osl_getcycles(void) + void * + osl_reg_map(uint32 pa, uint size) + { +- return (ioremap_nocache((unsigned long)pa, (unsigned long)size)); ++ return (ioremap((unsigned long)pa, (unsigned long)size)); + } + + void +diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c +index 0d05100..2ed1f0d 100644 +--- a/src/wl/sys/wl_linux.c ++++ b/src/wl/sys/wl_linux.c +@@ -582,7 +582,7 @@ wl_attach(uint16 vendor, uint16 device, ulong regs, + } + wl->bcm_bustype = bustype; + +- if ((wl->regsva = ioremap_nocache(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) { ++ if ((wl->regsva = ioremap(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) { + 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) + if ((val & 0x0000ff00) != 0) + pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); + bar1_size = pci_resource_len(pdev, 2); +- bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2), ++ bar1_addr = (uchar *)ioremap(pci_resource_start(pdev, 2), + 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 + } + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) ++static struct proc_ops wl_fops = { ++ .proc_read = wl_proc_read, ++ .proc_write = wl_proc_write, ++}; ++#else + static const struct file_operations wl_fops = { + .owner = THIS_MODULE, + .read = wl_proc_read, + .write = wl_proc_write, + }; + #endif ++#endif + + static int + wl_reg_proc_entry(wl_info_t *wl) diff -r d1dd7ab93442 -r 91035b7cc264 broadcom-wl/stuff/018-linux59.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/broadcom-wl/stuff/018-linux59.patch Mon Mar 04 16:57:21 2024 +0000 @@ -0,0 +1,211 @@ +From f3d652840f8dd959395065a1cf67ca40b04ec69b Mon Sep 17 00:00:00 2001 +From: Joan Bruguera +Date: Tue, 13 Oct 2020 19:35:55 +0200 +Subject: [PATCH] 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 | 25 ++------------------- + 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(+), 51 deletions(-) + +diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c +index 7b606e0..1e0adb7 100644 +--- a/src/wl/sys/wl_cfg80211_hybrid.c ++++ b/src/wl/sys/wl_cfg80211_hybrid.c +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + + #define EVENT_TYPE(e) dtoh32((e)->event_type) + #define EVENT_FLAGS(e) dtoh16((e)->flags) +@@ -435,30 +436,7 @@ static void key_endian_to_host(struct wl_wsec_key *key) + static s32 + wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len) + { +- struct ifreq ifr; +- struct wl_ioctl ioc; +- mm_segment_t fs; +- s32 err = 0; +- +- BUG_ON(len < sizeof(int)); +- +- memset(&ioc, 0, sizeof(ioc)); +- ioc.cmd = cmd; +- ioc.buf = arg; +- ioc.len = len; +- strcpy(ifr.ifr_name, dev->name); +- ifr.ifr_data = (caddr_t)&ioc; +- +- fs = get_fs(); +- set_fs(get_ds()); +-#if defined(WL_USE_NETDEV_OPS) +- err = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#else +- err = dev->do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#endif +- set_fs(fs); +- +- return err; ++ return wlc_ioctl_internal(dev, cmd, arg, len); + } + + static s32 +diff --git a/src/wl/sys/wl_iw.c b/src/wl/sys/wl_iw.c +index c4c610b..e346b15 100644 +--- a/src/wl/sys/wl_iw.c ++++ b/src/wl/sys/wl_iw.c +@@ -37,6 +37,7 @@ typedef const struct si_pub si_t; + + #include + #include ++#include + + extern bool wl_iw_conn_status_str(uint32 event_type, uint32 status, + uint32 reason, char* stringBuf, uint buflen); +@@ -103,29 +104,7 @@ dev_wlc_ioctl( + int len + ) + { +- struct ifreq ifr; +- wl_ioctl_t ioc; +- mm_segment_t fs; +- int ret; +- +- memset(&ioc, 0, sizeof(ioc)); +- ioc.cmd = cmd; +- ioc.buf = arg; +- ioc.len = len; +- +- strcpy(ifr.ifr_name, dev->name); +- ifr.ifr_data = (caddr_t) &ioc; +- +- fs = get_fs(); +- set_fs(get_ds()); +-#if defined(WL_USE_NETDEV_OPS) +- ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#else +- ret = dev->do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#endif +- set_fs(fs); +- +- return ret; ++ return wlc_ioctl_internal(dev, cmd, arg, len); + } + + static int +diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c +index 947cef3..f04c148 100644 +--- a/src/wl/sys/wl_linux.c ++++ b/src/wl/sys/wl_linux.c +@@ -1643,10 +1643,7 @@ wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) + goto done2; + } + +- if (segment_eq(get_fs(), KERNEL_DS)) +- buf = ioc.buf; +- +- else if (ioc.buf) { ++ if (ioc.buf) { + if (!(buf = (void *) MALLOC(wl->osh, MAX(ioc.len, WLC_IOCTL_MAXLEN)))) { + bcmerror = BCME_NORESOURCE; + goto done2; +@@ -1667,7 +1664,7 @@ wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) + WL_UNLOCK(wl); + + done1: +- if (ioc.buf && (ioc.buf != buf)) { ++ if (ioc.buf) { + if (copy_to_user(ioc.buf, buf, ioc.len)) + bcmerror = BCME_BADADDR; + MFREE(wl->osh, buf, MAX(ioc.len, WLC_IOCTL_MAXLEN)); +@@ -1680,6 +1677,39 @@ done2: + return (OSL_ERROR(bcmerror)); + } + ++int ++wlc_ioctl_internal(struct net_device *dev, int cmd, void *buf, int len) ++{ ++ wl_info_t *wl; ++ wl_if_t *wlif; ++ int bcmerror; ++ ++ if (!dev) ++ return -ENETDOWN; ++ ++ wl = WL_INFO(dev); ++ wlif = WL_DEV_IF(dev); ++ if (wlif == NULL || wl == NULL || wl->dev == NULL) ++ return -ENETDOWN; ++ ++ bcmerror = 0; ++ ++ WL_TRACE(("wl%d: wlc_ioctl_internal: cmd 0x%x\n", wl->pub->unit, cmd)); ++ ++ WL_LOCK(wl); ++ if (!capable(CAP_NET_ADMIN)) { ++ bcmerror = BCME_EPERM; ++ } else { ++ bcmerror = wlc_ioctl(wl->wlc, cmd, buf, len, wlif->wlcif); ++ } ++ WL_UNLOCK(wl); ++ ++ ASSERT(VALID_BCMERROR(bcmerror)); ++ if (bcmerror != 0) ++ wl->pub->bcmerror = bcmerror; ++ return (OSL_ERROR(bcmerror)); ++} ++ + static struct net_device_stats* + wl_get_stats(struct net_device *dev) + { +diff --git a/src/wl/sys/wl_linux.h b/src/wl/sys/wl_linux.h +index 5b1048e..c8c1f41 100644 +--- a/src/wl/sys/wl_linux.h ++++ b/src/wl/sys/wl_linux.h +@@ -22,6 +22,7 @@ + #define _wl_linux_h_ + + #include ++#include + + typedef struct wl_timer { + struct timer_list timer; +@@ -187,6 +188,7 @@ extern irqreturn_t wl_isr(int irq, void *dev_id, struct pt_regs *ptregs); + extern int __devinit wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent); + extern void wl_free(wl_info_t *wl); + extern int wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); ++extern int wlc_ioctl_internal(struct net_device *dev, int cmd, void *buf, int len); + extern struct net_device * wl_netdev_get(wl_info_t *wl); + + #endif +diff --git a/src/wl/sys/wlc_pub.h b/src/wl/sys/wlc_pub.h +index 53a98b8..2b5a029 100644 +--- a/src/wl/sys/wlc_pub.h ++++ b/src/wl/sys/wlc_pub.h +@@ -24,6 +24,7 @@ + + #include + #include ++#include + #include "proto/802.11.h" + #include "proto/bcmevent.h" + +-- +2.28.0 diff -r d1dd7ab93442 -r 91035b7cc264 broadcom-wl64/receipt --- a/broadcom-wl64/receipt Sun Mar 03 17:58:42 2024 +0000 +++ b/broadcom-wl64/receipt Mon Mar 04 16:57:21 2024 +0000 @@ -13,7 +13,8 @@ PROVIDE="broadcom-wl:linux64" DEPENDS="linux64" -BUILD_DEPENDS="linux64-module-headers xz" +BUILD_DEPENDS="git xz sysfsutils-dev findutils diffutils \ +libtool kmod bc elfutils-dev openssl-dev" # Rules to configure and make the package. compile_rules() @@ -37,13 +38,24 @@ 008-linux415.patch 009-fix_mac_profile_discrepancy.patch 014-linux414.patch +017-linux56.patch +018-linux59.patch EOT # Use cross toolchain x86_64 export PATH=$PATH:/cross/x86_64/tools/bin + # linux64-module-headers seem not enought for build module + # Use linux kernel source and modules_prepare + tar xf $SRC/linux-$kvers.tar.xz + cd linux-$kvers + cp $WOK/linux/stuff/linux-slitaz.config64 .config + make ARCH=x86_64 CROSS_COMPILE=x86_64-slitaz-linux- modules_prepare + cp $WOK/linux/install/linux64/usr/src/linux-$kvers-slitaz64/Module.symvers . + cd - + KBUILD_NOPEDANTIC=1 make ARCH=x86_64 CROSS_COMPILE=x86_64-slitaz-linux- \ - -C /usr/src/linux M=`pwd` + -C ./linux-$kvers M=`pwd` xz wl.ko } diff -r d1dd7ab93442 -r 91035b7cc264 broadcom-wl64/stuff/017-linux56.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/broadcom-wl64/stuff/017-linux56.patch Mon Mar 04 16:57:21 2024 +0000 @@ -0,0 +1,55 @@ +diff --git a/src/shared/linux_osl.c b/src/shared/linux_osl.c +index 6157d18..8237ec7 100644 +--- a/src/shared/linux_osl.c ++++ b/src/shared/linux_osl.c +@@ -942,7 +942,7 @@ osl_getcycles(void) + void * + osl_reg_map(uint32 pa, uint size) + { +- return (ioremap_nocache((unsigned long)pa, (unsigned long)size)); ++ return (ioremap((unsigned long)pa, (unsigned long)size)); + } + + void +diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c +index 0d05100..2ed1f0d 100644 +--- a/src/wl/sys/wl_linux.c ++++ b/src/wl/sys/wl_linux.c +@@ -582,7 +582,7 @@ wl_attach(uint16 vendor, uint16 device, ulong regs, + } + wl->bcm_bustype = bustype; + +- if ((wl->regsva = ioremap_nocache(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) { ++ if ((wl->regsva = ioremap(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) { + 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) + if ((val & 0x0000ff00) != 0) + pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); + bar1_size = pci_resource_len(pdev, 2); +- bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2), ++ bar1_addr = (uchar *)ioremap(pci_resource_start(pdev, 2), + 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 + } + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) ++static struct proc_ops wl_fops = { ++ .proc_read = wl_proc_read, ++ .proc_write = wl_proc_write, ++}; ++#else + static const struct file_operations wl_fops = { + .owner = THIS_MODULE, + .read = wl_proc_read, + .write = wl_proc_write, + }; + #endif ++#endif + + static int + wl_reg_proc_entry(wl_info_t *wl) diff -r d1dd7ab93442 -r 91035b7cc264 broadcom-wl64/stuff/018-linux59.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/broadcom-wl64/stuff/018-linux59.patch Mon Mar 04 16:57:21 2024 +0000 @@ -0,0 +1,211 @@ +From f3d652840f8dd959395065a1cf67ca40b04ec69b Mon Sep 17 00:00:00 2001 +From: Joan Bruguera +Date: Tue, 13 Oct 2020 19:35:55 +0200 +Subject: [PATCH] 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 | 25 ++------------------- + 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(+), 51 deletions(-) + +diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c +index 7b606e0..1e0adb7 100644 +--- a/src/wl/sys/wl_cfg80211_hybrid.c ++++ b/src/wl/sys/wl_cfg80211_hybrid.c +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + + #define EVENT_TYPE(e) dtoh32((e)->event_type) + #define EVENT_FLAGS(e) dtoh16((e)->flags) +@@ -435,30 +436,7 @@ static void key_endian_to_host(struct wl_wsec_key *key) + static s32 + wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len) + { +- struct ifreq ifr; +- struct wl_ioctl ioc; +- mm_segment_t fs; +- s32 err = 0; +- +- BUG_ON(len < sizeof(int)); +- +- memset(&ioc, 0, sizeof(ioc)); +- ioc.cmd = cmd; +- ioc.buf = arg; +- ioc.len = len; +- strcpy(ifr.ifr_name, dev->name); +- ifr.ifr_data = (caddr_t)&ioc; +- +- fs = get_fs(); +- set_fs(get_ds()); +-#if defined(WL_USE_NETDEV_OPS) +- err = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#else +- err = dev->do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#endif +- set_fs(fs); +- +- return err; ++ return wlc_ioctl_internal(dev, cmd, arg, len); + } + + static s32 +diff --git a/src/wl/sys/wl_iw.c b/src/wl/sys/wl_iw.c +index c4c610b..e346b15 100644 +--- a/src/wl/sys/wl_iw.c ++++ b/src/wl/sys/wl_iw.c +@@ -37,6 +37,7 @@ typedef const struct si_pub si_t; + + #include + #include ++#include + + extern bool wl_iw_conn_status_str(uint32 event_type, uint32 status, + uint32 reason, char* stringBuf, uint buflen); +@@ -103,29 +104,7 @@ dev_wlc_ioctl( + int len + ) + { +- struct ifreq ifr; +- wl_ioctl_t ioc; +- mm_segment_t fs; +- int ret; +- +- memset(&ioc, 0, sizeof(ioc)); +- ioc.cmd = cmd; +- ioc.buf = arg; +- ioc.len = len; +- +- strcpy(ifr.ifr_name, dev->name); +- ifr.ifr_data = (caddr_t) &ioc; +- +- fs = get_fs(); +- set_fs(get_ds()); +-#if defined(WL_USE_NETDEV_OPS) +- ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#else +- ret = dev->do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#endif +- set_fs(fs); +- +- return ret; ++ return wlc_ioctl_internal(dev, cmd, arg, len); + } + + static int +diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c +index 947cef3..f04c148 100644 +--- a/src/wl/sys/wl_linux.c ++++ b/src/wl/sys/wl_linux.c +@@ -1643,10 +1643,7 @@ wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) + goto done2; + } + +- if (segment_eq(get_fs(), KERNEL_DS)) +- buf = ioc.buf; +- +- else if (ioc.buf) { ++ if (ioc.buf) { + if (!(buf = (void *) MALLOC(wl->osh, MAX(ioc.len, WLC_IOCTL_MAXLEN)))) { + bcmerror = BCME_NORESOURCE; + goto done2; +@@ -1667,7 +1664,7 @@ wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) + WL_UNLOCK(wl); + + done1: +- if (ioc.buf && (ioc.buf != buf)) { ++ if (ioc.buf) { + if (copy_to_user(ioc.buf, buf, ioc.len)) + bcmerror = BCME_BADADDR; + MFREE(wl->osh, buf, MAX(ioc.len, WLC_IOCTL_MAXLEN)); +@@ -1680,6 +1677,39 @@ done2: + return (OSL_ERROR(bcmerror)); + } + ++int ++wlc_ioctl_internal(struct net_device *dev, int cmd, void *buf, int len) ++{ ++ wl_info_t *wl; ++ wl_if_t *wlif; ++ int bcmerror; ++ ++ if (!dev) ++ return -ENETDOWN; ++ ++ wl = WL_INFO(dev); ++ wlif = WL_DEV_IF(dev); ++ if (wlif == NULL || wl == NULL || wl->dev == NULL) ++ return -ENETDOWN; ++ ++ bcmerror = 0; ++ ++ WL_TRACE(("wl%d: wlc_ioctl_internal: cmd 0x%x\n", wl->pub->unit, cmd)); ++ ++ WL_LOCK(wl); ++ if (!capable(CAP_NET_ADMIN)) { ++ bcmerror = BCME_EPERM; ++ } else { ++ bcmerror = wlc_ioctl(wl->wlc, cmd, buf, len, wlif->wlcif); ++ } ++ WL_UNLOCK(wl); ++ ++ ASSERT(VALID_BCMERROR(bcmerror)); ++ if (bcmerror != 0) ++ wl->pub->bcmerror = bcmerror; ++ return (OSL_ERROR(bcmerror)); ++} ++ + static struct net_device_stats* + wl_get_stats(struct net_device *dev) + { +diff --git a/src/wl/sys/wl_linux.h b/src/wl/sys/wl_linux.h +index 5b1048e..c8c1f41 100644 +--- a/src/wl/sys/wl_linux.h ++++ b/src/wl/sys/wl_linux.h +@@ -22,6 +22,7 @@ + #define _wl_linux_h_ + + #include ++#include + + typedef struct wl_timer { + struct timer_list timer; +@@ -187,6 +188,7 @@ extern irqreturn_t wl_isr(int irq, void *dev_id, struct pt_regs *ptregs); + extern int __devinit wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent); + extern void wl_free(wl_info_t *wl); + extern int wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); ++extern int wlc_ioctl_internal(struct net_device *dev, int cmd, void *buf, int len); + extern struct net_device * wl_netdev_get(wl_info_t *wl); + + #endif +diff --git a/src/wl/sys/wlc_pub.h b/src/wl/sys/wlc_pub.h +index 53a98b8..2b5a029 100644 +--- a/src/wl/sys/wlc_pub.h ++++ b/src/wl/sys/wlc_pub.h +@@ -24,6 +24,7 @@ + + #include + #include ++#include + #include "proto/802.11.h" + #include "proto/bcmevent.h" + +-- +2.28.0 diff -r d1dd7ab93442 -r 91035b7cc264 mesa-dri-crocus/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mesa-dri-crocus/receipt Mon Mar 04 16:57:21 2024 +0000 @@ -0,0 +1,19 @@ +# SliTaz package receipt. + +PACKAGE="mesa-dri-crocus" +VERSION="21.3.5" +CATEGORY="x-window" +SHORT_DESC="Mesa DRI drivers for Intel Crocus." +MAINTAINER="pascal.bellard@slitaz.org" +LICENSE="MIT" +WEB_SITE="https://www.mesa3d.org/" + +DEPENDS="libdrm-intel mesa mesa-dri" +WANTED="mesa" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/lib/dri + cp $install/usr/lib/dri/crocus_dri.so $fs/usr/lib/dri +} diff -r d1dd7ab93442 -r 91035b7cc264 mesa-dri-iris/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mesa-dri-iris/receipt Mon Mar 04 16:57:21 2024 +0000 @@ -0,0 +1,19 @@ +# SliTaz package receipt. + +PACKAGE="mesa-dri-iris" +VERSION="21.3.5" +CATEGORY="x-window" +SHORT_DESC="Mesa DRI drivers for Intel Iris." +MAINTAINER="pascal.bellard@slitaz.org" +LICENSE="MIT" +WEB_SITE="https://www.mesa3d.org/" + +DEPENDS="libdrm-intel mesa mesa-dri" +WANTED="mesa" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/lib/dri + cp $install/usr/lib/dri/iris_dri.so $fs/usr/lib/dri +} diff -r d1dd7ab93442 -r 91035b7cc264 mesa-dri-nouveau/receipt --- a/mesa-dri-nouveau/receipt Sun Mar 03 17:58:42 2024 +0000 +++ b/mesa-dri-nouveau/receipt Mon Mar 04 16:57:21 2024 +0000 @@ -17,7 +17,7 @@ mkdir -p $fs/usr/lib/dri mkdir -p $fs/etc/X11/xorg.conf.d - cp $install/usr/lib/dri/nouveau_vieux_dri.so $fs/usr/lib/dri + cp $install/usr/lib/dri/nouveau*_dri.so $fs/usr/lib/dri cat > $fs/etc/X11/xorg.conf.d/90-DRI.conf <