diff options
author | PÁLI Gábor János <pali.gabor@gmail.com> | 2023-07-27 11:05:17 +0200 |
---|---|---|
committer | PÁLI Gábor János <pali.gabor@gmail.com> | 2023-07-27 11:05:17 +0200 |
commit | 084335e136581edc28137b152cc559778224570e (patch) | |
tree | 269c2e37b0abd971aeccdc1291bc1c3ca9c96aed | |
parent | 1f7bcc1ae14273fce0b5d3dded52d599aa035433 (diff) | |
download | freebsd-wifibox-alpine-084335e136581edc28137b152cc559778224570e.zip |
Make Broadcom wireless cards work
- Import Arch Linux patches for the `broadcom-wl` driver and WPA Supplicant
- Implement support for Message Signaled Interrupts (MSI) to allow the card
to be used with PCI pass-through
References:
- https://gitlab.archlinux.org/archlinux/packaging/packages/broadcom-wl-dkms/
- https://gitlab.archlinux.org/archlinux/packaging/packages/wpa_supplicant/
Tested by: venoom27 <venoom27@fromgithub>
-rw-r--r-- | aports/broadcom-wl/007-linux412.patch | 52 | ||||
-rw-r--r-- | aports/broadcom-wl/009-fix_mac_profile_discrepancy.patch | 10 | ||||
-rw-r--r-- | aports/broadcom-wl/012-linux517.patch | 80 | ||||
-rw-r--r-- | aports/broadcom-wl/013-linux518.patch | 71 | ||||
-rw-r--r-- | aports/broadcom-wl/014-linux414.patch | 37 | ||||
-rw-r--r-- | aports/broadcom-wl/015-linux600.patch | 31 | ||||
-rw-r--r-- | aports/broadcom-wl/016-linux601.patch | 90 | ||||
-rw-r--r-- | aports/broadcom-wl/APKBUILD | 18 | ||||
-rw-r--r-- | aports/broadcom-wl/msi_support.patch | 79 | ||||
-rw-r--r-- | aports/wpa_supplicant/0001-nl80211-add-extra-ies-only-if-allowed-by-driver.patch | 69 | ||||
-rw-r--r-- | aports/wpa_supplicant/APKBUILD | 4 |
11 files changed, 513 insertions, 28 deletions
diff --git a/aports/broadcom-wl/007-linux412.patch b/aports/broadcom-wl/007-linux412.patch index 8abc73d..1673f06 100644 --- a/aports/broadcom-wl/007-linux412.patch +++ b/aports/broadcom-wl/007-linux412.patch @@ -1,43 +1,52 @@ +From 0b888bf115612074df99654140a1980111c29748 Mon Sep 17 00:00:00 2001 +From: Antoine Cotten <tonio.cotten@gmail.com> +Date: Fri, 7 Jul 2017 15:17:47 +0200 +Subject: [PATCH] Apply patch from Debian bug #867258 + +Compile fix with kernel 4.12 +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=867258 +--- + src/wl/sys/wl_cfg80211_hybrid.c | 29 +++++++++++++++++++++++++---- + 1 file changed, 25 insertions(+), 4 deletions(-) + diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c -index da36405..d3741eb 100644 +index c46944a..1a9840a 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; #endif static s32 wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) -+ enum nl80211_iftype type, struct vif_params *params); -+#else - enum nl80211_iftype type, u32 *flags, struct vif_params *params); +- enum nl80211_iftype type, u32 *flags, struct vif_params *params); ++ enum nl80211_iftype type, ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0) ++ u32 *flags, +#endif ++ struct vif_params *params); #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) static s32 wl_cfg80211_scan(struct wiphy *wiphy, -@@ -466,7 +470,11 @@ wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len) +@@ -466,8 +470,11 @@ wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len) static s32 wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) +- enum nl80211_iftype type, u32 *flags, +- struct vif_params *params) + enum nl80211_iftype type, -+#else - enum nl80211_iftype type, u32 *flags, ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0) ++ u32 *flags, +#endif - struct vif_params *params) ++ struct vif_params *params) { struct wl_cfg80211_priv *wl = wiphy_to_wl(wiphy); -@@ -2361,6 +2369,20 @@ wl_bss_roaming_done(struct wl_cfg80211_priv *wl, struct net_device *ndev, + struct wireless_dev *wdev; +@@ -2387,6 +2394,15 @@ wl_bss_roaming_done(struct wl_cfg80211_priv *wl, struct net_device *ndev, const wl_event_msg_t *e, void *data) { struct wl_cfg80211_connect_info *conn_info = wl_to_conn(wl); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) -+ struct cfg80211_bss *bss; -+ struct wlc_ssid *ssid; -+ ssid = &wl->profile->ssid; -+ 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 = { -+ .bss = bss, ++ .bssid = wl->profile->bssid, + .req_ie = conn_info->req_ie, + .req_ie_len = conn_info->req_ie_len, + .resp_ie = conn_info->resp_ie, @@ -46,10 +55,10 @@ index da36405..d3741eb 100644 +#endif s32 err = 0; - wl_get_assoc_ies(wl); -@@ -2368,12 +2390,17 @@ wl_bss_roaming_done(struct wl_cfg80211_priv *wl, struct net_device *ndev, - memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN); - wl_update_bss_info(wl); + err = wl_get_assoc_ies(wl); +@@ -2401,12 +2417,17 @@ wl_bss_roaming_done(struct wl_cfg80211_priv *wl, struct net_device *ndev, + return err; + cfg80211_roamed(ndev, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) + &roam_info, @@ -66,3 +75,4 @@ index da36405..d3741eb 100644 WL_DBG(("Report roaming result\n")); set_bit(WL_STATUS_CONNECTED, &wl->status); + diff --git a/aports/broadcom-wl/009-fix_mac_profile_discrepancy.patch b/aports/broadcom-wl/009-fix_mac_profile_discrepancy.patch index 022064d..4260eba 100644 --- a/aports/broadcom-wl/009-fix_mac_profile_discrepancy.patch +++ b/aports/broadcom-wl/009-fix_mac_profile_discrepancy.patch @@ -1,6 +1,8 @@ ---- a/src/wl/sys/wl_cfg80211_hybrid.c -+++ b/src/wl/sys/wl_cfg80211_hybrid.c -@@ -1446,7 +1446,6 @@ +--- a/src/wl/sys/wl_cfg80211_hybrid.c 2015-09-19 00:47:30.000000000 +0200 ++++ b/src/wl/sys/wl_cfg80211_hybrid.c 2018-11-14 14:06:03.313487995 +0100 +@@ -1444,11 +1444,10 @@ + s32 rate; + s32 err = 0; if (memcmp(mac, wl->profile->bssid, ETHER_ADDR_LEN)) { WL_ERR(("Wrong Mac address, mac = %pM profile =%pM\n", mac, wl->profile->bssid)); @@ -8,3 +10,5 @@ } err = wl_dev_ioctl(dev, WLC_GET_RATE, &rate, sizeof(rate)); + if (err) { + WL_DBG(("Could not get rate (%d)\n", err)); diff --git a/aports/broadcom-wl/012-linux517.patch b/aports/broadcom-wl/012-linux517.patch new file mode 100644 index 0000000..6f23316 --- /dev/null +++ b/aports/broadcom-wl/012-linux517.patch @@ -0,0 +1,80 @@ +From 31b7849092c43805c7fbaf7518b99874aa1b310c 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 + +Set netdev->dev_addr through dev_addr_mod + PDE_DATA fix + +Since Linux 5.17 netdev->dev_addr is const and must be changed through +dev_addr_mod, otherwise a warning is logged in dmesg and bad things may happen. + +NB: The #if is not wrong, dev_addr_mod is defined since Linux 5.15-rc1 + +Plus a trivial fix for PDE_DATA. + +Applies on top of all the patches applied to broadcom-wl-dkms 6.30.223.271-28 on Arch Linux. + +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(-) + +diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c +index e491df7..e4614fb 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); + + #include <wlc_wowl.h> + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)) ++#define PDE_DATA pde_data ++#endif ++ + #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) + static void wl_timer(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, + 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; + +@@ -1835,7 +1845,7 @@ wl_set_mac_address(struct net_device *dev, void *addr) + + 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); +@@ -3010,7 +3020,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; +-- +2.35.1 + diff --git a/aports/broadcom-wl/013-linux518.patch b/aports/broadcom-wl/013-linux518.patch new file mode 100644 index 0000000..d837429 --- /dev/null +++ b/aports/broadcom-wl/013-linux518.patch @@ -0,0 +1,71 @@ +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 @@ + va = kmalloc(size, GFP_ATOMIC | __GFP_ZERO); + if (va) + *pap = (ulong)__virt_to_phys(va); ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) ++ va = dma_alloc_coherent(&((struct pci_dev *)osh->pdev)->dev, size, (dma_addr_t*)pap, GFP_ATOMIC); + #else + va = pci_alloc_consistent(osh->pdev, size, (dma_addr_t*)pap); + #endif +@@ -612,6 +614,8 @@ + + #ifdef __ARM_ARCH_7A__ + kfree(va); ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) ++ dma_free_coherent(&((struct pci_dev *)osh->pdev)->dev, size, va, (dma_addr_t)pa); + #else + pci_free_consistent(osh->pdev, size, va, (dma_addr_t)pa); + #endif +@@ -623,7 +627,11 @@ + int dir; + + ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC))); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) ++ dir = (direction == DMA_TX)? DMA_TO_DEVICE: DMA_FROM_DEVICE; ++#else + dir = (direction == DMA_TX)? PCI_DMA_TODEVICE: PCI_DMA_FROMDEVICE; ++#endif + + #if defined(__ARM_ARCH_7A__) && defined(BCMDMASGLISTOSL) + if (dmah != NULL) { +@@ -641,7 +649,11 @@ + ASSERT(totsegs + nsegs <= MAX_DMA_SEGS); + sg->page_link = 0; + sg_set_buf(sg, PKTDATA(osh, skb), PKTLEN(osh, skb)); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) ++ dma_map_single(&((struct pci_dev *)osh->pdev)->dev, PKTDATA(osh, skb), PKTLEN(osh, skb), dir); ++#else + pci_map_single(osh->pdev, PKTDATA(osh, skb), PKTLEN(osh, skb), dir); ++#endif + } + totsegs += nsegs; + totlen += PKTLEN(osh, skb); +@@ -656,7 +668,11 @@ + } + #endif + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) ++ return (dma_map_single(&((struct pci_dev *)osh->pdev)->dev, va, size, dir)); ++#else + return (pci_map_single(osh->pdev, va, size, dir)); ++#endif + } + + void BCMFASTPATH +@@ -665,8 +681,13 @@ + int dir; + + ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC))); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) ++ dir = (direction == DMA_TX)? DMA_TO_DEVICE: DMA_FROM_DEVICE; ++ dma_unmap_single(&((struct pci_dev *)osh->pdev)->dev, (uint32)pa, size, dir); ++#else + dir = (direction == DMA_TX)? PCI_DMA_TODEVICE: PCI_DMA_FROMDEVICE; + pci_unmap_single(osh->pdev, (uint32)pa, size, dir); ++#endif + } + + #if defined(BCMDBG_ASSERT) diff --git a/aports/broadcom-wl/014-linux414.patch b/aports/broadcom-wl/014-linux414.patch new file mode 100644 index 0000000..0576aa5 --- /dev/null +++ b/aports/broadcom-wl/014-linux414.patch @@ -0,0 +1,37 @@ +From: Gerardo Esteban Malazdrewicz <gerardo@malazdrewicz.com.ar> +Date: Fri, 29 Dec 2017 23:44:24 -0400 +Subject: linux414 +Origin: https://bugs.debian.org/885885 + +linux 4.14 changed the kernel_read function prototype. +--- + src/shared/linux_osl.c | 12 +++++++++++- + 1 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/src/shared/linux_osl.c b/src/shared/linux_osl.c +index 9adc392..b24a973 100644 +--- a/src/shared/linux_osl.c ++++ b/src/shared/linux_osl.c +@@ -1076,11 +1076,21 @@ osl_os_get_image_block(char *buf, int len, void *image) + { + 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/aports/broadcom-wl/015-linux600.patch b/aports/broadcom-wl/015-linux600.patch new file mode 100644 index 0000000..8645907 --- /dev/null +++ b/aports/broadcom-wl/015-linux600.patch @@ -0,0 +1,31 @@ +From 933540c63f33e6ac2825d65c4b681ef3387d9146 Mon Sep 17 00:00:00 2001 +From: Antoine Cotten <hello@acotten.com> +Date: Mon, 15 Aug 2022 17:53:51 +0200 +Subject: [PATCH] cfg80211_roam_info compat for MLO APIs in Linux >= 6.0 + +The 'bssid' struct field is now under 'links.bssid'. + +See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=efbabc11650040c64884ff3019b88c7bcc0ceb1d + +Original patch by Joan Bruguera: +https://gist.github.com/joanbm/207210d74637870c01ef5a3c262a597d +--- + src/wl/sys/wl_cfg80211_hybrid.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c +index 5e9e6d3..5ec35c5 100644 +--- a/src/wl/sys/wl_cfg80211_hybrid.c ++++ b/src/wl/sys/wl_cfg80211_hybrid.c +@@ -2412,7 +2412,11 @@ wl_bss_roaming_done(struct wl_cfg80211_priv *wl, struct net_device *ndev, + struct wl_cfg80211_connect_info *conn_info = wl_to_conn(wl); + #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) + struct cfg80211_roam_info roam_info = { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) + .bssid = wl->profile->bssid, ++#else ++ .links[0].bssid = wl->profile->bssid, ++#endif + .req_ie = conn_info->req_ie, + .req_ie_len = conn_info->req_ie_len, + .resp_ie = conn_info->resp_ie, diff --git a/aports/broadcom-wl/016-linux601.patch b/aports/broadcom-wl/016-linux601.patch new file mode 100644 index 0000000..721967d --- /dev/null +++ b/aports/broadcom-wl/016-linux601.patch @@ -0,0 +1,90 @@ +diff -Nurp -u -r a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c +--- a/src/wl/sys/wl_cfg80211_hybrid.c 2022-12-12 00:23:30.821615599 +0000 ++++ b/src/wl/sys/wl_cfg80211_hybrid.c 2022-12-12 00:35:47.854975024 +0000 +@@ -105,14 +105,28 @@ static s32 wl_cfg80211_get_tx_power(stru + static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm); + #endif + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) ++static s32 wl_cfg80211_config_default_key(struct wiphy *wiphy, ++ struct net_device *dev, int link_id, u8 key_idx, bool unicast, ++ bool multicast); ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38) + static s32 wl_cfg80211_config_default_key(struct wiphy *wiphy, + struct net_device *dev, u8 key_idx, bool unicast, bool multicast); + #else + static s32 wl_cfg80211_config_default_key(struct wiphy *wiphy, + struct net_device *dev, u8 key_idx); + #endif +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) ++static s32 wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev, ++ int link_id, u8 key_idx, bool pairwise, const u8 *mac_addr, ++ struct key_params *params); ++static s32 wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev, ++ int link_id, u8 key_idx, bool pairwise, const u8 *mac_addr); ++static s32 wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev, ++ int link_id, u8 key_idx, bool pairwise, const u8 *mac_addr, ++ void *cookie, ++ void (*callback) (void *cookie, struct key_params *params)); ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37) + static s32 wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev, + u8 key_idx, bool pairwise, const u8 *mac_addr, struct key_params *params); + static s32 wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev, +@@ -1161,7 +1175,12 @@ static s32 wl_cfg80211_get_tx_power(stru + return err; + } + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) ++static s32 ++wl_cfg80211_config_default_key(struct wiphy *wiphy, ++ struct net_device *dev, int link_id, u8 key_idx, bool unicast, ++ bool multicast) ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38) + static s32 + wl_cfg80211_config_default_key(struct wiphy *wiphy, + struct net_device *dev, u8 key_idx, bool unicast, bool multicast) +@@ -1186,7 +1205,12 @@ wl_cfg80211_config_default_key(struct wi + return 0; + } + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) ++static s32 ++wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev, ++ int link_id, u8 key_idx, bool pairwise, const u8 *mac_addr, ++ struct key_params *params) ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37) + static s32 + wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev, + u8 key_idx, bool pairwise, const u8 *mac_addr, struct key_params *params) +@@ -1307,7 +1331,11 @@ wl_cfg80211_add_key(struct wiphy *wiphy, + return err; + } + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) ++static s32 ++wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev, ++ int link_id, u8 key_idx, bool pairwise, const u8 *mac_addr) ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37) + static s32 + wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev, + u8 key_idx, bool pairwise, const u8 *mac_addr) +@@ -1350,7 +1378,13 @@ wl_cfg80211_del_key(struct wiphy *wiphy, + return err; + } + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) ++static s32 ++wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev, ++ int link_id, u8 key_idx, bool pairwise, const u8 *mac_addr, ++ void *cookie, ++ void (*callback) (void *cookie, struct key_params * params)) ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37) + static s32 + wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev, + u8 key_idx, bool pairwise, const u8 *mac_addr, void *cookie, diff --git a/aports/broadcom-wl/APKBUILD b/aports/broadcom-wl/APKBUILD index f0bec3e..1d10afb 100644 --- a/aports/broadcom-wl/APKBUILD +++ b/aports/broadcom-wl/APKBUILD @@ -2,7 +2,7 @@ pkgname=broadcom-wl pkgver=6.30.223.271 -pkgrel=10 +pkgrel=11 pkgdesc='Broadcom 802.11 Linux STA wireless driver' arch="x86_64" url='https://www.broadcom.com/support/download-search/?pf=Wireless+LAN+Infrastructure' @@ -13,6 +13,7 @@ install= options="!check !strip" source="broadcom-wl.conf Makefile.patch + msi_support.patch 001-null-pointer-fix.patch 002-rdtscl.patch 003-linux47.patch @@ -24,6 +25,11 @@ source="broadcom-wl.conf 009-fix_mac_profile_discrepancy.patch 010-linux56.patch 011-linux59.patch + 012-linux517.patch + 013-linux518.patch + 014-linux414.patch + 015-linux600.patch + 016-linux601.patch https://docs.broadcom.com/docs-and-downloads/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-${pkgver//./_}.tar.gz " @@ -73,16 +79,22 @@ package() { sha512sums=" 98d0ed53e9fabba0b9ebd36ad7c67b1c50233de857759328bed7b790cdc5db675d5c23739384dd8c4e05f5969bf1c633f5028901508e596665d9ab028b42aebb broadcom-wl.conf 9ac01eb67bd29573007e878a33207f9f335b85dd7ffa995020157228adfe4234e3febb6582cb25e315392933b3e2d53fd137032db7bda46c265740190d1c49c7 Makefile.patch +6bd2dbfd65930397f01861d5acfcdb9e89286f4b930756759667e67ee6cf11b0229466751442654d2ac4ccf4aaafd5d30435ebc9ab93ace21c372fe605bd3837 msi_support.patch 4403cad0360b01f8e88faccb77e6239865e9cc2b68dac62896153ab37957f1e73e5e4c95d3e81dac334106a2cd4ef0784955a5fefd8abc6e793a68f182bbffe4 001-null-pointer-fix.patch b483a4fd5fbb5a4697365b6ddcd8034b4d90ddee9bf2aecf003b0fd6838a708d3e84be33b08acdbe165d440480da25fdf0dfff0d2fe12fa2c5271c51d6ac74c0 002-rdtscl.patch f61ecfb6b8c5a377c7a4da7549c9ec75677782fa2f97e64de0df1259e0ec3b993cfa3eaa4ff50331703ee18ef28f2af0d09839dd3b63ed994e6b29cbfe8ed73f 003-linux47.patch e5959921b6f0cd5d61d7ed568f549b0920f394458c28257c05064b89d7067ce11c8e44ed0e5a48a65bd041c6193d9ae2d02fca2f5efbfb787d3f9001786a4578 004-linux48.patch 6209a0a5a46a3efcede3cb1e263467173153d779b6267ba4c20f46421a9abd8743a7068527ace350a3da3ef3046b0399e09b37aba917fabe020c8c2600b60fdf 005-debian-fix-kernel-warnings.patch b7db17e30731a9cbc940b83f7b62f059529cff6c134e47e2176cd7c6fcd8d028334ed4fe1fdce7cf1aef87590f9664b463383ae3302a6e2aabe1baa79fbc5c95 006-linux411.patch -3b73136488daa2d59586bb7ce704fcb73b7a719bf150517beab1f13f7fb9626281e03dd7ffd3557aa894ce806b6ceef678f3f979b11e762890f20e04d19d2e04 007-linux412.patch +d4acd891023ff8d4b9308afdd55c4e971cdf7773570c8e3a545400ed9e414eeca5016ebc8a530002e7858fd44f1fd5b0ae70c0d0a3cdbbffd5bd9abb702b2cde 007-linux412.patch 2fb5c3eebd48b6099fb87a9fd92545c17b2abf318b040a434c1b0bdd75a7a682b6e7ec9f80245c198f1c306bbaef35a2488123c5ba8764d5a83eb18132c0857b 008-linux415.patch -4d88a6fbd8266f34b69ad3ab5cfb988d9057743116db5b3bab9ac197eabdf12a1f0cac4fbda815225f48911d62ea3490a0365f864c6686fd1364a406a765034b 009-fix_mac_profile_discrepancy.patch +97d34398d18ac9a7943233c12e01cf7006bf0648938303100932cabf5000c346f1a852978e3c8c48bb6e8652177e625ce1190047d580624319e680a13802ce92 009-fix_mac_profile_discrepancy.patch 8fb320c1272246c91fdd99cade2fb67a6ecd924a132c1b9432fa1ff0338444700451ffc6a1cb35e07188c58c5bd1ccaf59ebf014c49f44cb6ba33d1ec732859d 010-linux56.patch b9a0193ab604da92c99051e2a4fd91e43c3b6aeea7dbda15635b43eabd35b414e197bf5f25ac0d4ec905a1cb75abc15f165428470bc788dbefd73f178d165099 011-linux59.patch +ec34a2800d7a70a7a1ff8a96ba87c2327f68066addf5adc9f60ba303cfda9cee39159f110013f075e357988f92efe802010e9c1d7884a5dfb1908df1489bd608 012-linux517.patch +b815a4ff9289d81ddbe7f76553b092df19ee137438c9e33811c3a8b15e8a3896763715975b42391b4edfb60cfb0db46b71f4fee0f33a7b07f8d45cc4608d3faa 013-linux518.patch +30207d8872ee8925a7c7412184e3b4fd6935f8017fb46e1173aca77333c99fb4316ef1511a83e345593c369210d4cbf976eea53995e229b4d856d97662c98961 014-linux414.patch +21cf9b0b01ad4b30fa8541638e9a8428c8c68c89992b7e15c19f8526e8df6f8c5ff20de5ae2759b36fead07deacd1805749a9ed82611d15fb75dc94812e4941e 015-linux600.patch +8879aeb0a79b7e82ca5e70fd33acefda1733594d7e78940932d2c220cad48b643fc2c0cb8e79f1fc3ebaaa5a4383a0caf6798214f911c2f5859c8fab1c8532e8 016-linux601.patch 6855781f7c69a9aecb9461932423688964879d5a4df571f01ae7adaa7bf21a410bef839605d555afb6c8f4eec92fe8510af6cb120930095617ff6cdcccedaf17 hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz " diff --git a/aports/broadcom-wl/msi_support.patch b/aports/broadcom-wl/msi_support.patch new file mode 100644 index 0000000..84634f9 --- /dev/null +++ b/aports/broadcom-wl/msi_support.patch @@ -0,0 +1,79 @@ +--- a/src/wl/sys/wl_linux.c ++++ b/src/wl/sys/wl_linux.c +@@ -504,6 +504,7 @@ + #if defined(USE_CFG80211) + struct device *parentdev; + #endif ++ bool msi_supported; + + unit = wl_found + instance_base; + err = 0; +@@ -529,6 +530,7 @@ + } + bzero(wl, sizeof(wl_info_t)); + ++ wl->pdev = (struct pci_dev *) btparam; + wl->osh = osh; + wl->unit = unit; + atomic_set(&wl->callbacks, 0); +@@ -654,9 +656,28 @@ + + tasklet_init(&wl->tx_tasklet, wl_tx_tasklet, (ulong)wl); + ++ msi_supported = !wl->pdev->no_msi; ++ pci_info(wl->pdev, "MSI supported: %s\n", msi_supported ? "true" : "false"); ++ ++ if (msi_supported) { ++ int ret; ++ ++ ret = pci_alloc_irq_vectors(wl->pdev, 1, 1, PCI_IRQ_MSI); ++ if (ret < 0) { ++ WL_ERROR(("wl%d: pci_alloc_irq_vectors() failed, ret %d\n", unit, ret)); ++ goto fail; ++ } ++ pci_info(wl->pdev, "(MSI) allocated %d IRQ vectors", ret); ++ irq = pci_irq_vector(wl->pdev, 0); ++ pci_info(wl->pdev, "(MSI) requesting IRQ: %d\n", irq); ++ } ++ + { +- if (request_irq(irq, wl_isr, IRQF_SHARED, dev->name, wl)) { +- WL_ERROR(("wl%d: request_irq() failed\n", unit)); ++ int ret; ++ ++ ret = request_irq(irq, wl_isr, IRQF_SHARED, dev->name, wl); ++ if (ret < 0) { ++ WL_ERROR(("wl%d: request_irq() failed, ret %d\n", unit, ret)); + goto fail; + } + dev->irq = irq; +@@ -996,8 +1017,10 @@ + + WL_TRACE(("wl: wl_free\n")); + { +- if (wl->dev && wl->dev->irq) ++ if (wl->dev && wl->dev->irq) { + free_irq(wl->dev->irq, wl); ++ pci_free_irq_vectors(wl->pdev); ++ } + } + + #if defined(WL_CONFIG_RFKILL) +--- a/src/wl/sys/wl_linux.h ++++ b/src/wl/sys/wl_linux.h +@@ -21,6 +21,7 @@ + #ifndef _wl_linux_h_ + #define _wl_linux_h_ + ++#include <linux/pci.h> + #include <wlc_types.h> + #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0) + #include <wlc_pub.h> +@@ -85,6 +86,7 @@ + void *wlc; + osl_t *osh; + struct net_device *dev; ++ struct pci_dev *pdev; + + struct semaphore sem; + spinlock_t lock; diff --git a/aports/wpa_supplicant/0001-nl80211-add-extra-ies-only-if-allowed-by-driver.patch b/aports/wpa_supplicant/0001-nl80211-add-extra-ies-only-if-allowed-by-driver.patch new file mode 100644 index 0000000..5a395d5 --- /dev/null +++ b/aports/wpa_supplicant/0001-nl80211-add-extra-ies-only-if-allowed-by-driver.patch @@ -0,0 +1,69 @@ +From: David Bauer <mail@david-bauer.net> +Date: Sun, 30 Jan 2022 20:22:00 +0100 +Subject: nl80211: add extra-ies only if allowed by driver + +Upgrading wpa_supplicant from 2.9 to 2.10 breaks broadcom-wl +based adapters. The reason for it is hostapd tries to install additional +IEs for scanning while the driver does not support this. + +The kernel indicates the maximum number of bytes for additional scan IEs +using the NL80211_ATTR_MAX_SCAN_IE_LEN attribute. Save this value and +only add additional scan IEs in case the driver can accommodate these +additional IEs. + +Reported-by: Étienne Morice <neon.emorice@mail.com> +Tested-by: Étienne Morice <neon.emorice@mail.com> +Signed-off-by: David Bauer <mail@david-bauer.net> + +Bug: http://lists.infradead.org/pipermail/hostap/2022-January/040178.html +Bug-ArchLinux: https://bugs.archlinux.org/task/73495 +Bug-Debian: https://bugs.debian.org/1004524 +Origin: http://lists.infradead.org/pipermail/hostap/2022-January/040185.html +--- + src/drivers/driver.h | 3 +++ + src/drivers/driver_nl80211_capa.c | 4 ++++ + src/drivers/driver_nl80211_scan.c | 2 +- + 3 files changed, 8 insertions(+), 1 deletion(-) + +diff --git a/src/drivers/driver.h b/src/drivers/driver.h +index d3312a3..b5b6264 100644 +--- a/src/drivers/driver.h ++++ b/src/drivers/driver.h +@@ -2052,6 +2052,9 @@ struct wpa_driver_capa { + /** Maximum number of iterations in a single scan plan */ + u32 max_sched_scan_plan_iterations; + ++ /** Maximum number of extra IE bytes for scans */ ++ u16 max_scan_ie_len; ++ + /** Whether sched_scan (offloaded scanning) is supported */ + int sched_scan_supported; + +diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c +index 83868b7..b33b6ba 100644 +--- a/src/drivers/driver_nl80211_capa.c ++++ b/src/drivers/driver_nl80211_capa.c +@@ -885,6 +885,10 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg) + nla_get_u32(tb[NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS]); + } + ++ if (tb[NL80211_ATTR_MAX_SCAN_IE_LEN]) ++ capa->max_scan_ie_len = ++ nla_get_u16(tb[NL80211_ATTR_MAX_SCAN_IE_LEN]); ++ + if (tb[NL80211_ATTR_MAX_MATCH_SETS]) + capa->max_match_sets = + nla_get_u8(tb[NL80211_ATTR_MAX_MATCH_SETS]); +diff --git a/src/drivers/driver_nl80211_scan.c b/src/drivers/driver_nl80211_scan.c +index 1316084..b0f0951 100644 +--- a/src/drivers/driver_nl80211_scan.c ++++ b/src/drivers/driver_nl80211_scan.c +@@ -207,7 +207,7 @@ nl80211_scan_common(struct i802_bss *bss, u8 cmd, + wpa_printf(MSG_DEBUG, "nl80211: Passive scan requested"); + } + +- if (params->extra_ies) { ++ if (params->extra_ies && drv->capa.max_scan_ie_len >= params->extra_ies_len) { + wpa_hexdump(MSG_MSGDUMP, "nl80211: Scan extra IEs", + params->extra_ies, params->extra_ies_len); + if (nla_put(msg, NL80211_ATTR_IE, params->extra_ies_len, diff --git a/aports/wpa_supplicant/APKBUILD b/aports/wpa_supplicant/APKBUILD index 7313749..749ba5a 100644 --- a/aports/wpa_supplicant/APKBUILD +++ b/aports/wpa_supplicant/APKBUILD @@ -2,7 +2,7 @@ pkgname=wpa_supplicant pkgver=2.10 -pkgrel=3 # base: 5 +pkgrel=4 # base: 5 pkgdesc="utility providing key negotiation for WPA wireless networks" url="https://w1.fi/wpa_supplicant/" arch="all" @@ -11,6 +11,7 @@ license="BSD-3-Clause" subpackages= makedepends="linux-headers openssl-dev>3 dbus-dev libnl3-dev pcsc-lite-dev" source="https://w1.fi/releases/wpa_supplicant-$pkgver.tar.gz + 0001-nl80211-add-extra-ies-only-if-allowed-by-driver.patch wpa_supplicant.initd wpa_supplicant.confd eloop.patch @@ -76,6 +77,7 @@ package() { sha512sums=" 021c2a48f45d39c1dc6557730be5debaee071bc0ff82a271638beee6e32314e353e49d39e2f0dc8dff6e094dcc7008cfe1c32d0c7a34a1a345a12a3f1c1e11a1 wpa_supplicant-2.10.tar.gz +fb328872087268056b035802f71df2f7af8d11699822fe68611201a07dc693c4fdb8c50dd4fd509ed6db4cca89f6003ce3303770951686a35633977f466f4fb5 0001-nl80211-add-extra-ies-only-if-allowed-by-driver.patch 92c4cbaa9776a354275640c9411d2f547f4c0e00415af4ab30039f1a0be6a11082d49e2514905010f0abcc4a9276353276da9864e3d5f7264a0f0767c8cc9d78 wpa_supplicant.initd c7e4041fe41743c5e63a07edc9234d0c44c4c0f193a180b27342b43f3be45fb87b42ee0f9e4a20614cf6ad58cf64d25f74d1e75e2e1d521c2f6d45cdc5737eae wpa_supplicant.confd 2be055dd1f7da5a3d8e79c2f2c0220ddd31df309452da18f290144d2112d6dbde0fc633bb2ad02c386a39d7785323acaf5f70e5969995a1e8303a094eb5fe232 eloop.patch |