From 5ab5ce846914f1a3d6e4f24d464324d029fb31a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Tue, 19 Jul 2022 10:03:08 +0700 Subject: [PATCH] broadcom-wl-dkms: add linux 5.18 patches --- .../broadcom-wl-dkms/patches/linux-5.17.patch | 39 ++++++++++ .../broadcom-wl-dkms/patches/linux-5.18.patch | 71 +++++++++++++++++++ srcpkgs/broadcom-wl-dkms/template | 2 +- 3 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/broadcom-wl-dkms/patches/linux-5.17.patch create mode 100644 srcpkgs/broadcom-wl-dkms/patches/linux-5.18.patch diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.17.patch b/srcpkgs/broadcom-wl-dkms/patches/linux-5.17.patch new file mode 100644 index 00000000000..74847cb6bb4 --- /dev/null +++ b/srcpkgs/broadcom-wl-dkms/patches/linux-5.17.patch @@ -0,0 +1,39 @@ +diff -u -r a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c +--- a/src/wl/sys/wl_linux.c 2022-03-23 00:35:42.930416350 +0000 ++++ b/src/wl/sys/wl_linux.c 2022-03-23 00:40:12.903771013 +0000 +@@ -2980,7 +2980,11 @@ + else + dev->type = ARPHRD_IEEE80211_RADIOTAP; + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) + bcopy(wl->dev->dev_addr, dev->dev_addr, ETHER_ADDR_LEN); ++#else ++ eth_hw_addr_set(wl->dev, dev->dev_addr); ++#endif + + #if defined(WL_USE_NETDEV_OPS) + dev->netdev_ops = &wl_netdev_monitor_ops; +@@ -3261,7 +3265,11 @@ + static ssize_t + wl_proc_read(struct file *filp, char __user *buffer, size_t length, loff_t *offp) + { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) + wl_info_t * wl = PDE_DATA(file_inode(filp)); ++#else ++ wl_info_t * wl = pde_data(file_inode(filp)); ++#endif + #endif + int bcmerror, len; + int to_user = 0; +@@ -3318,7 +3326,11 @@ + static ssize_t + wl_proc_write(struct file *filp, const char __user *buff, size_t length, loff_t *offp) + { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) + wl_info_t * wl = PDE_DATA(file_inode(filp)); ++#else ++ wl_info_t * wl = pde_data(file_inode(filp)); ++#endif + #endif + int from_user = 0; + int bcmerror; diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.18.patch b/srcpkgs/broadcom-wl-dkms/patches/linux-5.18.patch new file mode 100644 index 00000000000..d837429a689 --- /dev/null +++ b/srcpkgs/broadcom-wl-dkms/patches/linux-5.18.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/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template index 55bc9c0e1d3..686f11a6d6d 100644 --- a/srcpkgs/broadcom-wl-dkms/template +++ b/srcpkgs/broadcom-wl-dkms/template @@ -2,7 +2,7 @@ pkgname=broadcom-wl-dkms version=6.30.223.271 -revision=11 +revision=12 maintainer="Orphaned " license="custom:Proprietary Broadcom license" homepage="http://broadcom.com"