summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/wil6210/cfg80211.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-10-19 02:50:11 +0300
committerKalle Valo <kvalo@codeaurora.org>2021-10-20 12:39:44 +0300
commitc7b6128a8db1db6dd1a30a1bac72bcb1e57a094f (patch)
tree63500c3de80a335e268fecb27b13a833aac51e50 /drivers/net/wireless/ath/wil6210/cfg80211.c
parentf2e2a083be8a99e7141d7f2ccaa78fba771816e1 (diff)
downloadlinux-c7b6128a8db1db6dd1a30a1bac72bcb1e57a094f.tar.xz
wil6210: use eth_hw_addr_set()
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. Do the special encoding on the stack, then copy the address. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20211018235021.1279697-6-kuba@kernel.org
Diffstat (limited to 'drivers/net/wireless/ath/wil6210/cfg80211.c')
-rw-r--r--drivers/net/wireless/ath/wil6210/cfg80211.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c
index bd8d0a54af77..764d1d14132b 100644
--- a/drivers/net/wireless/ath/wil6210/cfg80211.c
+++ b/drivers/net/wireless/ath/wil6210/cfg80211.c
@@ -725,9 +725,11 @@ wil_cfg80211_add_iface(struct wiphy *wiphy, const char *name,
if (is_valid_ether_addr(params->macaddr)) {
eth_hw_addr_set(ndev, params->macaddr);
} else {
- eth_hw_addr_set(ndev, ndev_main->perm_addr);
- ndev->dev_addr[0] = (ndev->dev_addr[0] ^ (1 << vif->mid)) |
- 0x2; /* locally administered */
+ u8 addr[ETH_ALEN];
+
+ ether_addr_copy(addr, ndev_main->perm_addr);
+ addr[0] = (addr[0] ^ (1 << vif->mid)) | 0x2; /* locally administered */
+ eth_hw_addr_set(ndev, addr);
}
wdev = vif_to_wdev(vif);
ether_addr_copy(wdev->address, ndev->dev_addr);