1 |
commit: 3742de12e9abd41eebaa87c724b49dc39f7d4ce5 |
2 |
Author: Azamat H. Hackimov <azamat.hackimov <AT> gmail <DOT> com> |
3 |
AuthorDate: Mon Jun 1 16:09:39 2020 +0000 |
4 |
Commit: Stefan Strogin <steils <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jun 1 22:01:23 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3742de12 |
7 |
|
8 |
net-wireless/broadcom-sta: linux 5.6 support |
9 |
|
10 |
Add patch that resolves compilation error described in #717320. |
11 |
|
12 |
Closes: https://bugs.gentoo.org/717320 |
13 |
Package-Manager: Portage-2.3.99, Repoman-2.3.22 |
14 |
Signed-off-by: Azamat H. Hackimov <azamat.hackimov <AT> gmail.com> |
15 |
Closes: https://github.com/gentoo/gentoo/pull/16043 |
16 |
Signed-off-by: Stefan Strogin <steils <AT> gentoo.org> |
17 |
|
18 |
.../broadcom-sta-6.30.223.271-r5.ebuild | 3 +- |
19 |
.../broadcom-sta-6.30.223.271-r5-linux-5.6.patch | 88 ++++++++++++++++++++++ |
20 |
2 files changed, 90 insertions(+), 1 deletion(-) |
21 |
|
22 |
diff --git a/net-wireless/broadcom-sta/broadcom-sta-6.30.223.271-r5.ebuild b/net-wireless/broadcom-sta/broadcom-sta-6.30.223.271-r5.ebuild |
23 |
index 91581b52a4e..b84669a9969 100644 |
24 |
--- a/net-wireless/broadcom-sta/broadcom-sta-6.30.223.271-r5.ebuild |
25 |
+++ b/net-wireless/broadcom-sta/broadcom-sta-6.30.223.271-r5.ebuild |
26 |
@@ -1,4 +1,4 @@ |
27 |
-# Copyright 1999-2019 Gentoo Authors |
28 |
+# Copyright 1999-2020 Gentoo Authors |
29 |
# Distributed under the terms of the GNU General Public License v2 |
30 |
|
31 |
EAPI=7 |
32 |
@@ -84,6 +84,7 @@ PATCHES=( |
33 |
"${FILESDIR}/${PN}-6.30.223.271-r4-linux-4.12.patch" |
34 |
"${FILESDIR}/${PN}-6.30.223.271-r4-linux-4.15.patch" |
35 |
"${FILESDIR}/${PN}-6.30.223.271-r5-linux-5.1.patch" |
36 |
+ "${FILESDIR}/${PN}-6.30.223.271-r5-linux-5.6.patch" |
37 |
) |
38 |
|
39 |
src_install() { |
40 |
|
41 |
diff --git a/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r5-linux-5.6.patch b/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r5-linux-5.6.patch |
42 |
new file mode 100644 |
43 |
index 00000000000..71264346f86 |
44 |
--- /dev/null |
45 |
+++ b/net-wireless/broadcom-sta/files/broadcom-sta-6.30.223.271-r5-linux-5.6.patch |
46 |
@@ -0,0 +1,88 @@ |
47 |
+From: Herman van Hazendonk <github.com@××××××.org> |
48 |
+Date: Tue, 31 Mar 2020 17:09:55 +0200 |
49 |
+Subject: [PATCH] Add fixes for 5.6 kernel |
50 |
+Origin: https://salsa.debian.org/Herrie82-guest/broadcom-sta/-/merge_requests/1 |
51 |
+ |
52 |
+Use ioremap instead of ioremap_nocache and proc_ops instead of |
53 |
+file_operations on Linux kernel 5.6 and above. |
54 |
+ |
55 |
+<rosh> Patch amended to adapt i386 arch. |
56 |
+--- |
57 |
+ src/shared/linux_osl.c | 6 +++++- |
58 |
+ src/wl/sys/wl_linux.c | 21 ++++++++++++++++++++- |
59 |
+ 2 files changed, 25 insertions(+), 2 deletions(-) |
60 |
+ |
61 |
+diff --git a/src/shared/linux_osl.c b/src/shared/linux_osl.c |
62 |
+index b24a973..9bce9b1 100644 |
63 |
+--- a/src/shared/linux_osl.c |
64 |
++++ b/src/shared/linux_osl.c |
65 |
+@@ -946,7 +946,11 @@ osl_getcycles(void) |
66 |
+ void * |
67 |
+ osl_reg_map(uint32 pa, uint size) |
68 |
+ { |
69 |
+- return (ioremap_nocache((unsigned long)pa, (unsigned long)size)); |
70 |
++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) |
71 |
++ return (ioremap((unsigned long)pa, (unsigned long)size)); |
72 |
++ #else |
73 |
++ return (ioremap_nocache((unsigned long)pa, (unsigned long)size)); |
74 |
++ #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) */ |
75 |
+ } |
76 |
+ |
77 |
+ void |
78 |
+diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c |
79 |
+index ab7b883..10621c2 100644 |
80 |
+--- a/src/wl/sys/wl_linux.c |
81 |
++++ b/src/wl/sys/wl_linux.c |
82 |
+@@ -590,10 +590,17 @@ wl_attach(uint16 vendor, uint16 device, ulong regs, |
83 |
+ } |
84 |
+ wl->bcm_bustype = bustype; |
85 |
+ |
86 |
++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) |
87 |
++ if ((wl->regsva = ioremap(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) { |
88 |
++ WL_ERROR(("wl%d: ioremap() failed\n", unit)); |
89 |
++ goto fail; |
90 |
++ } |
91 |
++ #else |
92 |
+ if ((wl->regsva = ioremap_nocache(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) { |
93 |
+ WL_ERROR(("wl%d: ioremap() failed\n", unit)); |
94 |
+ goto fail; |
95 |
+ } |
96 |
++ #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) */ |
97 |
+ |
98 |
+ wl->bar1_addr = bar1_addr; |
99 |
+ wl->bar1_size = bar1_size; |
100 |
+@@ -780,8 +787,13 @@ wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |
101 |
+ if ((val & 0x0000ff00) != 0) |
102 |
+ pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); |
103 |
+ bar1_size = pci_resource_len(pdev, 2); |
104 |
++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) |
105 |
++ bar1_addr = (uchar *)ioremap(pci_resource_start(pdev, 2), |
106 |
++ bar1_size); |
107 |
++ #else |
108 |
+ bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2), |
109 |
+ bar1_size); |
110 |
++ #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) */ |
111 |
+ wl = wl_attach(pdev->vendor, pdev->device, pci_resource_start(pdev, 0), PCI_BUS, pdev, |
112 |
+ pdev->irq, bar1_addr, bar1_size); |
113 |
+ |
114 |
+@@ -3354,12 +3366,19 @@ wl_proc_write(struct file *filp, const char __user *buff, size_t length, loff_t |
115 |
+ } |
116 |
+ |
117 |
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) |
118 |
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) |
119 |
++static const struct proc_ops wl_fops = { |
120 |
++ .proc_read = wl_proc_read, |
121 |
++ .proc_write = wl_proc_write, |
122 |
++}; |
123 |
++#else |
124 |
+ static const struct file_operations wl_fops = { |
125 |
+ .owner = THIS_MODULE, |
126 |
+ .read = wl_proc_read, |
127 |
+ .write = wl_proc_write, |
128 |
+ }; |
129 |
+-#endif |
130 |
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) */ |
131 |
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) */ |
132 |
+ |
133 |
+ static int |
134 |
+ wl_reg_proc_entry(wl_info_t *wl) |