broadcom-wl: fix compilation with kernel 5.4
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Fri, 3 Apr 2020 15:16:35 +0000 (17:16 +0200)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Sun, 12 Apr 2020 10:41:12 +0000 (12:41 +0200)
This adds two fixes for compilation with kernel 5.4:

1. dev_open from include/linux/netdevice.h needs a second parameter
   since kernel 5.0:
   00f54e68924e ("net: core: dev: Add extack argument to dev_open()")
2. get_ds() macro definition has been dropped since kernel 5.1:
   736706bee329 ("get rid of legacy 'get_ds()' function")
   Since get_ds() has been just a macro before, replace it in
   the driver instead of creating a version switch.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
package/kernel/broadcom-wl/patches/916-fix-compilation-for-5_4.patch [new file with mode: 0644]

diff --git a/package/kernel/broadcom-wl/patches/916-fix-compilation-for-5_4.patch b/package/kernel/broadcom-wl/patches/916-fix-compilation-for-5_4.patch
new file mode 100644 (file)
index 0000000..bc7b63d
--- /dev/null
@@ -0,0 +1,18 @@
+--- a/driver/wl_iw.c
++++ b/driver/wl_iw.c
+@@ -112,10 +112,14 @@
+       ifr.ifr_data = (caddr_t) &ioc;
+       /* Must be up for virtually all useful ioctls */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
++      dev_open(dev, NULL);
++#else
+       dev_open(dev);
++#endif
+       fs = get_fs();
+-      set_fs(get_ds());
++      set_fs(KERNEL_DS);
+       ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
+       set_fs(fs);