mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
mac80211: fix compile error (#9917)
This commit is contained in:
parent
3264f70ca0
commit
83c2394ea1
@ -2,50 +2,58 @@ diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/n
|
|||||||
index 44a11b0..178e692 100644
|
index 44a11b0..178e692 100644
|
||||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||||
@@ -244,7 +244,7 @@ static int brcmf_netdev_set_mac_address(struct net_device *ndev, void *addr)
|
@@ -245,7 +245,11 @@
|
||||||
} else {
|
} else {
|
||||||
brcmf_dbg(TRACE, "updated to %pM\n", sa->sa_data);
|
brcmf_dbg(TRACE, "updated to %pM\n", sa->sa_data);
|
||||||
memcpy(ifp->mac_addr, sa->sa_data, ETH_ALEN);
|
memcpy(ifp->mac_addr, sa->sa_data, ETH_ALEN);
|
||||||
- memcpy(ifp->ndev->dev_addr, ifp->mac_addr, ETH_ALEN);
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
|
||||||
|
memcpy(ifp->ndev->dev_addr, ifp->mac_addr, ETH_ALEN);
|
||||||
|
+#else
|
||||||
+ eth_hw_addr_set(ifp->ndev, ifp->mac_addr);
|
+ eth_hw_addr_set(ifp->ndev, ifp->mac_addr);
|
||||||
|
+#endif
|
||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@@ -423,6 +423,7 @@ void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb, bool inirq)
|
@@ -424,6 +428,7 @@
|
||||||
ifp->ndev->stats.rx_packets++;
|
ifp->ndev->stats.rx_packets++;
|
||||||
|
|
||||||
brcmf_dbg(DATA, "rx proto=0x%X\n", ntohs(skb->protocol));
|
brcmf_dbg(DATA, "rx proto=0x%X\n", ntohs(skb->protocol));
|
||||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
|
||||||
if (inirq) {
|
if (inirq) {
|
||||||
netif_rx(skb);
|
netif_rx(skb);
|
||||||
} else {
|
} else {
|
||||||
@@ -432,6 +433,10 @@ void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb, bool inirq)
|
@@ -433,6 +438,9 @@
|
||||||
*/
|
*/
|
||||||
netif_rx_ni(skb);
|
netif_rx_ni(skb);
|
||||||
}
|
}
|
||||||
+#else
|
+#else
|
||||||
+ netif_rx(skb);
|
+ netif_rx(skb);
|
||||||
+#endif
|
+#endif
|
||||||
+
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void brcmf_netif_mon_rx(struct brcmf_if *ifp, struct sk_buff *skb)
|
void brcmf_netif_mon_rx(struct brcmf_if *ifp, struct sk_buff *skb)
|
||||||
@@ -672,7 +677,7 @@ int brcmf_net_attach(struct brcmf_if *ifp, bool locked)
|
@@ -673,7 +681,11 @@
|
||||||
ndev->ethtool_ops = &brcmf_ethtool_ops;
|
ndev->ethtool_ops = &brcmf_ethtool_ops;
|
||||||
|
|
||||||
/* set the mac address & netns */
|
/* set the mac address & netns */
|
||||||
- memcpy(ndev->dev_addr, ifp->mac_addr, ETH_ALEN);
|
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
|
||||||
|
memcpy(ndev->dev_addr, ifp->mac_addr, ETH_ALEN);
|
||||||
|
+#else
|
||||||
+ eth_hw_addr_set(ifp->ndev, ifp->mac_addr);
|
+ eth_hw_addr_set(ifp->ndev, ifp->mac_addr);
|
||||||
|
+#endif
|
||||||
dev_net_set(ndev, wiphy_net(cfg_to_wiphy(drvr->config)));
|
dev_net_set(ndev, wiphy_net(cfg_to_wiphy(drvr->config)));
|
||||||
|
|
||||||
INIT_WORK(&ifp->multicast_work, _brcmf_set_multicast_list);
|
INIT_WORK(&ifp->multicast_work, _brcmf_set_multicast_list);
|
||||||
@@ -847,7 +852,7 @@ static int brcmf_net_p2p_attach(struct brcmf_if *ifp)
|
@@ -848,7 +860,11 @@
|
||||||
ndev->netdev_ops = &brcmf_netdev_ops_p2p;
|
ndev->netdev_ops = &brcmf_netdev_ops_p2p;
|
||||||
|
|
||||||
/* set the mac address */
|
/* set the mac address */
|
||||||
- memcpy(ndev->dev_addr, ifp->mac_addr, ETH_ALEN);
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
|
||||||
|
memcpy(ndev->dev_addr, ifp->mac_addr, ETH_ALEN);
|
||||||
|
+#else
|
||||||
+ eth_hw_addr_set(ndev, ifp->mac_addr);
|
+ eth_hw_addr_set(ndev, ifp->mac_addr);
|
||||||
|
+#endif
|
||||||
|
|
||||||
if (register_netdev(ndev) != 0) {
|
if (register_netdev(ndev) != 0) {
|
||||||
bphy_err(drvr, "couldn't register the p2p net device\n");
|
bphy_err(drvr, "couldn't register the p2p net device\n");
|
||||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
|
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
|
||||||
@ -100,26 +108,35 @@ diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
|
|||||||
index 57aa863..f5ebb5a 100644
|
index 57aa863..f5ebb5a 100644
|
||||||
--- a/net/mac80211/iface.c
|
--- a/net/mac80211/iface.c
|
||||||
+++ b/net/mac80211/iface.c
|
+++ b/net/mac80211/iface.c
|
||||||
@@ -1272,9 +1272,7 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
|
@@ -1274,9 +1274,13 @@
|
||||||
* this interface, if it has the special null one.
|
* this interface, if it has the special null one.
|
||||||
*/
|
*/
|
||||||
if (dev && is_zero_ether_addr(dev->dev_addr)) {
|
if (dev && is_zero_ether_addr(dev->dev_addr)) {
|
||||||
- memcpy(dev->dev_addr,
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
|
||||||
- local->hw.wiphy->perm_addr,
|
memcpy(dev->dev_addr,
|
||||||
- ETH_ALEN);
|
local->hw.wiphy->perm_addr,
|
||||||
+ eth_hw_addr_set(dev, local->hw.wiphy->perm_addr);
|
ETH_ALEN);
|
||||||
|
+#else
|
||||||
|
+ eth_hw_addr_set(ndev, params->macaddr);
|
||||||
|
+#endif
|
||||||
memcpy(dev->perm_addr, dev->dev_addr, ETH_ALEN);
|
memcpy(dev->perm_addr, dev->dev_addr, ETH_ALEN);
|
||||||
|
|
||||||
if (!is_valid_ether_addr(dev->dev_addr)) {
|
if (!is_valid_ether_addr(dev->dev_addr)) {
|
||||||
@@ -2134,9 +2132,9 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
|
@@ -2136,9 +2140,17 @@
|
||||||
|
|
||||||
ieee80211_assign_perm_addr(local, ndev->perm_addr, type);
|
ieee80211_assign_perm_addr(local, ndev->perm_addr, type);
|
||||||
if (is_valid_ether_addr(params->macaddr))
|
if (is_valid_ether_addr(params->macaddr))
|
||||||
- memcpy(ndev->dev_addr, params->macaddr, ETH_ALEN);
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
|
||||||
|
memcpy(ndev->dev_addr, params->macaddr, ETH_ALEN);
|
||||||
|
+#else
|
||||||
+ eth_hw_addr_set(ndev, params->macaddr);
|
+ eth_hw_addr_set(ndev, params->macaddr);
|
||||||
|
+#endif
|
||||||
else
|
else
|
||||||
- memcpy(ndev->dev_addr, ndev->perm_addr, ETH_ALEN);
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
|
||||||
|
memcpy(ndev->dev_addr, ndev->perm_addr, ETH_ALEN);
|
||||||
|
+#else
|
||||||
+ eth_hw_addr_set(ndev, ndev->perm_addr);
|
+ eth_hw_addr_set(ndev, ndev->perm_addr);
|
||||||
|
+#endif
|
||||||
SET_NETDEV_DEV(ndev, wiphy_dev(local->hw.wiphy));
|
SET_NETDEV_DEV(ndev, wiphy_dev(local->hw.wiphy));
|
||||||
|
|
||||||
/* don't use IEEE80211_DEV_TO_SUB_IF -- it checks too much */
|
/* don't use IEEE80211_DEV_TO_SUB_IF -- it checks too much */
|
||||||
|
Loading…
Reference in New Issue
Block a user