Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] broadcom-wl-dkms: patch for kernel 5.10
@ 2021-01-27 22:19 ibhagwan
  2021-01-28  1:46 ` abenson
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: ibhagwan @ 2021-01-27 22:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 690 bytes --]

There is a new pull request by ibhagwan against master on the void-packages repository

https://github.com/ibhagwan/void-packages broadcom-wl-dkms-linux-5.10
https://github.com/void-linux/void-packages/pull/28275

broadcom-wl-dkms: patch for kernel 5.10
linux-5.10 kernel broke `broadcom-wl-dkms`, added [this patch](https://gist.github.com/joanbm/5c640ac074d27fd1d82c74a5b67a1290) to make it work.

Also removed the `linux-5.9.patch` as it is now redundant (included in the 5.10 patch) and also creates a conflict since the patches are executed alphabetically (i.e. 5.9 is applied after 5.10).


A patch file from https://github.com/void-linux/void-packages/pull/28275.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-broadcom-wl-dkms-linux-5.10-28275.patch --]
[-- Type: text/x-diff, Size: 7446 bytes --]

From 8b2b49b32f547578f54cd3d703fd7bba6218471b Mon Sep 17 00:00:00 2001
From: bhagwan <bhagwan@disroot.org>
Date: Wed, 27 Jan 2021 13:59:23 -0800
Subject: [PATCH] broadcom-wl-dkms patch for kernel 5.10

---
 .../broadcom-wl-dkms/patches/linux-5.10.patch | 179 ++++++++++++++++++
 .../broadcom-wl-dkms/patches/linux-5.9.patch  |  36 ----
 srcpkgs/broadcom-wl-dkms/template             |   2 +-
 3 files changed, 180 insertions(+), 37 deletions(-)
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch
 delete mode 100644 srcpkgs/broadcom-wl-dkms/patches/linux-5.9.patch

diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch b/srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch
new file mode 100644
index 00000000000..429db60e730
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch
@@ -0,0 +1,179 @@
+diff -u -r src/wl/sys/wl_cfg80211_hybrid.c src/wl/sys/wl_cfg80211_hybrid.c
+--- src/wl/sys/wl_cfg80211_hybrid.c	2021-01-25 08:55:05.625224400 -0800
++++ src/wl/sys/wl_cfg80211_hybrid.c	2021-01-25 08:58:30.000982902 -0800
+@@ -41,6 +41,7 @@
+ #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)
+@@ -446,30 +447,8 @@
+ 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
+diff -u -r src/wl/sys/wl_iw.c src/wl/sys/wl_iw.c
+--- src/wl/sys/wl_iw.c	2021-01-25 09:00:13.163543809 -0800
++++ src/wl/sys/wl_iw.c	2021-01-25 09:02:04.218646005 -0800
+@@ -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);
+@@ -106,29 +107,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 -u -r src/wl/sys/wl_linux.c src/wl/sys/wl_linux.c
+--- src/wl/sys/wl_linux.c	2021-01-25 09:02:08.055475147 -0800
++++ src/wl/sys/wl_linux.c	2021-01-25 09:06:11.894764339 -0800
+@@ -1650,10 +1650,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;
+@@ -1674,7 +1671,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));
+@@ -1684,6 +1681,39 @@
+ 	ASSERT(VALID_BCMERROR(bcmerror));
+ 	if (bcmerror != 0)
+ 		wl->pub->bcmerror = bcmerror;
++	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));
+ }
+ 
+diff -u -r src/wl/sys/wl_linux.h src/wl/sys/wl_linux.h
+--- src/wl/sys/wl_linux.h	2021-01-25 09:06:15.188672391 -0800
++++ src/wl/sys/wl_linux.h	2021-01-25 09:07:49.457810535 -0800
+@@ -29,6 +29,7 @@
+ #define _wl_linux_h_
+ 
+ #include <wlc_types.h>
++#include <wlc_pub.h>
+ 
+ typedef struct wl_timer {
+ 	struct timer_list 	timer;
+@@ -194,6 +195,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 -u -r src/wl/sys/wlc_pub.h src/wl/sys/wlc_pub.h
+--- src/wl/sys/wlc_pub.h	2021-01-25 09:07:54.543645032 -0800
++++ src/wl/sys/wlc_pub.h	2021-01-25 09:08:10.772110464 -0800
+@@ -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 --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.9.patch b/srcpkgs/broadcom-wl-dkms/patches/linux-5.9.patch
deleted file mode 100644
index c0af5c181dd..00000000000
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.9.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff -u -r src/wl/sys/wl_cfg80211_hybrid.c src/wl/sys/wl_cfg80211_hybrid.c
---- src/wl/sys/wl_cfg80211_hybrid.c	2015-09-18 22:47:30.000000000 +0000
-+++ src/wl/sys/wl_cfg80211_hybrid.c	2020-10-12 21:20:05.200372484 +0000
-@@ -450,7 +450,7 @@
- 	ifr.ifr_data = (caddr_t)&ioc;
- 
- 	fs = get_fs();
--	set_fs(get_ds());
-+	set_fs(KERNEL_DS);
- #if defined(WL_USE_NETDEV_OPS)
- 	err = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
- #else
-diff -u -r src/wl/sys/wl_iw.c src/wl/sys/wl_iw.c
---- src/wl/sys/wl_iw.c	2015-09-18 22:47:30.000000000 +0000
-+++ src/wl/sys/wl_iw.c	2020-10-12 21:19:51.426836804 +0000
-@@ -117,7 +117,7 @@
- 	ifr.ifr_data = (caddr_t) &ioc;
- 
- 	fs = get_fs();
--	set_fs(get_ds());
-+	set_fs(KERNEL_DS);
- #if defined(WL_USE_NETDEV_OPS)
- 	ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
- #else
-diff -u -r src/wl/sys/wl_linux.c src/wl/sys/wl_linux.c
---- src/wl/sys/wl_linux.c	2020-10-12 21:19:15.256305165 +0000
-+++ src/wl/sys/wl_linux.c	2020-10-12 21:20:38.687530895 +0000
-@@ -1643,7 +1643,7 @@
- 		goto done2;
- 	}
- 
--	if (segment_eq(get_fs(), KERNEL_DS))
-+	if (get_fs().seg == KERNEL_DS.seg)
- 		buf = ioc.buf;
- 
- 	else if (ioc.buf) {
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 59a0df64183..55bc9c0e1d3 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=10
+revision=11
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Proprietary Broadcom license"
 homepage="http://broadcom.com"

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: broadcom-wl-dkms: patch for kernel 5.10
  2021-01-27 22:19 [PR PATCH] broadcom-wl-dkms: patch for kernel 5.10 ibhagwan
@ 2021-01-28  1:46 ` abenson
  2021-01-28  1:47 ` abenson
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: abenson @ 2021-01-28  1:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 247 bytes --]

New comment by abenson on void-packages repository

https://github.com/void-linux/void-packages/pull/28275#issuecomment-768727961

Comment:
Can you include the full contents of the patch, including the header? Also a link at the top to the patch?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: broadcom-wl-dkms: patch for kernel 5.10
  2021-01-27 22:19 [PR PATCH] broadcom-wl-dkms: patch for kernel 5.10 ibhagwan
  2021-01-28  1:46 ` abenson
