Skip to contentSkip to conversation

wifi: ath6kl: set the permanent MAC address of the wiphy

PATCH New Josef Schlehofer 1 participant 1 message Nov 30

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: ath6kl: set the permanent MAC address of the wiphy

ath6kl never sets wiphy->perm_addr. /sys/class/ieee80211/phyN/macaddress then reads 00:00:00:00:00:00, while the netdev has the address the firmware reported. User space that takes interface addresses from the phy gets the zero address. OpenWrt does this for its access points, and ath6kl cannot change the address of its netdev afterwards.

Copy the address from the ready event into wiphy->perm_addr before the wiphy is registered. ath6kl_init_hw_start() waits for that event, so the address is known by then.

Fixes bdcd81707973 ("Add ath6kl cleaned up driver")

---
On a Xiaomi AIoT AC2350 (AR6006 hw1.1 on USB, with the pending AR6006 series), /sys/class/ieee80211/phyN/macaddress read 00:00:00:00:00:00 before this patch and the address of the netdev after it.

 drivers/net/wireless/ath/ath6kl/cfg80211.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/wireless/ath/ath6kl/cfg80211.c +2 -0
index c91560d55..6dea62238 100644
@@ -3999,6 +3999,8 @@ int ath6kl_cfg80211_init(struct ath6kl *ar)
 		NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2 |
 		NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P;
 
+	memcpy(wiphy->perm_addr, ar->mac_addr, ETH_ALEN);
+
 	ret = wiphy_register(wiphy);
 	if (ret < 0) {
 		ath6kl_err("couldn't register wiphy device\n");
Signature · 1 line
2.54.0 (Apple Git-157)