Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

wilc1000: 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.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211018235021.1279697-13-kuba@kernel.org

authored by

Jakub Kicinski and committed by
Kalle Valo
0341ae70 2202c2f4

+11 -5
+9 -4
drivers/net/wireless/microchip/wilc1000/netdev.c
··· 111 111 return ndev; 112 112 } 113 113 114 - void wilc_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid, u8 mode) 114 + void wilc_wlan_set_bssid(struct net_device *wilc_netdev, const u8 *bssid, 115 + u8 mode) 115 116 { 116 117 struct wilc_vif *vif = netdev_priv(wilc_netdev); 117 118 ··· 595 594 wilc_set_operation_mode(vif, wilc_get_vif_idx(vif), vif->iftype, 596 595 vif->idx); 597 596 598 - if (is_valid_ether_addr(ndev->dev_addr)) 597 + if (is_valid_ether_addr(ndev->dev_addr)) { 599 598 wilc_set_mac_address(vif, ndev->dev_addr); 600 - else 601 - wilc_get_mac_address(vif, ndev->dev_addr); 599 + } else { 600 + u8 addr[ETH_ALEN]; 601 + 602 + wilc_get_mac_address(vif, addr); 603 + eth_hw_addr_set(ndev, addr); 604 + } 602 605 netdev_dbg(ndev, "Mac address: %pM\n", ndev->dev_addr); 603 606 604 607 if (!is_valid_ether_addr(ndev->dev_addr)) {
+2 -1
drivers/net/wireless/microchip/wilc1000/netdev.h
··· 287 287 void wilc_mac_indicate(struct wilc *wilc); 288 288 void wilc_netdev_cleanup(struct wilc *wilc); 289 289 void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size); 290 - void wilc_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid, u8 mode); 290 + void wilc_wlan_set_bssid(struct net_device *wilc_netdev, const u8 *bssid, 291 + u8 mode); 291 292 struct wilc_vif *wilc_netdev_ifc_init(struct wilc *wl, const char *name, 292 293 int vif_type, enum nl80211_iftype type, 293 294 bool rtnl_locked);