RE: [PATCH] wifi: rtw89: Correct immediate cfg_len calculation for scan_offload_be
From: Liang Jie
Date: Wed Jan 08 2025 - 20:24:27 EST
On Thu, 9 Jan 2025 00:35:38 +0000, Ping-Ke Shih <pkshih@xxxxxxxxxxx> wrote:
> Liang Jie <buaajxlj@xxxxxxx> wrote:
> > From: Liang Jie <liangjie@xxxxxxxxxxx>
> >
> > This patch ensures the correct calculation of `cfg_len` prior to the
>
> No "This patch". Just in imperative tense -- "Ensure ..."
>
> > allocation of the skb in the `rtw89_fw_h2c_scan_offload_be` function,
> >
> > ...
> >
> > behavior across different firmware versions.
> >
> > Fixes: 6ca6b918f280 ("wifi: rtw89: 8922a: Add new fields for scan offload H2C command")
> >
>
> No this blank line.
>
> > Signed-off-by: Liang Jie <liangjie@xxxxxxxxxxx>
> > ---
> >
> > ...
> >
> > u8 probe_id[NUM_NL80211_BANDS];
> > - u8 cfg_len = sizeof(*h2c);
> > + u8 cfg_len;
>
> In fact, SCAN_OFFLOAD_BE_V0 means `old` format used by `old' firmware version,
> which isn't a main flow. I prefer to keep here unchanged, and modify cfg_len
> along with SCAN_OFFLOAD_BE_V0 for v0 firmware.
>
> As existing patterns, this will be
>
> u8 cfg_len = sizeof(*h2c);
> u8 ver = U8_MAX;
>
> if (RTW89_CHK_FW_FEATURE(SCAN_OFFLOAD_BE_V0, &rtwdev->fw))
> ver = 0;
>
> ...
>
> if (ver == 0)
> cfg_len = offsetofend(typeof(*h2c), w8);
>
> ...
>
> if (ver == 0)
> goto flex_member;
>
> ...
>
>
> > unsigned int cond;
> > void *ptr;
> > int ret;
> >
> > ...
> >
> > 2.25.1
Thank you very much for your suggestions. I will incorporate them and submit
[PATCH v2] accordingly.
Best regards,
Liang Jie