kernel: broadcom-wl: add patch dropping set_fs and get_fs for > 5.13

Drop set_fs and get_fs since they are not present in kernel > 5.13.
Fix compilation warning:
/__w/openwrt/openwrt/openwrt/build_dir/target-mipsel-openwrt-linux-musl_musl/linux-bcm47xx_generic/broadcom-wl-5.10.56.27.3/driver/wl_iw.c: In function 'dev_wlc_ioctl':
/__w/openwrt/openwrt/openwrt/build_dir/target-mipsel-openwrt-linux-musl_musl/linux-bcm47xx_generic/broadcom-wl-5.10.56.27.3/driver/wl_iw.c:121:14: error: implicit declaration of function 'get_fs'; did you mean 'sget_fc'? [-Werror=implicit-function-declaration]
  121 |         fs = get_fs();
      |              ^~~~~~
      |              sget_fc
/__w/openwrt/openwrt/openwrt/build_dir/target-mipsel-openwrt-linux-musl_musl/linux-bcm47xx_generic/broadcom-wl-5.10.56.27.3/driver/wl_iw.c:121:14: error: incompatible types when assigning to type 'mm_segment_t' from type 'int'
/__w/openwrt/openwrt/openwrt/build_dir/target-mipsel-openwrt-linux-musl_musl/linux-bcm47xx_generic/broadcom-wl-5.10.56.27.3/driver/wl_iw.c:122:9: error: implicit declaration of function 'set_fs'; did you mean 'sget_fc'? [-Werror=implicit-function-declaration]
  122 |         set_fs(KERNEL_DS);
      |         ^~~~~~
      |         sget_fc
/__w/openwrt/openwrt/openwrt/build_dir/target-mipsel-openwrt-linux-musl_musl/linux-bcm47xx_generic/broadcom-wl-5.10.56.27.3/driver/wl_iw.c:122:16: error: 'KERNEL_DS' undeclared (first use in this function); did you mean 'KERNFS_NS'?
  122 |         set_fs(KERNEL_DS);
      |                ^~~~~~~~~
      |                KERNFS_NS

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
Christian Marangi 2023-05-09 22:04:17 +02:00
parent 40b075042b
commit f3fc9ac1aa
No known key found for this signature in database
GPG Key ID: AC001D09ADBFEAD7

View File

@ -0,0 +1,27 @@
--- a/driver/wl_iw.c
+++ a/driver/wl_iw.c
@@ -100,7 +100,9 @@ dev_wlc_ioctl(
{
struct ifreq ifr;
wl_ioctl_t ioc;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0)
mm_segment_t fs;
+#endif
int ret;
memset(&ioc, 0, sizeof(ioc));
@@ -118,10 +120,14 @@ dev_wlc_ioctl(
dev_open(dev);
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0)
fs = get_fs();
set_fs(KERNEL_DS);
+#endif
ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0)
set_fs(fs);
+#endif
return ret;
}