wifi: rtw89: fix scan offload version check logic

The version check with less than should check for smallest upper-bound
first, or some branch will be unreachable.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260729124354.3231368-3-pkshih@realtek.com
This commit is contained in:
Po-Hao Huang
2026-07-29 20:43:53 +08:00
committed by Ping-Ke Shih
parent 304720870f
commit 58c0d447c5

View File

@@ -7748,12 +7748,12 @@ 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_V1, &rtwdev->fw)) {
cfg_len = offsetofend(typeof(*h2c), w9);
scan_offload_ver = 1;
} else if (RTW89_CHK_FW_FEATURE(SCAN_OFFLOAD_BE_V0, &rtwdev->fw)) {
if (RTW89_CHK_FW_FEATURE(SCAN_OFFLOAD_BE_V0, &rtwdev->fw)) {
cfg_len = offsetofend(typeof(*h2c), w8);
scan_offload_ver = 0;
} else if (RTW89_CHK_FW_FEATURE(SCAN_OFFLOAD_BE_V1, &rtwdev->fw)) {
cfg_len = offsetofend(typeof(*h2c), w9);
scan_offload_ver = 1;
}
len = cfg_len + macc_role_size + opch_size;