diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-05-16 22:48:51 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-05-16 22:48:51 +0100 |
commit | 92de5272589b8c759779bb7b1b27e3bff142f2fd (patch) | |
tree | 9ac01c2ee406abb26416c6f38f9fc2f3eedbf53a | |
parent | 66cbdd6b9fc81b801e5a2a829090685830cf43c9 (diff) |
sys-kernel/broadcom-sta-dkms : add a more complete 5.6 patch
-rw-r--r-- | sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-5.6.patch | 105 |
1 files changed, 77 insertions, 28 deletions
diff --git a/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-5.6.patch b/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-5.6.patch index cfacd027..2a2bcad8 100644 --- a/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-5.6.patch +++ b/sys-kernel/broadcom-sta-dkms/files/broadcom-sta-6.30.223.271-r4-linux-5.6.patch @@ -1,41 +1,90 @@ -diff -Naur src/shared/linux_osl.c scr-crap-o-meter/shared/linux_osl.c ---- src/shared/linux_osl.c 2015-09-19 00:47:30.000000000 +0200 -+++ scr-crap-o-meter/shared/linux_osl.c 2020-03-31 00:30:59.667169330 +0200 -@@ -30,6 +30,7 @@ - #include <pcicfg.h> - - #include <linux/fs.h> -+#include <linux/io.h> +From dd057e40a167f4febb1a7c77dd32b7d36056952c Mon Sep 17 00:00:00 2001 +From: Herman van Hazendonk <github.com@herrie.org> +Date: Tue, 31 Mar 2020 17:09:55 +0200 +Subject: [PATCH] Add fixes for 5.6 kernel + +Use ioremap instead of ioremap_nocache and proc_ops instead of file_operations on Linux kernel 5.6 and above. + +Signed-off-by: Herman van Hazendonk <github.com@herrie.org> +--- + amd64/src/shared/linux_osl.c | 6 +++++- + amd64/src/wl/sys/wl_linux.c | 21 ++++++++++++++++++++- + 2 files changed, 25 insertions(+), 2 deletions(-) + +diff --git a/amd64/src/shared/linux_osl.c b/amd64/src/shared/linux_osl.c +index 6157d18..dcfc075 100644 +--- a/amd64/src/shared/linux_osl.c ++++ b/amd64/src/shared/linux_osl.c +@@ -942,7 +942,11 @@ osl_getcycles(void) + void * + osl_reg_map(uint32 pa, uint size) + { +- return (ioremap_nocache((unsigned long)pa, (unsigned long)size)); ++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) ++ return (ioremap((unsigned long)pa, (unsigned long)size)); ++ #else ++ return (ioremap_nocache((unsigned long)pa, (unsigned long)size)); ++ #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) */ + } - #define PCI_CFG_RETRY 10 + void +diff --git a/amd64/src/wl/sys/wl_linux.c b/amd64/src/wl/sys/wl_linux.c +index 0d05100..6d9dd0d 100644 +--- a/amd64/src/wl/sys/wl_linux.c ++++ b/amd64/src/wl/sys/wl_linux.c +@@ -582,10 +582,17 @@ wl_attach(uint16 vendor, uint16 device, ulong regs, + } + wl->bcm_bustype = bustype; -diff -Naur src/wl/sys/wl_linux.c scr-crap-o-meter/wl/sys/wl_linux.c ---- src/wl/sys/wl_linux.c 2015-09-19 00:47:30.000000000 +0200 -+++ scr-crap-o-meter/wl/sys/wl_linux.c 2020-03-31 00:39:52.180068119 +0200 -@@ -93,6 +93,8 @@ ++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) ++ if ((wl->regsva = ioremap(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) { ++ WL_ERROR(("wl%d: ioremap() failed\n", unit)); ++ goto fail; ++ } ++ #else + if ((wl->regsva = ioremap_nocache(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) { + WL_ERROR(("wl%d: ioremap() failed\n", unit)); + goto fail; + } ++ #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) */ - #include <wlc_wowl.h> + wl->bar1_addr = bar1_addr; + wl->bar1_size = bar1_size; +@@ -772,8 +779,13 @@ 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); ++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) ++ bar1_addr = (uchar *)ioremap(pci_resource_start(pdev, 2), ++ bar1_size); ++ #else + bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2), + bar1_size); ++ #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) */ + wl = wl_attach(pdev->vendor, pdev->device, pci_resource_start(pdev, 0), PCI_BUS, pdev, + pdev->irq, bar1_addr, bar1_size); -+#include <linux/io.h> -+ - static void wl_timer(ulong data); - static void _wl_timer(wl_timer_t *t); - static struct net_device *wl_alloc_linux_if(wl_if_t *wlif); -@@ -3335,10 +3337,17 @@ +@@ -3335,12 +3347,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) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) ++static const 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, -+#else -+static const struct proc_ops wl_fops = { -+ .proc_owner = THIS_MODULE, -+ .proc_read = wl_proc_read, -+ .proc_write = wl_proc_write, -+#endif }; - #endif +-#endif ++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) */ ++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) */ + static int + wl_reg_proc_entry(wl_info_t *wl) +-- +2.17.1.windows.1 + |