@@ -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);
@@ -1341,7 +1341,7 @@ struct wil6210_priv *wil_cfg80211_init(struct device *dev);
void wil_cfg80211_deinit(struct wil6210_priv *wil);
void wil_p2p_wdev_free(struct wil6210_priv *wil);
-int wmi_set_mac_address(struct wil6210_priv *wil, void *addr);
+int wmi_set_mac_address(struct wil6210_priv *wil, const void *addr);
int wmi_pcp_start(struct wil6210_vif *vif, int bi, u8 wmi_nettype, u8 chan,
u8 edmg_chan, u8 hidden_ssid, u8 is_go);
int wmi_pcp_stop(struct wil6210_vif *vif);
@@ -2097,7 +2097,7 @@ int wmi_echo(struct wil6210_priv *wil)
WIL_WMI_CALL_GENERAL_TO_MS);
}
-int wmi_set_mac_address(struct wil6210_priv *wil, void *addr)
+int wmi_set_mac_address(struct wil6210_priv *wil, const void *addr)
{
struct wil6210_vif *vif = ndev_to_vif(wil->main_ndev);
struct wmi_set_mac_address_cmd cmd;
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> --- CC: merez@codeaurora.org CC: kvalo@codeaurora.org CC: linux-wireless@vger.kernel.org CC: wil6210@qti.qualcomm.com --- drivers/net/wireless/ath/wil6210/cfg80211.c | 8 +++++--- drivers/net/wireless/ath/wil6210/wil6210.h | 2 +- drivers/net/wireless/ath/wil6210/wmi.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-)