diff options
Diffstat (limited to 'sys-kernel/bcmwl-dkms')
-rw-r--r-- | sys-kernel/bcmwl-dkms/Manifest | 1 | ||||
-rw-r--r-- | sys-kernel/bcmwl-dkms/bcmwl-dkms-6.30.223.271.ebuild | 54 | ||||
-rw-r--r-- | sys-kernel/bcmwl-dkms/files/bcmwl-dkms.conf | 8 | ||||
-rw-r--r-- | sys-kernel/bcmwl-dkms/files/date-time-error.patch | 21 | ||||
-rw-r--r-- | sys-kernel/bcmwl-dkms/files/date-time.patch | 11 | ||||
-rw-r--r-- | sys-kernel/bcmwl-dkms/files/dkms.conf | 8 | ||||
-rw-r--r-- | sys-kernel/bcmwl-dkms/files/eth-to-wlan.patch | 12 | ||||
-rw-r--r-- | sys-kernel/bcmwl-dkms/files/gcc.patch | 11 | ||||
-rw-r--r-- | sys-kernel/bcmwl-dkms/files/kernel-4.7-to-kernel-5.10.patch | 490 | ||||
-rw-r--r-- | sys-kernel/bcmwl-dkms/files/kernel-5.18.patch | 71 | ||||
-rw-r--r-- | sys-kernel/bcmwl-dkms/files/kernel-6.0.patch | 30 | ||||
-rw-r--r-- | sys-kernel/bcmwl-dkms/files/makefile.patch | 14 |
12 files changed, 731 insertions, 0 deletions
diff --git a/sys-kernel/bcmwl-dkms/Manifest b/sys-kernel/bcmwl-dkms/Manifest new file mode 100644 index 00000000..4f6f6c9c --- /dev/null +++ b/sys-kernel/bcmwl-dkms/Manifest @@ -0,0 +1 @@ +DIST hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz 2928541 BLAKE2B e9d01c1a1a63c07f720e3ee53ee3ef634ab12694135300cb0ce47ade0e9e0084967a0b6df64d983e8184240eb3defb128f650bddb7727e901d50315307f3398a SHA512 6855781f7c69a9aecb9461932423688964879d5a4df571f01ae7adaa7bf21a410bef839605d555afb6c8f4eec92fe8510af6cb120930095617ff6cdcccedaf17 diff --git a/sys-kernel/bcmwl-dkms/bcmwl-dkms-6.30.223.271.ebuild b/sys-kernel/bcmwl-dkms/bcmwl-dkms-6.30.223.271.ebuild new file mode 100644 index 00000000..32204783 --- /dev/null +++ b/sys-kernel/bcmwl-dkms/bcmwl-dkms-6.30.223.271.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.18.patch + "${FILESDIR}"/kernel-6.0.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/bcmwl-dkms/files/bcmwl-dkms.conf b/sys-kernel/bcmwl-dkms/files/bcmwl-dkms.conf new file mode 100644 index 00000000..8266df4b --- /dev/null +++ b/sys-kernel/bcmwl-dkms/files/bcmwl-dkms.conf @@ -0,0 +1,8 @@ +blacklist b43 +blacklist b43legacy +blacklist ssb +blacklist bcm43xx +blacklist brcm80211 +blacklist brcmfmac +blacklist brcmsmac +blacklist bcma diff --git a/sys-kernel/bcmwl-dkms/files/date-time-error.patch b/sys-kernel/bcmwl-dkms/files/date-time-error.patch new file mode 100644 index 00000000..c0e57f43 --- /dev/null +++ b/sys-kernel/bcmwl-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/bcmwl-dkms/files/date-time.patch b/sys-kernel/bcmwl-dkms/files/date-time.patch new file mode 100644 index 00000000..f93e3f1d --- /dev/null +++ b/sys-kernel/bcmwl-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/bcmwl-dkms/files/dkms.conf b/sys-kernel/bcmwl-dkms/files/dkms.conf new file mode 100644 index 00000000..3cfa22c6 --- /dev/null +++ b/sys-kernel/bcmwl-dkms/files/dkms.conf @@ -0,0 +1,8 @@ +PACKAGE_NAME="bcmwl-dkms" +PACKAGE_VERSION="6.30.223.271" +MAKE[0]="make KVER=$kernelver" +MAKE[0]="make KV_FULL=$kernelver" +BUILT_MODULE_NAME[0]="wl" +DEST_MODULE_LOCATION[0]="/extra/dkms" +AUTOINSTALL="YES" + diff --git a/sys-kernel/bcmwl-dkms/files/eth-to-wlan.patch b/sys-kernel/bcmwl-dkms/files/eth-to-wlan.patch new file mode 100644 index 00000000..b23914a0 --- /dev/null +++ b/sys-kernel/bcmwl-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/bcmwl-dkms/files/gcc.patch b/sys-kernel/bcmwl-dkms/files/gcc.patch new file mode 100644 index 00000000..b5d7e858 --- /dev/null +++ b/sys-kernel/bcmwl-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/bcmwl-dkms/files/kernel-4.7-to-kernel-5.10.patch b/sys-kernel/bcmwl-dkms/files/kernel-4.7-to-kernel-5.10.patch new file mode 100644 index 00000000..41cdf230 --- /dev/null +++ b/sys-kernel/bcmwl-dkms/files/kernel-4.7-to-kernel-5.10.patch @@ -0,0 +1,490 @@ +diff -Naur a/src/shared/linux_osl.c b/src/shared/linux_osl.c +--- a/src/shared/linux_osl.c 2015-09-19 00:47:30.000000000 +0200 ++++ b/src/shared/linux_osl.c 2020-12-14 13:34:41.810370857 +0100 +@@ -30,6 +30,7 @@ + #include <pcicfg.h> + + #include <linux/fs.h> ++#include <linux/io.h> + + #define PCI_CFG_RETRY 10 + +@@ -942,7 +943,7 @@ + void * + osl_reg_map(uint32 pa, uint size) + { +- return (ioremap_nocache((unsigned long)pa, (unsigned long)size)); ++ return (ioremap((unsigned long)pa, (unsigned long)size)); + } + + void +@@ -1072,11 +1073,21 @@ + { + struct file *fp = (struct file *)image; + int rdlen; ++ loff_t pos; + + if (!image) + return 0; + +- rdlen = kernel_read(fp, fp->f_pos, buf, len); ++ pos = fp->f_pos; ++ rdlen = kernel_read(fp, ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0) ++ pos, ++#endif ++ buf, len ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) ++ ,&pos ++#endif ++ ); + if (rdlen > 0) + fp->f_pos += rdlen; + +diff -Naur a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c +--- a/src/wl/sys/wl_cfg80211_hybrid.c 2015-09-19 00:47:30.000000000 +0200 ++++ b/src/wl/sys/wl_cfg80211_hybrid.c 2020-12-14 13:37:21.520354758 +0100 +@@ -30,6 +30,9 @@ + #include <linux/kthread.h> + #include <linux/netdevice.h> + #include <linux/ieee80211.h> ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) ++#include <linux/sched/signal.h> ++#endif + #include <net/cfg80211.h> + #include <linux/nl80211.h> + #include <net/rtnetlink.h> +@@ -38,11 +41,17 @@ + #include <wlioctl.h> + #include <proto/802.11.h> + #include <wl_cfg80211_hybrid.h> ++#include <wl_linux.h> + + #define EVENT_TYPE(e) dtoh32((e)->event_type) + #define EVENT_FLAGS(e) dtoh16((e)->flags) + #define EVENT_STATUS(e) dtoh32((e)->status) + ++#ifndef IEEE80211_BAND_2GHZ ++#define IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ ++#define IEEE80211_BAND_5GHZ NL80211_BAND_5GHZ ++#endif ++ + #ifdef BCMDBG + u32 wl_dbg_level = WL_DBG_ERR | WL_DBG_INFO; + #else +@@ -50,7 +59,11 @@ + #endif + + static s32 wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++ enum nl80211_iftype type, struct vif_params *params); ++#else + enum nl80211_iftype type, u32 *flags, struct vif_params *params); ++#endif + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) + static s32 + wl_cfg80211_scan(struct wiphy *wiphy, +@@ -435,35 +448,17 @@ + static s32 + wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len) + { +- struct ifreq ifr; +- struct wl_ioctl ioc; +- mm_segment_t fs; +- s32 err = 0; +- + BUG_ON(len < sizeof(int)); +- +- memset(&ioc, 0, sizeof(ioc)); +- ioc.cmd = cmd; +- ioc.buf = arg; +- ioc.len = len; +- strcpy(ifr.ifr_name, dev->name); +- ifr.ifr_data = (caddr_t)&ioc; +- +- fs = get_fs(); +- set_fs(get_ds()); +-#if defined(WL_USE_NETDEV_OPS) +- err = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#else +- err = dev->do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#endif +- set_fs(fs); +- +- return err; ++ return wlc_ioctl_internal(dev, cmd, arg, len); + } + + static s32 + wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++ enum nl80211_iftype type, ++#else + enum nl80211_iftype type, u32 *flags, ++#endif + struct vif_params *params) + { + struct wl_cfg80211_priv *wl = wiphy_to_wl(wiphy); +@@ -2358,6 +2353,20 @@ + const wl_event_msg_t *e, void *data) + { + struct wl_cfg80211_connect_info *conn_info = wl_to_conn(wl); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++ struct cfg80211_bss *bss; ++ struct wlc_ssid *ssid; ++ ssid = &wl->profile->ssid; ++ bss = cfg80211_get_bss(wl_to_wiphy(wl), NULL, (s8 *)&wl->bssid, ++ ssid->SSID, ssid->SSID_len, WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); ++ struct cfg80211_roam_info roam_info = { ++ .bss = bss, ++ .req_ie = conn_info->req_ie, ++ .req_ie_len = conn_info->req_ie_len, ++ .resp_ie = conn_info->resp_ie, ++ .resp_ie_len = conn_info->resp_ie_len, ++ }; ++#endif + s32 err = 0; + + wl_get_assoc_ies(wl); +@@ -2365,12 +2374,17 @@ + memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN); + wl_update_bss_info(wl); + cfg80211_roamed(ndev, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++ &roam_info, ++#else + #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) + &wl->conf->channel, + #endif + (u8 *)&wl->bssid, + conn_info->req_ie, conn_info->req_ie_len, +- conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL); ++ conn_info->resp_ie, conn_info->resp_ie_len, ++#endif ++ GFP_KERNEL); + WL_DBG(("Report roaming result\n")); + + set_bit(WL_STATUS_CONNECTED, &wl->status); +@@ -2386,8 +2400,15 @@ + s32 err = 0; + + if (wl->scan_request) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) ++ struct cfg80211_scan_info info = { ++ .aborted = true ++ }; + WL_DBG(("%s: Aborting scan\n", __FUNCTION__)); +- cfg80211_scan_done(wl->scan_request, true); ++ cfg80211_scan_done(wl->scan_request, &info); ++#else ++ cfg80211_scan_done(wl->scan_request, true); ++#endif + wl->scan_request = NULL; + } + +@@ -2488,7 +2509,14 @@ + + scan_done_out: + if (wl->scan_request) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) ++ struct cfg80211_scan_info info = { ++ .aborted = false ++ }; ++ cfg80211_scan_done(wl->scan_request, &info); ++#else + cfg80211_scan_done(wl->scan_request, false); ++#endif + wl->scan_request = NULL; + } + rtnl_unlock(); +@@ -2913,7 +2941,14 @@ + s32 err = 0; + + if (wl->scan_request) { +- cfg80211_scan_done(wl->scan_request, true); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) ++ struct cfg80211_scan_info info = { ++ .aborted = true ++ }; ++ cfg80211_scan_done(wl->scan_request, &info); ++#else ++ cfg80211_scan_done(wl->scan_request, true); ++#endif + wl->scan_request = NULL; + } + +diff -Naur a/src/wl/sys/wlc_pub.h b/src/wl/sys/wlc_pub.h +--- a/src/wl/sys/wlc_pub.h 2015-09-19 00:47:30.000000000 +0200 ++++ b/src/wl/sys/wlc_pub.h 2020-12-14 13:37:21.522354770 +0100 +@@ -24,6 +24,7 @@ + + #include <wlc_types.h> + #include <wlc_utils.h> ++#include <siutils.h> + #include "proto/802.11.h" + #include "proto/bcmevent.h" + +diff -Naur a/src/wl/sys/wl_iw.c b/src/wl/sys/wl_iw.c +--- a/src/wl/sys/wl_iw.c 2015-09-19 00:47:30.000000000 +0200 ++++ b/src/wl/sys/wl_iw.c 2020-12-14 13:37:21.521354764 +0100 +@@ -37,6 +37,7 @@ + + #include <wl_dbg.h> + #include <wl_iw.h> ++#include <wl_linux.h> + + extern bool wl_iw_conn_status_str(uint32 event_type, uint32 status, + uint32 reason, char* stringBuf, uint buflen); +@@ -103,29 +104,7 @@ + int len + ) + { +- struct ifreq ifr; +- wl_ioctl_t ioc; +- mm_segment_t fs; +- int ret; +- +- memset(&ioc, 0, sizeof(ioc)); +- ioc.cmd = cmd; +- ioc.buf = arg; +- ioc.len = len; +- +- strcpy(ifr.ifr_name, dev->name); +- ifr.ifr_data = (caddr_t) &ioc; +- +- fs = get_fs(); +- set_fs(get_ds()); +-#if defined(WL_USE_NETDEV_OPS) +- ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#else +- ret = dev->do_ioctl(dev, &ifr, SIOCDEVPRIVATE); +-#endif +- set_fs(fs); +- +- return ret; ++ return wlc_ioctl_internal(dev, cmd, arg, len); + } + + static int +diff -Naur a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c +--- a/src/wl/sys/wl_linux.c 2015-09-19 00:47:30.000000000 +0200 ++++ b/src/wl/sys/wl_linux.c 2020-12-14 13:37:21.522354770 +0100 +@@ -45,6 +45,7 @@ + #include <linux/completion.h> + #include <linux/usb.h> + #include <linux/pci_ids.h> ++#include <linux/io.h> + #define WLC_MAXBSSCFG 1 + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0) +@@ -93,7 +94,13 @@ + + #include <wlc_wowl.h> + +-static void wl_timer(ulong data); ++static void wl_timer( ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) ++ struct timer_list *tl ++#else ++ ulong data ++#endif ++ ); + static void _wl_timer(wl_timer_t *t); + static struct net_device *wl_alloc_linux_if(wl_if_t *wlif); + +@@ -117,6 +124,9 @@ + + typedef struct priv_link { + wl_if_t *wlif; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) ++ unsigned long last_rx; ++#endif + } priv_link_t; + + #define WL_DEV_IF(dev) ((wl_if_t*)((priv_link_t*)DEV_PRIV(dev))->wlif) +@@ -582,7 +592,7 @@ + } + wl->bcm_bustype = bustype; + +- if ((wl->regsva = ioremap_nocache(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) { ++ if ((wl->regsva = ioremap(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) { + WL_ERROR(("wl%d: ioremap() failed\n", unit)); + goto fail; + } +@@ -772,7 +782,7 @@ + if ((val & 0x0000ff00) != 0) + pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); + bar1_size = pci_resource_len(pdev, 2); +- bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2), ++ bar1_addr = (uchar *)ioremap(pci_resource_start(pdev, 2), + bar1_size); + wl = wl_attach(pdev->vendor, pdev->device, pci_resource_start(pdev, 0), PCI_BUS, pdev, + pdev->irq, bar1_addr, bar1_size); +@@ -1643,10 +1653,7 @@ + goto done2; + } + +- if (segment_eq(get_fs(), KERNEL_DS)) +- buf = ioc.buf; +- +- else if (ioc.buf) { ++ if (ioc.buf) { + if (!(buf = (void *) MALLOC(wl->osh, MAX(ioc.len, WLC_IOCTL_MAXLEN)))) { + bcmerror = BCME_NORESOURCE; + goto done2; +@@ -1667,7 +1674,7 @@ + WL_UNLOCK(wl); + + done1: +- if (ioc.buf && (ioc.buf != buf)) { ++ if (ioc.buf) { + if (copy_to_user(ioc.buf, buf, ioc.len)) + bcmerror = BCME_BADADDR; + MFREE(wl->osh, buf, MAX(ioc.len, WLC_IOCTL_MAXLEN)); +@@ -1680,6 +1687,39 @@ + return (OSL_ERROR(bcmerror)); + } + ++int ++wlc_ioctl_internal(struct net_device *dev, int cmd, void *buf, int len) ++{ ++ wl_info_t *wl; ++ wl_if_t *wlif; ++ int bcmerror; ++ ++ if (!dev) ++ return -ENETDOWN; ++ ++ wl = WL_INFO(dev); ++ wlif = WL_DEV_IF(dev); ++ if (wlif == NULL || wl == NULL || wl->dev == NULL) ++ return -ENETDOWN; ++ ++ bcmerror = 0; ++ ++ WL_TRACE(("wl%d: wlc_ioctl_internal: cmd 0x%x\n", wl->pub->unit, cmd)); ++ ++ WL_LOCK(wl); ++ if (!capable(CAP_NET_ADMIN)) { ++ bcmerror = BCME_EPERM; ++ } else { ++ bcmerror = wlc_ioctl(wl->wlc, cmd, buf, len, wlif->wlcif); ++ } ++ WL_UNLOCK(wl); ++ ++ ASSERT(VALID_BCMERROR(bcmerror)); ++ if (bcmerror != 0) ++ wl->pub->bcmerror = bcmerror; ++ return (OSL_ERROR(bcmerror)); ++} ++ + static struct net_device_stats* + wl_get_stats(struct net_device *dev) + { +@@ -2165,8 +2205,8 @@ + wlif = WL_DEV_IF(dev); + wl = WL_INFO(dev); + ++ skb->prev = NULL; + if (WL_ALL_PASSIVE_ENAB(wl) || (WL_RTR() && WL_CONFIG_SMP())) { +- skb->prev = NULL; + + TXQ_LOCK(wl); + +@@ -2298,9 +2338,19 @@ + } + + static void +-wl_timer(ulong data) +-{ +- wl_timer_t *t = (wl_timer_t *)data; ++wl_timer( ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) ++ struct timer_list *tl ++#else ++ ulong data ++#endif ++) { ++ wl_timer_t *t = ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) ++ from_timer(t, tl, timer); ++#else ++ (wl_timer_t *)data; ++#endif + + if (!WL_ALL_PASSIVE_ENAB(t->wl)) + _wl_timer(t); +@@ -2352,9 +2402,13 @@ + + bzero(t, sizeof(wl_timer_t)); + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) ++ timer_setup(&t->timer, wl_timer, 0); ++#else + init_timer(&t->timer); + t->timer.data = (ulong) t; + t->timer.function = wl_timer; ++#endif + t->wl = wl; + t->fn = fn; + t->arg = arg; +@@ -2449,6 +2503,9 @@ + { + struct sk_buff *oskb = (struct sk_buff *)p; + struct sk_buff *skb; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) ++ priv_link_t *priv_link; ++#endif + uchar *pdata; + uint len; + +@@ -2915,7 +2972,13 @@ + if (skb == NULL) return; + + skb->dev = wl->monitor_dev; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) ++ priv_link = MALLOC(wl->osh, sizeof(priv_link_t)); ++ priv_link = netdev_priv(skb->dev); ++ priv_link->last_rx = jiffies; ++#else + skb->dev->last_rx = jiffies; ++#endif + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) + skb_reset_mac_header(skb); + #else +@@ -3335,10 +3398,16 @@ + } + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0) + 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_read = wl_proc_read, ++ .proc_write = wl_proc_write, ++#endif + }; + #endif + +diff -Naur a/src/wl/sys/wl_linux.h b/src/wl/sys/wl_linux.h +--- a/src/wl/sys/wl_linux.h 2015-09-19 00:47:30.000000000 +0200 ++++ b/src/wl/sys/wl_linux.h 2020-12-14 13:37:21.522354770 +0100 +@@ -22,6 +22,7 @@ + #define _wl_linux_h_ + + #include <wlc_types.h> ++#include <wlc_pub.h> + + typedef struct wl_timer { + struct timer_list timer; +@@ -187,6 +188,7 @@ + extern int __devinit wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent); + extern void wl_free(wl_info_t *wl); + extern int wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); ++extern int wlc_ioctl_internal(struct net_device *dev, int cmd, void *buf, int len); + extern struct net_device * wl_netdev_get(wl_info_t *wl); + + #endif diff --git a/sys-kernel/bcmwl-dkms/files/kernel-5.18.patch b/sys-kernel/bcmwl-dkms/files/kernel-5.18.patch new file mode 100644 index 00000000..d837429a --- /dev/null +++ b/sys-kernel/bcmwl-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/bcmwl-dkms/files/kernel-6.0.patch b/sys-kernel/bcmwl-dkms/files/kernel-6.0.patch new file mode 100644 index 00000000..dcb55152 --- /dev/null +++ b/sys-kernel/bcmwl-dkms/files/kernel-6.0.patch @@ -0,0 +1,30 @@ +From dbee29df729e543a89b3f95c1436e982eb0047c1 Mon Sep 17 00:00:00 2001 +From: Joan Bruguera <joanbrugueram@gmail.com> +Date: Thu, 30 Jun 2022 02:15:35 +0200 +Subject: [PATCH] Tentative patch for broadcom-wl 6.30.223.271 driver for Linux 6.0-rc1 + +Applies on top of all the patches applied to broadcom-wl-dkms 6.30.223.271-33 on Arch Linux. +--- + src/wl/sys/wl_cfg80211_hybrid.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c +index d815b33..7faa735 100644 +--- a/src/wl/sys/wl_cfg80211_hybrid.c ++++ b/src/wl/sys/wl_cfg80211_hybrid.c +@@ -2381,7 +2381,12 @@ wl_bss_roaming_done(struct wl_cfg80211_priv *wl, struct net_device *ndev, + bss = cfg80211_get_bss(wl_to_wiphy(wl), NULL, (s8 *)&wl->bssid, + ssid->SSID, ssid->SSID_len, WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); + struct cfg80211_roam_info roam_info = { ++// Rel. commit "cfg80211: Indicate MLO connection info in connect and roam callbacks" (Veerendranath Jakkam, Wed Jun 8) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) + .bss = bss, ++#else ++ .links[0].bss = bss, ++#endif + .req_ie = conn_info->req_ie, + .req_ie_len = conn_info->req_ie_len, + .resp_ie = conn_info->resp_ie, +-- +2.37.0 + diff --git a/sys-kernel/bcmwl-dkms/files/makefile.patch b/sys-kernel/bcmwl-dkms/files/makefile.patch new file mode 100644 index 00000000..d5b97fe8 --- /dev/null +++ b/sys-kernel/bcmwl-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` |