mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: YuChia-Kan <raspberrykan@stu.hqu.edu.cn>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] wifi: rtw88: use firmware MAC address as fallback
Date: Wed, 2 Sep 2026 01:22:15 +0000	[thread overview]
Message-ID: <4d1e5555bad84badba213f11b431c762@realtek.com> (raw)
In-Reply-To: <20260901124551.3921506-1-raspberrykan@stu.hqu.edu.cn>

YuChia-Kan <raspberrykan@stu.hqu.edu.cn> wrote:
> Some devices provide the Wi-Fi MAC address through firmware instead of
> storing a valid address in the chip efuse.
> 
> Try to read the MAC address from firmware before falling back to a
> randomly generated address.

Please share the board and WiFi chip you are using.

> 
> Signed-off-by: YuChia-Kan <raspberrykan@stu.hqu.edu.cn>
> ---
>  drivers/net/wireless/realtek/rtw88/main.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
> index cd9254370fcc..b9d8e0f5d15e 100644
> --- a/drivers/net/wireless/realtek/rtw88/main.c
> +++ b/drivers/net/wireless/realtek/rtw88/main.c
> @@ -2060,8 +2060,12 @@ static int rtw_chip_efuse_info_setup(struct rtw_dev *rtwdev)
>         efuse->ext_lna_5g = efuse->lna_type_5g & BIT(3) ? 1 : 0;
> 
>         if (!is_valid_ether_addr(efuse->addr)) {
> -               eth_random_addr(efuse->addr);
> -               dev_warn(rtwdev->dev, "efuse MAC invalid, using random\n");
> +               mac_ret = device_get_mac_address(rtwdev->dev, efuse->addr);

mac_ret isn't declared. 

> +               if (mac_ret) {
> +                       eth_random_addr(efuse->addr);
> +                       dev_warn(rtwdev->dev,
> +                                "failed to get valid MAC address, using random\n");
> +               }
>         }
> 
>  out_disable:
> --
> 2.53.0


  reply	other threads:[~2026-09-02  1:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-01 12:45 YuChia-Kan
2026-09-02  1:22 ` Ping-Ke Shih [this message]
     [not found]   ` <SEZPR04MB617269B16E24E662180A7678FFB72@SEZPR04MB6172.apcprd04.prod.outlook.com>
2026-09-02  2:33     ` Ping-Ke Shih
2026-09-02  3:10       ` 回复: " raspberrykan
2026-09-02  2:46 ` [PATCH v2] " YuChia-Kan
2026-09-02  3:14   ` [PATCH v3] " YuChia-Kan

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=4d1e5555bad84badba213f11b431c762@realtek.com \
    --to=pkshih@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=raspberrykan@stu.hqu.edu.cn \
    /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

all inboxes | Powered by JetHome®