wifi: rtw89: fw: use MAC source for IO offload delay command
Ping-Ke Shih
maintainerPATCH 1/1 wifi: rtw89: fw: use MAC source for IO offload delay command
From: Chia-Yuan Li <[email protected]>
The udelay/mdelay helpers set the command source to RTW89_FW_CMD_OFLD_SRC_OTHER (4), which does not fit the two-bit field RTW89_H2C_CMD_OFLD_W0_SRC (GENMASK(1, 0)). The le32_encode_bits() masks it down to 0 (RTW89_FW_CMD_OFLD_SRC_BB), and compiler throws __field_overflow() error. Fortunately it still works because firmware ignores the source field for a delay command.
Use RTW89_FW_CMD_OFLD_SRC_MAC as the vendor driver does, and drop the unused RTW89_FW_CMD_OFLD_SRC_OTHER enumerator.
--- drivers/net/wireless/realtek/rtw89/fw.c | 4 ++-- drivers/net/wireless/realtek/rtw89/fw.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/net/wireless/realtek/rtw89/fw.c +2 -2
@@ -12080,7 +12080,7 @@ static void rtw89_fw_cmd_ofld_write_rf(struct rtw89_dev *rtwdev,static void rtw89_fw_cmd_ofld_udelay (struct rtw89_dev *rtwdev,u32 us) {struct rtw89_fw_cmd_ofld_arg cmd = { - .src =RTW89_FW_CMD_OFLD_SRC_OTHER , + .src =RTW89_FW_CMD_OFLD_SRC_MAC , .type =RTW89_FW_CMD_OFLD_DELAY , .value = us, };
@@ -12094,7 +12094,7 @@ static void rtw89_fw_cmd_ofld_udelay(struct rtw89_dev *rtwdev, u32 us)static void rtw89_fw_cmd_ofld_mdelay (struct rtw89_dev *rtwdev,u32 ms) {struct rtw89_fw_cmd_ofld_arg cmd = { - .src =RTW89_FW_CMD_OFLD_SRC_OTHER , + .src =RTW89_FW_CMD_OFLD_SRC_MAC , .type =RTW89_FW_CMD_OFLD_DELAY , .value = ms *1000 , };
drivers/net/wireless/realtek/rtw89/fw.h +0 -1
@@ -3139,7 +3139,6 @@ enum rtw89_fw_cmd_ofld_arg_src {RTW89_FW_CMD_OFLD_SRC_RF ,RTW89_FW_CMD_OFLD_SRC_MAC , RTW89_FW_CMD_OFLD_SRC_RF_DDIE, - RTW89_FW_CMD_OFLD_SRC_OTHER, }; enum rtw89_fw_cmd_ofld_arg_type {
base-commit: 6c080026ecc17eecb103f8927c64ea73a74bb818
Signature · 1 line
2.25.1
Ping-Ke Shih
maintainerQuoted 9 lines · Ping-Ke Shih
From: Chia-Yuan Li <[email protected]>
The udelay/mdelay helpers set the command source to
RTW89_FW_CMD_OFLD_SRC_OTHER(4), which does not fit the two-bit fieldRTW89_H2C_CMD_OFLD_W0_SRC(GENMASK(1, 0)). Thele32_encode_bits()masks it down to 0 (RTW89_FW_CMD_OFLD_SRC_BB), and compiler throws__field_overflow()error. Fortunately it still works because firmware ignores the source field for a delay command.
Quoted 8 lines
Use
RTW89_FW_CMD_OFLD_SRC_MACas the vendor driver does, and drop the unusedRTW89_FW_CMD_OFLD_SRC_OTHERenumerator.Reported-by Bitterblue Smith <[email protected]>Fixes ae3d327515f2 ("wifi: rtw89: add IO offload support via firmware")Signed-off-by Chia-Yuan Li <[email protected]>Signed-off-by Ping-Ke Shih <[email protected]>
1 patch(es) applied to rtw-next branch of rtw.git, thanks.
730dbda6dc70 wifi: rtw89: fw: use MAC source for IO offload delay command