Skip to contentSkip to conversation

wifi: rtw89: fw: use MAC source for IO offload delay command

PATCH In review Ping-Ke Shih 1 participant 2 messages Jul 14 – Jul 17 Realtek wireless driver (rtw89)

lore
Share & tools
lore

Ping-Ke Shih

author maintainer
#0 lore raw

PATCH 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.

Fixes ae3d327515f2 ("wifi: rtw89: add IO offload support via firmware")
---
 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
index 0e7168605850..ab97ab6969f9 100644
@@ -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
index af126d15a1fb..52e037010f92 100644
@@ -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
author maintainer
#1 lore raw
Quoted 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 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.

Quoted 8 lines

Use RTW89_FW_CMD_OFLD_SRC_MAC as the vendor driver does, and drop the unused RTW89_FW_CMD_OFLD_SRC_OTHER enumerator.

Fixes ae3d327515f2 ("wifi: rtw89: add IO offload support via firmware")

1 patch(es) applied to rtw-next branch of rtw.git, thanks.

730dbda6dc70 wifi: rtw89: fw: use MAC source for IO offload delay command

---
https://github.com/pkshih/rtw.git