From: Rosen Penev <rosenp@gmail.com>
To: linux-wireless@vger.kernel.org
Cc: Jiri Slaby <jirislaby@kernel.org>,
Nick Kossifidis <mickflemm@gmail.com>,
Luis Chamberlain <mcgrof@kernel.org>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH ath-next 2/2] wifi: ath5k: set MAC address through OF
Date: Sun, 11 Jan 2026 19:19:34 -0800 [thread overview]
Message-ID: <20260112031934.44839-3-rosenp@gmail.com> (raw)
In-Reply-To: <20260112031934.44839-1-rosenp@gmail.com>
If defined in OF, set the MAC address. Allows avoiding having to do that
in userspace.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/net/wireless/ath/ath5k/base.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 4d88b02ffa79..22ca7e624b32 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -59,6 +59,7 @@
#include <net/cfg80211.h>
#include <net/ieee80211_radiotap.h>
+#include <linux/of_net.h>
#include <linux/unaligned.h>
#include <net/mac80211.h>
@@ -2570,6 +2571,19 @@ static const struct ieee80211_iface_combination if_comb = {
.num_different_channels = 1,
};
+static int ath5k_of_init(struct ath5k_hw *ah)
+{
+ struct ath_common *common = ath5k_hw_common(ah);
+ struct device_node *np = ah->dev->of_node;
+ int ret;
+
+ ret = of_get_mac_address(np, common->macaddr);
+ if (ret == -EPROBE_DEFER)
+ return ret;
+
+ return 0;
+}
+
int
ath5k_init_ah(struct ath5k_hw *ah, const struct ath_bus_ops *bus_ops)
{
@@ -2638,6 +2652,10 @@ ath5k_init_ah(struct ath5k_hw *ah, const struct ath_bus_ops *bus_ops)
common->priv = ah;
common->clockrate = 40;
+ ret = ath5k_of_init(ah);
+ if (ret)
+ return ret;
+
/*
* Cache line size is used to size and align various
* structures used to communicate with the hardware.
--
2.52.0
prev parent reply other threads:[~2026-01-12 3:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-12 3:19 [PATCH ath-next 0/2] wifi: ath5k: add MAC address OF support Rosen Penev
2026-01-12 3:19 ` [PATCH ath-next 1/2] wifi: ath5k: ahb: use devm for ioremap Rosen Penev
2026-01-12 3:19 ` Rosen Penev [this message]
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=20260112031934.44839-3-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=mickflemm@gmail.com \
/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