Linux wireless drivers development
 help / color / mirror / Atom feed
From: Josef Schlehofer <pepe.schlehofer@gmail.com>
To: Jeff Johnson <jjohnson@kernel.org>
Cc: linux-wireless@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH ath-next] wifi: ath6kl: set the permanent MAC address of the wiphy
Date: Mon, 30 Nov 2026 13:16:20 +0100	[thread overview]
Message-ID: <20261130121620.27137-1-pepe.schlehofer@gmail.com> (raw)

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")
Cc: stable@vger.kernel.org
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
---
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(+)

diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index c91560d55..6dea62238 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -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");
-- 
2.54.0 (Apple Git-157)


                 reply	other threads:[~2026-11-30 12:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261130121620.27137-1-pepe.schlehofer@gmail.com \
    --to=pepe.schlehofer@gmail.com \
    --cc=jjohnson@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox