linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: Ping-Ke Shih <pkshih@realtek.com>
Cc: <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH 5/5] wifi: rtw89: use struct to access register-based H2C/C2H
Date: Thu, 25 May 2023 19:07:30 +0300	[thread overview]
Message-ID: <87cz2ol7i5.fsf@kernel.org> (raw)
In-Reply-To: <20230522122513.13559-6-pkshih@realtek.com> (Ping-Ke Shih's message of "Mon, 22 May 2023 20:25:13 +0800")

Ping-Ke Shih <pkshih@realtek.com> writes:

> The register-based H2C/C2H are used to exchange commands and events with
> firmware. The exchange data is limited, but it is relatively simple,
> because it can work before HCI initialization. To make these code clean,
> use struct to access them. This patch doesn't change logic at all.
>
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>

[...]

> --- a/drivers/net/wireless/realtek/rtw89/fw.h
> +++ b/drivers/net/wireless/realtek/rtw89/fw.h
> @@ -18,15 +18,51 @@ enum rtw89_fw_dl_status {
>  	RTW89_FWDL_WCPU_FW_INIT_RDY = 7
>  };
>  
> -#define RTW89_GET_C2H_HDR_FUNC(info) \
> -	u32_get_bits(info, GENMASK(6, 0))
> -#define RTW89_GET_C2H_HDR_LEN(info) \
> -	u32_get_bits(info, GENMASK(11, 8))
> +struct rtw89_c2hreg_hdr {
> +	u32 w0;
> +};

Why this is u32? Shouldn't it be __le32?

> +#define RTW89_C2HREG_HDR_FUNC_MASK GENMASK(6, 0)
> +#define RTW89_C2HREG_HDR_ACK BIT(7)
> +#define RTW89_C2HREG_HDR_LEN_MASK GENMASK(11, 8)
> +#define RTW89_C2HREG_HDR_SEQ_MASK GENMASK(15, 12)
> +
> +struct rtw89_c2hreg_phycap {
> +	u32 w0;
> +	u32 w1;
> +	u32 w2;
> +	u32 w3;
> +} __packed;

Here as well? And I saw more in the patch.

Of course these were already there so isn't a problem introduced by this
patchset, but I started wondering if we are missing some little endian
types?

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

  reply	other threads:[~2023-05-25 16:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-22 12:25 [PATCH 0/5] wifi: rtw89: use struct to access register-based H2C/C2H and RX related info Ping-Ke Shih
2023-05-22 12:25 ` [PATCH 1/5] wifi: rtw89: add chip_ops::query_rxdesc() and rxd_len as helpers to support newer chips Ping-Ke Shih
2023-05-25 16:13   ` Kalle Valo
2023-05-22 12:25 ` [PATCH 2/5] wifi: rtw89: use struct and le32_get_bits to access RX info Ping-Ke Shih
2023-05-22 12:25 ` [PATCH 3/5] wifi: rtw89: use struct and le32_get_bits() to access received PHY status IEs Ping-Ke Shih
2023-05-22 12:25 ` [PATCH 4/5] wifi: rtw89: use struct and le32_get_bits() to access RX descriptor Ping-Ke Shih
2023-05-22 12:25 ` [PATCH 5/5] wifi: rtw89: use struct to access register-based H2C/C2H Ping-Ke Shih
2023-05-25 16:07   ` Kalle Valo [this message]
2023-05-26 11:46     ` Ping-Ke Shih
2023-05-26 11:49       ` Kalle Valo

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=87cz2ol7i5.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pkshih@realtek.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;
as well as URLs for NNTP newsgroup(s).