Commit f2e2a083 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by Kalle Valo

ath6kl: use eth_hw_addr_set()

Commit 406f42fa ("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: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211018235021.1279697-5-kuba@kernel.org
parent 8fac27fb
...@@ -3781,6 +3781,7 @@ struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, const char *name, ...@@ -3781,6 +3781,7 @@ struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, const char *name,
{ {
struct net_device *ndev; struct net_device *ndev;
struct ath6kl_vif *vif; struct ath6kl_vif *vif;
u8 addr[ETH_ALEN];
ndev = alloc_netdev(sizeof(*vif), name, name_assign_type, ether_setup); ndev = alloc_netdev(sizeof(*vif), name, name_assign_type, ether_setup);
if (!ndev) if (!ndev)
...@@ -3803,14 +3804,14 @@ struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, const char *name, ...@@ -3803,14 +3804,14 @@ struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, const char *name,
vif->htcap[NL80211_BAND_2GHZ].ht_enable = true; vif->htcap[NL80211_BAND_2GHZ].ht_enable = true;
vif->htcap[NL80211_BAND_5GHZ].ht_enable = true; vif->htcap[NL80211_BAND_5GHZ].ht_enable = true;
eth_hw_addr_set(ndev, ar->mac_addr); ether_addr_copy(addr, ar->mac_addr);
if (fw_vif_idx != 0) { if (fw_vif_idx != 0) {
ndev->dev_addr[0] = (ndev->dev_addr[0] ^ (1 << fw_vif_idx)) | addr[0] = (addr[0] ^ (1 << fw_vif_idx)) | 0x2;
0x2;
if (test_bit(ATH6KL_FW_CAPABILITY_CUSTOM_MAC_ADDR, if (test_bit(ATH6KL_FW_CAPABILITY_CUSTOM_MAC_ADDR,
ar->fw_capabilities)) ar->fw_capabilities))
ndev->dev_addr[4] ^= 0x80; addr[4] ^= 0x80;
} }
eth_hw_addr_set(ndev, addr);
init_netdev(ndev); init_netdev(ndev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment