* [PATCH] ath10k: utilize random MAC address if none is provided
@ 2018-09-07 17:21 Brian Norris
2018-10-01 13:54 ` Kalle Valo
0 siblings, 1 reply; 2+ messages in thread
From: Brian Norris @ 2018-09-07 17:21 UTC (permalink / raw)
To: Kalle Valo
Cc: ath10k, linux-wireless, Govind Singh, linux-kernel, Brian Norris
Since commit 9d5804662ce1 ("ath10k: retrieve MAC address from system
firmware if provided"), we support pulling our MAC address from system
firmware. Along with this, we should admit that it's possible for system
firmware to be screwed up as well, omitting the MAC address there.
Provide a fallback, such that we choose a randomly-generated MAC
address, with the local assignment bit set.
This is not a preferred mode of operation and really should only serve
the purpose of keeping the system chugging along while someone figures
out what's wrong with the system. Grepping through other wireless
drivers shows very similar fallback logic though, so why not?
git grep eth_random_addr drivers/net/wireless/
Signed-off-by: Brian Norris <briannorris@chromium.org>
---
drivers/net/wireless/ath/ath10k/mac.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 97548f96a2f7..484f9c74ce46 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -8325,6 +8325,10 @@ int ath10k_mac_register(struct ath10k *ar)
void *channels;
int ret;
+ if (!is_valid_ether_addr(ar->mac_addr)) {
+ ath10k_warn(ar, "invalid MAC address; choosing random\n");
+ eth_random_addr(ar->mac_addr);
+ }
SET_IEEE80211_PERM_ADDR(ar->hw, ar->mac_addr);
SET_IEEE80211_DEV(ar->hw, ar->dev);
--
2.19.0.rc2.392.g5ba43deb5a-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ath10k: utilize random MAC address if none is provided
2018-09-07 17:21 [PATCH] ath10k: utilize random MAC address if none is provided Brian Norris
@ 2018-10-01 13:54 ` Kalle Valo
0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2018-10-01 13:54 UTC (permalink / raw)
To: Brian Norris
Cc: Kalle Valo, ath10k, linux-wireless, Govind Singh, linux-kernel,
Brian Norris
Brian Norris <briannorris@chromium.org> wrote:
> Since commit 9d5804662ce1 ("ath10k: retrieve MAC address from system
> firmware if provided"), we support pulling our MAC address from system
> firmware. Along with this, we should admit that it's possible for system
> firmware to be screwed up as well, omitting the MAC address there.
>
> Provide a fallback, such that we choose a randomly-generated MAC
> address, with the local assignment bit set.
>
> This is not a preferred mode of operation and really should only serve
> the purpose of keeping the system chugging along while someone figures
> out what's wrong with the system. Grepping through other wireless
> drivers shows very similar fallback logic though, so why not?
>
> git grep eth_random_addr drivers/net/wireless/
>
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Patch applied to ath-next branch of ath.git, thanks.
234e4307cf7f ath10k: utilize random MAC address if none is provided
--
https://patchwork.kernel.org/patch/10592411/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-01 13:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-07 17:21 [PATCH] ath10k: utilize random MAC address if none is provided Brian Norris
2018-10-01 13:54 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).