Compile errors with broadcom-sta and kernel 5.9

The net-wireless/broadcom-sta package does compile with the 5.9 versions of the kernel. Specifically, the current driver version 6.30.223.271-r6. The following patch will allow compiling of a working driver.

I named the following patch linux-5.9.patch and placed in:

/etc/portage/patches/net-wireless/broadcom-sta-6.30.223.271-r6

--- a/src/wl/sys/wl_linux.c	2020-11-16 06:13:53.274122141 -0500
+++ b/src/wl/sys/wl_linux.c	2020-11-16 05:25:24.506040486 -0500
@@ -1662,8 +1662,13 @@
 		goto done2;
 	}
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
+       if (uaccess_kernel())
+               buf = ioc.buf;
+#else
 	if (segment_eq(get_fs(), KERNEL_DS))
 		buf = ioc.buf;
+#endif
 
 	else if (ioc.buf) {
 		if (!(buf = (void *) MALLOC(wl->osh, MAX(ioc.len, WLC_IOCTL_MAXLEN)))) {

Leave a Reply