@ 2021-01-28  1:47 ` abenson
  2021-01-28  2:08 ` [PR PATCH] [Updated] " ibhagwan
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: abenson @ 2021-01-28  1:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 324 bytes --]

New comment by abenson on void-packages repository

https://github.com/void-linux/void-packages/pull/28275#issuecomment-768727961

Comment:
Can you include the full contents of the patch, including the header? Also a link at the top to the patch?

Edit: At least the full contents of the patch, including the mail header.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PR PATCH] [Updated] broadcom-wl-dkms: patch for kernel 5.10
  2021-01-27 22:19 [PR PATCH] broadcom-wl-dkms: patch for kernel 5.10 ibhagwan
  2021-01-28  1:46 ` abenson
  2021-01-28  1:47 ` abenson
@ 2021-01-28  2:08 ` ibhagwan
  2021-01-28  2:09 ` ibhagwan
  2021-01-29 14:19 ` [PR PATCH] [Merged]: " abenson
  4 siblings, 0 replies; 6+ messages in thread
From: ibhagwan @ 2021-01-28  2:08 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 695 bytes --]

There is an updated pull request by ibhagwan against master on the void-packages repository

https://github.com/ibhagwan/void-packages broadcom-wl-dkms-linux-5.10
https://github.com/void-linux/void-packages/pull/28275

broadcom-wl-dkms: patch for kernel 5.10
linux-5.10 kernel broke `broadcom-wl-dkms`, added [this patch](https://gist.github.com/joanbm/5c640ac074d27fd1d82c74a5b67a1290) to make it work.

Also removed the `linux-5.9.patch` as it is now redundant (included in the 5.10 patch) and also creates a conflict since the patches are executed alphabetically (i.e. 5.9 is applied after 5.10).


A patch file from https://github.com/void-linux/void-packages/pull/28275.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-broadcom-wl-dkms-linux-5.10-28275.patch --]
[-- Type: text/x-diff, Size: 9633 bytes --]

From 8b2b49b32f547578f54cd3d703fd7bba6218471b Mon Sep 17 00:00:00 2001
From: bhagwan <bhagwan@disroot.org>
Date: Wed, 27 Jan 2021 13:59:23 -0800
Subject: [PATCH 1/2] broadcom-wl-dkms patch for kernel 5.10

---
 .../broadcom-wl-dkms/patches/linux-5.10.patch | 179 ++++++++++++++++++
 .../broadcom-wl-dkms/patches/linux-5.9.patch  |  36 ----
 srcpkgs/broadcom-wl-dkms/template             |   2 +-
 3 files changed, 180 insertions(+), 37 deletions(-)
 create mode 100644 srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch
 delete mode 100644 srcpkgs/broadcom-wl-dkms/patches/linux-5.9.patch

diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch b/srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch
new file mode 100644
index 00000000000..429db60e730
--- /dev/null
+++ b/srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch
@@ -0,0 +1,179 @@
+diff -u -r src/wl/sys/wl_cfg80211_hybrid.c src/wl/sys/wl_cfg80211_hybrid.c
+--- src/wl/sys/wl_cfg80211_hybrid.c	2021-01-25 08:55:05.625224400 -0800
++++ src/wl/sys/wl_cfg80211_hybrid.c	2021-01-25 08:58:30.000982902 -0800
+@@ -41,6 +41,7 @@
+ #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)
+@@ -446,30 +447,8 @@
+ 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
+diff -u -r src/wl/sys/wl_iw.c src/wl/sys/wl_iw.c
+--- src/wl/sys/wl_iw.c	2021-01-25 09:00:13.163543809 -0800
++++ src/wl/sys/wl_iw.c	2021-01-25 09:02:04.218646005 -0800
+@@ -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);
+@@ -106,29 +107,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 -u -r src/wl/sys/wl_linux.c src/wl/sys/wl_linux.c
+--- src/wl/sys/wl_linux.c	2021-01-25 09:02:08.055475147 -0800
++++ src/wl/sys/wl_linux.c	2021-01-25 09:06:11.894764339 -0800
+@@ -1650,10 +1650,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;
+@@ -1674,7 +1671,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));
+@@ -1684,6 +1681,39 @@
+ 	ASSERT(VALID_BCMERROR(bcmerror));
+ 	if (bcmerror != 0)
+ 		wl->pub->bcmerror = bcmerror;
++	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));
+ }
+ 
+diff -u -r src/wl/sys/wl_linux.h src/wl/sys/wl_linux.h
+--- src/wl/sys/wl_linux.h	2021-01-25 09:06:15.188672391 -0800
++++ src/wl/sys/wl_linux.h	2021-01-25 09:07:49.457810535 -0800
+@@ -29,6 +29,7 @@
+ #define _wl_linux_h_
+ 
+ #include <wlc_types.h>
++#include <wlc_pub.h>
+ 
+ typedef struct wl_timer {
+ 	struct timer_list 	timer;
+@@ -194,6 +195,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 -u -r src/wl/sys/wlc_pub.h src/wl/sys/wlc_pub.h
+--- src/wl/sys/wlc_pub.h	2021-01-25 09:07:54.543645032 -0800
++++ src/wl/sys/wlc_pub.h	2021-01-25 09:08:10.772110464 -0800
+@@ -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 --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.9.patch b/srcpkgs/broadcom-wl-dkms/patches/linux-5.9.patch
deleted file mode 100644
index c0af5c181dd..00000000000
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.9.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff -u -r src/wl/sys/wl_cfg80211_hybrid.c src/wl/sys/wl_cfg80211_hybrid.c
---- src/wl/sys/wl_cfg80211_hybrid.c	2015-09-18 22:47:30.000000000 +0000
-+++ src/wl/sys/wl_cfg80211_hybrid.c	2020-10-12 21:20:05.200372484 +0000
-@@ -450,7 +450,7 @@
- 	ifr.ifr_data = (caddr_t)&ioc;
- 
- 	fs = get_fs();
--	set_fs(get_ds());
-+	set_fs(KERNEL_DS);
- #if defined(WL_USE_NETDEV_OPS)
- 	err = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
- #else
-diff -u -r src/wl/sys/wl_iw.c src/wl/sys/wl_iw.c
---- src/wl/sys/wl_iw.c	2015-09-18 22:47:30.000000000 +0000
-+++ src/wl/sys/wl_iw.c	2020-10-12 21:19:51.426836804 +0000
-@@ -117,7 +117,7 @@
- 	ifr.ifr_data = (caddr_t) &ioc;
- 
- 	fs = get_fs();
--	set_fs(get_ds());
-+	set_fs(KERNEL_DS);
- #if defined(WL_USE_NETDEV_OPS)
- 	ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
- #else
-diff -u -r src/wl/sys/wl_linux.c src/wl/sys/wl_linux.c
---- src/wl/sys/wl_linux.c	2020-10-12 21:19:15.256305165 +0000
-+++ src/wl/sys/wl_linux.c	2020-10-12 21:20:38.687530895 +0000
-@@ -1643,7 +1643,7 @@
- 		goto done2;
- 	}
- 
--	if (segment_eq(get_fs(), KERNEL_DS))
-+	if (get_fs().seg == KERNEL_DS.seg)
- 		buf = ioc.buf;
- 
- 	else if (ioc.buf) {
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 59a0df64183..55bc9c0e1d3 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=10
+revision=11
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Proprietary Broadcom license"
 homepage="http://broadcom.com"

From e442455d6474833e83271ed541831f3b7c9bf500 Mon Sep 17 00:00:00 2001
From: bhagwan <bhagwan@disroot.org>
Date: Wed, 27 Jan 2021 18:08:00 -0800
Subject: [PATCH 2/2] added broadcom-wl-dkms linux-5.10 patch source and
 commetary

---
 .../broadcom-wl-dkms/patches/linux-5.10.patch | 27 +++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch b/srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch
index 429db60e730..b3b136f5586 100644
--- a/srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch
+++ b/srcpkgs/broadcom-wl-dkms/patches/linux-5.10.patch
@@ -1,3 +1,30 @@
+https://gist.github.com/joanbm/5c640ac074d27fd1d82c74a5b67a1290
+
+From f3d652840f8dd959395065a1cf67ca40b04ec69b Mon Sep 17 00:00:00 2001
+From: Joan Bruguera <joanbrugueram@gmail.com>
+Date: Tue, 13 Oct 2020 19:35:55 +0200
+Subject: [PATCH] Get rid of get_fs/set_fs calls in Broadcom WL driver.
+
+Tentative patch for broadcom-wl 6.30.223.271 driver for Linux 5.10 (tested -rc1 up to 5.10.1)
+
+Applies on top of all the patches applied to broadcom-wl-dkms 6.30.223.271-23 on Arch Linux.
+
+NB: Some checks in wlc_ioctl_internal are likely superfluous,
+    but I'm not familiar enough with the driver to remove them with confidence.
+
+See also: https://lwn.net/Articles/722267/
+          https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=47058bb54b57962b3958a936ddbc59355e4c5504
+          https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5e6e9852d6f76e01b2e6803c74258afa5b432bc5
+
+Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
+---
+ src/wl/sys/wl_cfg80211_hybrid.c | 25 ++-------------------
+ src/wl/sys/wl_iw.c              | 25 ++-------------------
+ src/wl/sys/wl_linux.c           | 40 ++++++++++++++++++++++++++++-----
+ src/wl/sys/wl_linux.h           |  2 ++
+ src/wl/sys/wlc_pub.h            |  1 +
+ 5 files changed, 42 insertions(+), 51 deletions(-)
+
 diff -u -r src/wl/sys/wl_cfg80211_hybrid.c src/wl/sys/wl_cfg80211_hybrid.c
 --- src/wl/sys/wl_cfg80211_hybrid.c	2021-01-25 08:55:05.625224400 -0800
 +++ src/wl/sys/wl_cfg80211_hybrid.c	2021-01-25 08:58:30.000982902 -0800

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: broadcom-wl-dkms: patch for kernel 5.10
  2021-01-27 22:19 [PR PATCH] broadcom-wl-dkms: patch for kernel 5.10 ibhagwan
                   ` (2 preceding siblings ...)
  2021-01-28  2:08 ` [PR PATCH] [Updated] " ibhagwan
@ 2021-01-28  2:09 ` ibhagwan
  2021-01-29 14:19 ` [PR PATCH] [Merged]: " abenson
  4 siblings, 0 replies; 6+ messages in thread
From: ibhagwan @ 2021-01-28  2:09 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 340 bytes --]

New comment by ibhagwan on void-packages repository

https://github.com/void-linux/void-packages/pull/28275#issuecomment-768745149

Comment:
> Can you include the full contents of the patch, including the header? Also a link at the top to the patch?
> 
> Edit: At least the full contents of the patch, including the mail header.

done.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PR PATCH] [Merged]: broadcom-wl-dkms: patch for kernel 5.10
  2021-01-27 22:19 [PR PATCH] broadcom-wl-dkms: patch for kernel 5.10 ibhagwan
                   ` (3 preceding siblings ...)
  2021-01-28  2:09 ` ibhagwan
@ 2021-01-29 14:19 ` abenson
  4 siblings, 0 replies; 6+ messages in thread
From: abenson @ 2021-01-29 14:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 517 bytes --]

There's a merged pull request on the void-packages repository

broadcom-wl-dkms: patch for kernel 5.10
https://github.com/void-linux/void-packages/pull/28275

Description:
linux-5.10 kernel broke `broadcom-wl-dkms`, added [this patch](https://gist.github.com/joanbm/5c640ac074d27fd1d82c74a5b67a1290) to make it work.

Also removed the `linux-5.9.patch` as it is now redundant (included in the 5.10 patch) and also creates a conflict since the patches are executed alphabetically (i.e. 5.9 is applied after 5.10).


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-29 14:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-27 22:19 [PR PATCH] broadcom-wl-dkms: patch for kernel 5.10 ibhagwan
2021-01-28  1:46 ` abenson
2021-01-28  1:47 ` abenson
2021-01-28  2:08 ` [PR PATCH] [Updated] " ibhagwan
2021-01-28  2:09 ` ibhagwan
2021-01-29 14:19 ` [PR PATCH] [Merged]: " abenson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).