55 lines
1.6 KiB
Diff
55 lines
1.6 KiB
Diff
Source: Arch Linux
|
|
--- a/src/wl/sys/wl_linux.c
|
|
+++ b/src/wl/sys/wl_linux.c
|
|
@@ -93,6 +93,10 @@ struct iw_statistics *wl_get_wireless_st
|
|
|
|
#include <wlc_wowl.h>
|
|
|
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)
|
|
+#define PDE_DATA pde_data
|
|
+#endif
|
|
+
|
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
|
|
static void wl_timer(ulong data);
|
|
#else
|
|
@@ -493,6 +497,12 @@ wl_if_setup(struct net_device *dev)
|
|
#endif
|
|
}
|
|
|
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
|
|
+static inline void eth_hw_addr_set(struct net_device *dev, const void *addr) {
|
|
+ memcpy(dev->dev_addr, addr, ETHER_ADDR_LEN);
|
|
+}
|
|
+#endif
|
|
+
|
|
static wl_info_t *
|
|
wl_attach(uint16 vendor, uint16 device, ulong regs,
|
|
uint bustype, void *btparam, uint irq, uchar* bar1_addr, uint32 bar1_size)
|
|
@@ -637,7 +647,7 @@ wl_attach(uint16 vendor, uint16 device,
|
|
WL_ERROR(("wl%d: Error setting MAC ADDRESS\n", unit));
|
|
}
|
|
#endif
|
|
- bcopy(&wl->pub->cur_etheraddr, dev->dev_addr, ETHER_ADDR_LEN);
|
|
+ eth_hw_addr_set(dev, wl->pub->cur_etheraddr.octet);
|
|
|
|
online_cpus = 1;
|
|
|
|
@@ -1838,7 +1848,7 @@ wl_set_mac_address(struct net_device *de
|
|
|
|
WL_LOCK(wl);
|
|
|
|
- bcopy(sa->sa_data, dev->dev_addr, ETHER_ADDR_LEN);
|
|
+ eth_hw_addr_set(dev, sa->sa_data);
|
|
err = wlc_iovar_op(wl->wlc, "cur_etheraddr", NULL, 0, sa->sa_data, ETHER_ADDR_LEN,
|
|
IOV_SET, (WL_DEV_IF(dev))->wlcif);
|
|
WL_UNLOCK(wl);
|
|
@@ -3021,7 +3031,7 @@ _wl_add_monitor_if(wl_task_t *task)
|
|
else
|
|
dev->type = ARPHRD_IEEE80211_RADIOTAP;
|
|
|
|
- bcopy(wl->dev->dev_addr, dev->dev_addr, ETHER_ADDR_LEN);
|
|
+ eth_hw_addr_set(dev, wl->dev->dev_addr);
|
|
|
|
#if defined(WL_USE_NETDEV_OPS)
|
|
dev->netdev_ops = &wl_netdev_monitor_ops;
|