All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: "tony0620emma@gmail.com" <tony0620emma@gmail.com>,
	"kvalo@kernel.org" <kvalo@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Neo Jou <neojou@gmail.com>,
	Jernej Skrabec <jernej.skrabec@gmail.com>
Subject: RE: [PATCH v1 4/5] wifi: rtw88: rtw8822b: Implement RTL8822BS (SDIO) efuse parsing
Date: Wed, 15 Feb 2023 01:21:34 +0000	[thread overview]
Message-ID: <ef11acd2c4054365b76d06966f40cc61@realtek.com> (raw)
In-Reply-To: <20230214211421.2290102-5-martin.blumenstingl@googlemail.com>



> -----Original Message-----
> From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> Sent: Wednesday, February 15, 2023 5:14 AM
> To: linux-wireless@vger.kernel.org
> Cc: tony0620emma@gmail.com; kvalo@kernel.org; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Neo
> Jou <neojou@gmail.com>; Jernej Skrabec <jernej.skrabec@gmail.com>; Ping-Ke Shih <pkshih@realtek.com>;
> Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> Subject: [PATCH v1 4/5] wifi: rtw88: rtw8822b: Implement RTL8822BS (SDIO) efuse parsing
> 
> The efuse of the SDIO RTL8822BS chip has only one known member: the mac
> address is at offset 0x11a. Add a struct rtw8822bs_efuse describing this
> and use it for copying the mac address when the SDIO bus is used.
> 
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
>  drivers/net/wireless/realtek/rtw88/rtw8822b.c | 10 ++++++++++
>  drivers/net/wireless/realtek/rtw88/rtw8822b.h |  6 ++++++
>  2 files changed, 16 insertions(+)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
> b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
> index 74dfb89b2c94..4ed5b98fab23 100644
> --- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
> +++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
> @@ -26,10 +26,17 @@ static void rtw8822be_efuse_parsing(struct rtw_efuse *efuse,
>         ether_addr_copy(efuse->addr, map->e.mac_addr);
>  }
> 
> +static void rtw8822bs_efuse_parsing(struct rtw_efuse *efuse,
> +                                   struct rtw8822b_efuse *map)
> +{
> +       ether_addr_copy(efuse->addr, map->s.mac_addr);
> +}
> +
>  static void rtw8822bu_efuse_parsing(struct rtw_efuse *efuse,
>                                     struct rtw8822b_efuse *map)
>  {
>         ether_addr_copy(efuse->addr, map->u.mac_addr);
> +

Don't need to stir USB code.

>  }
> 
>  static int rtw8822b_read_efuse(struct rtw_dev *rtwdev, u8 *log_map)
> @@ -62,6 +69,9 @@ static int rtw8822b_read_efuse(struct rtw_dev *rtwdev, u8 *log_map)
>         case RTW_HCI_TYPE_PCIE:
>                 rtw8822be_efuse_parsing(efuse, map);
>                 break;
> +       case RTW_HCI_TYPE_SDIO:
> +               rtw8822bs_efuse_parsing(efuse, map);
> +               break;
>         case RTW_HCI_TYPE_USB:
>                 rtw8822bu_efuse_parsing(efuse, map);
>                 break;
> diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822b.h
> b/drivers/net/wireless/realtek/rtw88/rtw8822b.h
> index 01d3644e0c94..8d05805c046c 100644
> --- a/drivers/net/wireless/realtek/rtw88/rtw8822b.h
> +++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.h
> @@ -65,6 +65,11 @@ struct rtw8822be_efuse {
>         u8 res7;
>  };
> 
> +struct rtw8822bs_efuse {
> +       u8 res4[0x4a];                  /* 0xd0 */
> +       u8 mac_addr[ETH_ALEN];          /* 0x11a */
> +} __packed;
> +
>  struct rtw8822b_efuse {
>         __le16 rtl_id;
>         u8 res0[0x0e];
> @@ -94,6 +99,7 @@ struct rtw8822b_efuse {
>         union {
>                 struct rtw8822bu_efuse u;
>                 struct rtw8822be_efuse e;
> +               struct rtw8822bs_efuse s;

No obvious problem in whole patchset. Only a nit about the order of PCIE-USB-SDIO.
Can we have them in consistent order?

Here, the order is USB-PCIE-SDIO, but patch 3/5 and 5/5 in different order.
It seems like we messed up the order when adding USB, but we can correct them
along with this patch. My prefer order is PCIE-USB-SDIO after adding SDIO,
because the order of existing code of 'switch...case' is PCIE-USB.

Apply this rule not only here also 'switch...case' and 'efuse parser'.

Ping-Ke


  reply	other threads:[~2023-02-15  1:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-14 21:14 [PATCH v1 0/5] rtw88: Add additional SDIO support bits Martin Blumenstingl
2023-02-14 21:14 ` [PATCH v1 1/5] wifi: rtw88: mac: Add support for the SDIO HCI in rtw_pwr_seq_parser() Martin Blumenstingl
2023-02-14 21:14 ` [PATCH v1 2/5] wifi: rtw88: mac: Add SDIO HCI support in the TX/page table setup Martin Blumenstingl
2023-02-14 21:14 ` [PATCH v1 3/5] wifi: rtw88: rtw8821c: Implement RTL8821CS (SDIO) efuse parsing Martin Blumenstingl
2023-02-14 21:14 ` [PATCH v1 4/5] wifi: rtw88: rtw8822b: Implement RTL8822BS " Martin Blumenstingl
2023-02-15  1:21   ` Ping-Ke Shih [this message]
2023-02-14 21:14 ` [PATCH v1 5/5] wifi: rtw88: rtw8822c: Implement RTL8822CS " Martin Blumenstingl

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=ef11acd2c4054365b76d06966f40cc61@realtek.com \
    --to=pkshih@realtek.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=neojou@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=tony0620emma@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.