summaryrefslogtreecommitdiffstats
path: root/broadcom-sta
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2023-01-09 18:59:31 +0000
committer Eric Hameleers <alien@slackware.com>2023-01-09 18:59:31 +0000
commite99af32d1436740d1a99c320cb62005c4497a062 (patch)
tree8013b11f058b8b4859a6e249f2de01c8e675f8d3 /broadcom-sta
parenta9c5c99eadb15d8509156481b037110766ab7590 (diff)
downloadasb-e99af32d1436740d1a99c320cb62005c4497a062.tar.gz
asb-e99af32d1436740d1a99c320cb62005c4497a062.tar.xz
Initial revision
Diffstat (limited to 'broadcom-sta')
-rw-r--r--broadcom-sta/build/patches/26-linux518.patch71
-rw-r--r--broadcom-sta/build/patches/27-linux600.patch31
-rw-r--r--broadcom-sta/build/patches/28-linux601.patch90
3 files changed, 192 insertions, 0 deletions
diff --git a/broadcom-sta/build/patches/26-linux518.patch b/broadcom-sta/build/patches/26-linux518.patch
new file mode 100644
index 00000000..d837429a
--- /dev/null
+++ b/broadcom-sta/build/patches/26-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/broadcom-sta/build/patches/27-linux600.patch b/broadcom-sta/build/patches/27-linux600.patch
new file mode 100644
index 00000000..8645907b
--- /dev/null
+++ b/broadcom-sta/build/patches/27-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/broadcom-sta/build/patches/28-linux601.patch b/broadcom-sta/build/patches/28-linux601.patch
new file mode 100644
index 00000000..721967d2
--- /dev/null
+++ b/broadcom-sta/build/patches/28-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,