1 diff -urNp -x '*.orig' wl-6.30.223.271.org/src/wl/sys/wl_cfg80211_hybrid.c wl-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c
2 --- wl-6.30.223.271.org/src/wl/sys/wl_cfg80211_hybrid.c 2021-02-25 20:01:39.220996979 +0100
3 +++ wl-6.30.223.271/src/wl/sys/wl_cfg80211_hybrid.c 2021-02-25 20:01:39.354330631 +0100
6 #include <proto/802.11.h>
7 #include <wl_cfg80211_hybrid.h>
10 #define EVENT_TYPE(e) dtoh32((e)->event_type)
11 #define EVENT_FLAGS(e) dtoh16((e)->flags)
12 @@ -449,30 +450,8 @@ static void key_endian_to_host(struct wl
14 wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len)
17 - struct wl_ioctl ioc;
21 BUG_ON(len < sizeof(int));
23 - memset(&ioc, 0, sizeof(ioc));
27 - strcpy(ifr.ifr_name, dev->name);
28 - ifr.ifr_data = (caddr_t)&ioc;
32 -#if defined(WL_USE_NETDEV_OPS)
33 - err = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
35 - err = dev->do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
40 + return wlc_ioctl_internal(dev, cmd, arg, len);
44 diff -urNp -x '*.orig' wl-6.30.223.271.org/src/wl/sys/wl_iw.c wl-6.30.223.271/src/wl/sys/wl_iw.c
45 --- wl-6.30.223.271.org/src/wl/sys/wl_iw.c 2015-09-19 00:47:15.000000000 +0200
46 +++ wl-6.30.223.271/src/wl/sys/wl_iw.c 2021-02-25 20:01:39.354330631 +0100
47 @@ -37,6 +37,7 @@ typedef const struct si_pub si_t;
51 +#include <wl_linux.h>
53 extern bool wl_iw_conn_status_str(uint32 event_type, uint32 status,
54 uint32 reason, char* stringBuf, uint buflen);
55 @@ -103,29 +104,7 @@ dev_wlc_ioctl(
64 - memset(&ioc, 0, sizeof(ioc));
69 - strcpy(ifr.ifr_name, dev->name);
70 - ifr.ifr_data = (caddr_t) &ioc;
74 -#if defined(WL_USE_NETDEV_OPS)
75 - ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
77 - ret = dev->do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
82 + return wlc_ioctl_internal(dev, cmd, arg, len);
86 diff -urNp -x '*.orig' wl-6.30.223.271.org/src/wl/sys/wl_linux.c wl-6.30.223.271/src/wl/sys/wl_linux.c
87 --- wl-6.30.223.271.org/src/wl/sys/wl_linux.c 2021-02-25 20:01:39.220996979 +0100
88 +++ wl-6.30.223.271/src/wl/sys/wl_linux.c 2021-02-25 20:01:39.354330631 +0100
89 @@ -1662,10 +1662,7 @@ wl_ioctl(struct net_device *dev, struct
93 - if (segment_eq(get_fs(), KERNEL_DS))
98 if (!(buf = (void *) MALLOC(wl->osh, MAX(ioc.len, WLC_IOCTL_MAXLEN)))) {
99 bcmerror = BCME_NORESOURCE;
101 @@ -1686,7 +1683,7 @@ wl_ioctl(struct net_device *dev, struct
105 - if (ioc.buf && (ioc.buf != buf)) {
107 if (copy_to_user(ioc.buf, buf, ioc.len))
108 bcmerror = BCME_BADADDR;
109 MFREE(wl->osh, buf, MAX(ioc.len, WLC_IOCTL_MAXLEN));
110 @@ -1696,6 +1693,39 @@ done2:
111 ASSERT(VALID_BCMERROR(bcmerror));
113 wl->pub->bcmerror = bcmerror;
114 + return (OSL_ERROR(bcmerror));
118 +wlc_ioctl_internal(struct net_device *dev, int cmd, void *buf, int len)
128 + wlif = WL_DEV_IF(dev);
129 + if (wlif == NULL || wl == NULL || wl->dev == NULL)
134 + WL_TRACE(("wl%d: wlc_ioctl_internal: cmd 0x%x\n", wl->pub->unit, cmd));
137 + if (!capable(CAP_NET_ADMIN)) {
138 + bcmerror = BCME_EPERM;
140 + bcmerror = wlc_ioctl(wl->wlc, cmd, buf, len, wlif->wlcif);
144 + ASSERT(VALID_BCMERROR(bcmerror));
146 + wl->pub->bcmerror = bcmerror;
147 return (OSL_ERROR(bcmerror));
150 diff -urNp -x '*.orig' wl-6.30.223.271.org/src/wl/sys/wl_linux.h wl-6.30.223.271/src/wl/sys/wl_linux.h
151 --- wl-6.30.223.271.org/src/wl/sys/wl_linux.h 2015-09-19 00:47:15.000000000 +0200
152 +++ wl-6.30.223.271/src/wl/sys/wl_linux.h 2021-02-25 20:01:39.354330631 +0100
156 #include <wlc_types.h>
157 +#include <wlc_pub.h>
159 typedef struct wl_timer {
160 struct timer_list timer;
161 @@ -187,6 +188,7 @@ extern irqreturn_t wl_isr(int irq, void
162 extern int __devinit wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
163 extern void wl_free(wl_info_t *wl);
164 extern int wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
165 +extern int wlc_ioctl_internal(struct net_device *dev, int cmd, void *buf, int len);
166 extern struct net_device * wl_netdev_get(wl_info_t *wl);
169 diff -urNp -x '*.orig' wl-6.30.223.271.org/src/wl/sys/wlc_pub.h wl-6.30.223.271/src/wl/sys/wlc_pub.h
170 --- wl-6.30.223.271.org/src/wl/sys/wlc_pub.h 2015-09-19 00:47:15.000000000 +0200
171 +++ wl-6.30.223.271/src/wl/sys/wlc_pub.h 2021-02-25 20:01:39.354330631 +0100
174 #include <wlc_types.h>
175 #include <wlc_utils.h>
176 +#include <siutils.h>
177 #include "proto/802.11.h"
178 #include "proto/bcmevent.h"