summaryrefslogtreecommitdiff
path: root/sys-kernel/broadcom-sta-dkms
diff options
context:
space:
mode:
Diffstat (limited to 'sys-kernel/broadcom-sta-dkms')
-rw-r--r--sys-kernel/broadcom-sta-dkms/broadcom-sta-dkms-6.30.223.271-r6.ebuild54
-rw-r--r--sys-kernel/broadcom-sta-dkms/files/date-time-error.patch21
-rw-r--r--sys-kernel/broadcom-sta-dkms/files/date-time.patch11
-rw-r--r--sys-kernel/broadcom-sta-dkms/files/eth-to-wlan.patch12
-rw-r--r--sys-kernel/broadcom-sta-dkms/files/gcc.patch11
-rw-r--r--sys-kernel/broadcom-sta-dkms/files/kernel-5.17.patch20
-rw-r--r--sys-kernel/broadcom-sta-dkms/files/kernel-5.18.patch71
-rw-r--r--sys-kernel/broadcom-sta-dkms/files/makefile.patch14
8 files changed, 214 insertions, 0 deletions
diff --git a/sys-kernel/broadcom-sta-dkms/broadcom-sta-dkms-6.30.223.271-r6.ebuild b/sys-kernel/broadcom-sta-dkms/broadcom-sta-dkms-6.30.223.271-r6.ebuild
new file mode 100644
index 00000000..4f2e01a3
--- /dev/null
+++ b/sys-kernel/broadcom-sta-dkms/broadcom-sta-dkms-6.30.223.271-r6.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+inherit eutils
+
+DESCRIPTION="Broadcom's IEEE 802.11a/b/g/n hybrid Linux device driver source"
+HOMEPAGE="http://www.broadcom.com/support/802.11/"
+SRC_BASE="http://www.broadcom.com/docs/linux_sta/hybrid-v35"
+SRC_URI="amd64? ( ${SRC_BASE}_64-nodebug-pcoem-${PV//\./_}.tar.gz )"
+
+LICENSE="Broadcom"
+KEYWORDS="amd64"
+SLOT="0"
+RESTRICT="mirror"
+
+DEPEND="sys-kernel/dkms"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/makefile.patch
+ "${FILESDIR}"/eth-to-wlan.patch
+ "${FILESDIR}"/gcc.patch
+ "${FILESDIR}"/date-time.patch
+ "${FILESDIR}"/date-time-error.patch
+ "${FILESDIR}"/kernel-4.7-to-kernel-5.10.patch
+ "${FILESDIR}"/kernel-5.17.patch
+ "${FILESDIR}"/kernel-5.18.patch
+)
+
+S="${WORKDIR}"
+
+src_compile(){
+ :
+}
+
+src_install() {
+ dodir usr/src/${P}
+ insinto usr/src/${P}
+ doins -r "${S}"/*
+ doins "${FILESDIR}"/dkms.conf
+ dodir etc/modprobe.d
+ insinto etc/modprobe.d
+ doins "${FILESDIR}"/"${PN}".conf
+}
+
+pkg_postinst() {
+ dkms add ${PN}/${PV}
+}
+
+pkg_prerm() {
+ dkms remove ${PN}/${PV} --all
+}
diff --git a/sys-kernel/broadcom-sta-dkms/files/date-time-error.patch b/sys-kernel/broadcom-sta-dkms/files/date-time-error.patch
new file mode 100644
index 00000000..c0e57f43
--- /dev/null
+++ b/sys-kernel/broadcom-sta-dkms/files/date-time-error.patch
@@ -0,0 +1,21 @@
+--- a/src/wl/sys/wl_linux.c 2015-09-19 00:47:30.000000000 +0200
++++ b/src/wl/sys/wl_linux.c 2022-08-02 10:16:25.059062466 +0200
+@@ -724,7 +724,7 @@
+ WL_ALL_PASSIVE_ENAB(wl) ? ", Passive Mode" : "", EPI_VERSION_STR);
+
+ #ifdef BCMDBG
+- printf(" (Compiled in " SRCBASE " at " __TIME__ " on " __DATE__ ")");
++ printf(" (Compiled in " SRCBASE ")");
+ #endif
+ printf("\n");
+
+@@ -2053,8 +2053,7 @@
+ void
+ wl_dump_ver(wl_info_t *wl, struct bcmstrbuf *b)
+ {
+- bcm_bprintf(b, "wl%d: %s %s version %s\n", wl->pub->unit,
+- __DATE__, __TIME__, EPI_VERSION_STR);
++ bcm_bprintf(b, "wl%d: version %s\n", wl->pub->unit, EPI_VERSION_STR);
+ }
+
+ #if defined(BCMDBG)
diff --git a/sys-kernel/broadcom-sta-dkms/files/date-time.patch b/sys-kernel/broadcom-sta-dkms/files/date-time.patch
new file mode 100644
index 00000000..f93e3f1d
--- /dev/null
+++ b/sys-kernel/broadcom-sta-dkms/files/date-time.patch
@@ -0,0 +1,11 @@
+--- a/Makefile 2014-06-26 10:42:08.000000000 +0000
++++ b/Makefile 2014-07-17 22:44:01.662297228 +0000
+@@ -126,6 +126,8 @@
+ EXTRA_CFLAGS += -I$(src)/src/shared/bcmwifi/include
+ #EXTRA_CFLAGS += -DBCMDBG_ASSERT -DBCMDBG_ERR
+
++EXTRA_CFLAGS += -Wno-date-time
++
+ EXTRA_LDFLAGS := $(src)/lib/wlc_hybrid.o_shipped
+
+ KBASE ?= /lib/modules/`uname -r`
diff --git a/sys-kernel/broadcom-sta-dkms/files/eth-to-wlan.patch b/sys-kernel/broadcom-sta-dkms/files/eth-to-wlan.patch
new file mode 100644
index 00000000..b23914a0
--- /dev/null
+++ b/sys-kernel/broadcom-sta-dkms/files/eth-to-wlan.patch
@@ -0,0 +1,12 @@
+diff -urN a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c
+--- a/src/wl/sys/wl_linux.c 2013-08-01 09:52:22.000000000 +0300
++++ b/src/wl/sys/wl_linux.c 2013-09-27 09:20:11.495023471 +0300
+@@ -235,7 +235,7 @@
+ #define to_str(s) #s
+ #define quote_str(s) to_str(s)
+
+-#define BRCM_WLAN_IFNAME eth%d
++#define BRCM_WLAN_IFNAME wlan%d
+
+ static char intf_name[IFNAMSIZ] = quote_str(BRCM_WLAN_IFNAME);
+
diff --git a/sys-kernel/broadcom-sta-dkms/files/gcc.patch b/sys-kernel/broadcom-sta-dkms/files/gcc.patch
new file mode 100644
index 00000000..b5d7e858
--- /dev/null
+++ b/sys-kernel/broadcom-sta-dkms/files/gcc.patch
@@ -0,0 +1,11 @@
+diff -urN a/src/wl/sys/wl_iw.h b/src/wl/sys/wl_iw.h
+--- a/src/wl/sys/wl_iw.h 2013-08-01 09:52:22.000000000 +0300
++++ b/src/wl/sys/wl_iw.h 2013-09-27 09:36:07.808067913 +0300
+@@ -21,6 +21,7 @@
+ #ifndef _wl_iw_h_
+ #define _wl_iw_h_
+
++#include <linux/semaphore.h>
+ #include <linux/wireless.h>
+
+ #include <typedefs.h>
diff --git a/sys-kernel/broadcom-sta-dkms/files/kernel-5.17.patch b/sys-kernel/broadcom-sta-dkms/files/kernel-5.17.patch
new file mode 100644
index 00000000..3407c4ec
--- /dev/null
+++ b/sys-kernel/broadcom-sta-dkms/files/kernel-5.17.patch
@@ -0,0 +1,20 @@
+--- a/src/wl/sys/wl_linux.c 2015-09-19 00:47:30.000000000 +0200
++++ b/src/wl/sys/wl_linux.c 2022-03-22 10:39:20.763751076 +0100
+@@ -3244,7 +3244,7 @@
+ static ssize_t
+ wl_proc_read(struct file *filp, char __user *buffer, size_t length, loff_t *offp)
+ {
+- wl_info_t * wl = PDE_DATA(file_inode(filp));
++ wl_info_t * wl = pde_data(file_inode(filp));
+ #endif
+ int bcmerror, len;
+ int to_user = 0;
+@@ -3301,7 +3301,7 @@
+ static ssize_t
+ wl_proc_write(struct file *filp, const char __user *buff, size_t length, loff_t *offp)
+ {
+- wl_info_t * wl = PDE_DATA(file_inode(filp));
++ wl_info_t * wl = pde_data(file_inode(filp));
+ #endif
+ int from_user = 0;
+ int bcmerror;
diff --git a/sys-kernel/broadcom-sta-dkms/files/kernel-5.18.patch b/sys-kernel/broadcom-sta-dkms/files/kernel-5.18.patch
new file mode 100644
index 00000000..d837429a
--- /dev/null
+++ b/sys-kernel/broadcom-sta-dkms/files/kernel-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/sys-kernel/broadcom-sta-dkms/files/makefile.patch b/sys-kernel/broadcom-sta-dkms/files/makefile.patch
new file mode 100644
index 00000000..d5b97fe8
--- /dev/null
+++ b/sys-kernel/broadcom-sta-dkms/files/makefile.patch
@@ -0,0 +1,14 @@
+--- a/Makefile 2013-04-28 22:42:59.000000000 +0200
++++ b/Makefile 2013-04-28 22:45:53.000000000 +0200
+@@ -128,9 +128,9 @@
+
+ EXTRA_LDFLAGS := $(src)/lib/wlc_hybrid.o_shipped
+
+-KBASE ?= /lib/modules/`uname -r`
++KBASE ?= /lib/modules/${KV_FULL}
+ KBUILD_DIR ?= $(KBASE)/build
+-MDEST_DIR ?= $(KBASE)/kernel/drivers/net/wireless
++MDEST_DIR ?= ${D}$(KBASE)/kernel/drivers/net/wireless
+
+ all:
+ KBUILD_NOPEDANTIC=1 make -C $(KBUILD_DIR) M=`pwd`