wireless: use eth_hw_addr_set() instead of ether_addr_copy()
authorJakub Kicinski <kuba@kernel.org>
Mon, 18 Oct 2021 23:50:08 +0000 (16:50 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 20 Oct 2021 09:39:42 +0000 (12:39 +0300)
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.

Convert wireless from ether_addr_copy() to eth_hw_addr_set():

  @@
  expression dev, np;
  @@
  - ether_addr_copy(dev->dev_addr, np)
  + eth_hw_addr_set(dev, np)

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211018235021.1279697-3-kuba@kernel.org
drivers/net/wireless/ath/wil6210/cfg80211.c
drivers/net/wireless/ath/wil6210/main.c
drivers/net/wireless/marvell/mwifiex/main.c
drivers/net/wireless/quantenna/qtnfmac/core.c

index 1ff2679963f06dbd1ed47852284a1120fe9bba12..bd8d0a54af7700a795e35945c2d1b5ca42a49a6e 100644 (file)
@@ -723,9 +723,9 @@ wil_cfg80211_add_iface(struct wiphy *wiphy, const char *name,
        ndev = vif_to_ndev(vif);
        ether_addr_copy(ndev->perm_addr, ndev_main->perm_addr);
        if (is_valid_ether_addr(params->macaddr)) {
-               ether_addr_copy(ndev->dev_addr, params->macaddr);
+               eth_hw_addr_set(ndev, params->macaddr);
        } else {
-               ether_addr_copy(ndev->dev_addr, ndev_main->perm_addr);
+               eth_hw_addr_set(ndev, ndev_main->perm_addr);
                ndev->dev_addr[0] = (ndev->dev_addr[0] ^ (1 << vif->mid)) |
                        0x2; /* locally administered */
        }
index 3ba5b2550a8c191057326ae42fd4c848eb87abb0..7da87c9f363fdc437e409e02ec8dad3fe78f5e92 100644 (file)
@@ -1358,7 +1358,7 @@ static int wil_get_bl_info(struct wil6210_priv *wil)
        ether_addr_copy(ndev->perm_addr, mac);
        ether_addr_copy(wiphy->perm_addr, mac);
        if (!is_valid_ether_addr(ndev->dev_addr))
-               ether_addr_copy(ndev->dev_addr, mac);
+               eth_hw_addr_set(ndev, mac);
 
        if (rf_status) {/* bad RF cable? */
                wil_err(wil, "RF communication error 0x%04x",
@@ -1431,7 +1431,7 @@ static int wil_get_otp_info(struct wil6210_priv *wil)
        ether_addr_copy(ndev->perm_addr, mac);
        ether_addr_copy(wiphy->perm_addr, mac);
        if (!is_valid_ether_addr(ndev->dev_addr))
-               ether_addr_copy(ndev->dev_addr, mac);
+               eth_hw_addr_set(ndev, mac);
 
        return 0;
 }
@@ -1609,7 +1609,7 @@ int wil_reset(struct wil6210_priv *wil, bool load_fw)
                struct net_device *ndev = wil->main_ndev;
 
                ether_addr_copy(ndev->perm_addr, mac);
-               ether_addr_copy(ndev->dev_addr, ndev->perm_addr);
+               eth_hw_addr_set(ndev, ndev->perm_addr);
                return 0;
        }
 
index 58d434f1285d4026f68e15cc5f6ae4d2aec1fd65..19b996c6a2605af90416d979f599636ba9bac630 100644 (file)
@@ -1003,7 +1003,7 @@ int mwifiex_set_mac_address(struct mwifiex_private *priv,
                return ret;
        }
 
-       ether_addr_copy(dev->dev_addr, priv->curr_addr);
+       eth_hw_addr_set(dev, priv->curr_addr);
        return 0;
 }
 
index 907a1c2c1b6dfeb4a7498e2d707ee35a7138d038..2a63ffdc4b2c10ac4056bef3cc0af29b1e6ebf2f 100644 (file)
@@ -478,7 +478,7 @@ int qtnf_core_net_attach(struct qtnf_wmac *mac, struct qtnf_vif *vif,
        dev->needs_free_netdev = true;
        dev_net_set(dev, wiphy_net(wiphy));
        dev->ieee80211_ptr = &vif->wdev;
-       ether_addr_copy(dev->dev_addr, vif->mac_addr);
+       eth_hw_addr_set(dev, vif->mac_addr);
        dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
        dev->watchdog_timeo = QTNF_DEF_WDOG_TIMEOUT;
        dev->tx_queue_len = 100;