Message ID | 20250109015032.1070045-1-buaajxlj@163.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Ping-Ke Shih |
Headers | show |
Series | [v2] wifi: rtw89: Correct immediate cfg_len calculation for scan_offload_be | expand |
Liang Jie <buaajxlj@163.com> wrote: > diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c > index 2191c037d72e..2be1bee724ca 100644 > --- a/drivers/net/wireless/realtek/rtw89/fw.c > +++ b/drivers/net/wireless/realtek/rtw89/fw.c > @@ -5170,6 +5170,7 @@ int rtw89_fw_h2c_scan_offload_be(struct rtw89_dev *rtwdev, > u8 opch_size = sizeof(*opch) * option->num_opch; > u8 probe_id[NUM_NL80211_BANDS]; > u8 cfg_len = sizeof(*h2c); > + u8 ver = U8_MAX; > unsigned int cond; > void *ptr; > int ret; In reverse X'mas tree. Otherwise, looks good to me.
On Thu, 9 Jan 2025 01:55:23 +0000, Ping-Ke Shih <pkshih@realtek.com> wrote: > Liang Jie <buaajxlj@163.com> wrote: > > diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c > > index 2191c037d72e..2be1bee724ca 100644 > > --- a/drivers/net/wireless/realtek/rtw89/fw.c > > +++ b/drivers/net/wireless/realtek/rtw89/fw.c > > @@ -5170,6 +5170,7 @@ int rtw89_fw_h2c_scan_offload_be(struct rtw89_dev *rtwdev, > > u8 opch_size = sizeof(*opch) * option->num_opch; > > u8 probe_id[NUM_NL80211_BANDS]; > > u8 cfg_len = sizeof(*h2c); > > + u8 ver = U8_MAX; > > unsigned int cond; > > void *ptr; > > int ret; > > In reverse X'mas tree. Otherwise, looks good to me. Thank you for pointing out the "In reverse X'mas tree" issue in the code structure. I will address this and submit [PATCH v3] with the necessary corrections. Best regards, Liang Jie
diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c index 2191c037d72e..2be1bee724ca 100644 --- a/drivers/net/wireless/realtek/rtw89/fw.c +++ b/drivers/net/wireless/realtek/rtw89/fw.c @@ -5170,6 +5170,7 @@ int rtw89_fw_h2c_scan_offload_be(struct rtw89_dev *rtwdev, u8 opch_size = sizeof(*opch) * option->num_opch; u8 probe_id[NUM_NL80211_BANDS]; u8 cfg_len = sizeof(*h2c); + u8 ver = U8_MAX; unsigned int cond; void *ptr; int ret; @@ -5178,6 +5179,11 @@ int rtw89_fw_h2c_scan_offload_be(struct rtw89_dev *rtwdev, rtw89_scan_get_6g_disabled_chan(rtwdev, option); + if (RTW89_CHK_FW_FEATURE(SCAN_OFFLOAD_BE_V0, &rtwdev->fw)) { + cfg_len = offsetofend(typeof(*h2c), w8); + ver = 0; + } + len = cfg_len + macc_role_size + opch_size; skb = rtw89_fw_h2c_alloc_skb_with_hdr(rtwdev, len); if (!skb) { @@ -5246,10 +5252,8 @@ int rtw89_fw_h2c_scan_offload_be(struct rtw89_dev *rtwdev, RTW89_H2C_SCANOFLD_BE_W8_PROBE_RATE_6GHZ); } - if (RTW89_CHK_FW_FEATURE(SCAN_OFFLOAD_BE_V0, &rtwdev->fw)) { - cfg_len = offsetofend(typeof(*h2c), w8); + if (ver == 0) goto flex_member; - } h2c->w9 = le32_encode_bits(sizeof(*h2c) / sizeof(h2c->w0), RTW89_H2C_SCANOFLD_BE_W9_SIZE_CFG) |