Skip to contentSkip to conversation

wifi: rtl8xxxu: fix txdw7 assignment of TX DESC v3

PATCH In review Ping-Ke Shih 3 participants 3 messages Jan 19, 2023 – Feb 13, 2023 RTL8XXXU wireless driver (rtl8xxxu)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: rtl8xxxu: fix txdw7 assignment of TX DESC v3

Type of txdw7 is __le16, so assign __le32 is wrong. Also, the TXDESC_ANTENNA_SELECT_C is defined for __le32, so shift 16 bits to fit the value. Compile test only.

sparse warnings: (new ones prefixed by >>)

Quoted 3 lines
Quoted 3 lines

rtl8xxxu_core.c:5198:24: sparse: sparse: invalid assignment: |=
rtl8xxxu_core.c:5198:24: sparse: left side has type restricted __le16
rtl8xxxu_core.c:5198:24: sparse: right side has type restricted __le32

---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +1 -1
index 35dc777c1fba8..0869b95f1b3f3 100644
@@ -5250,7 +5250,7 @@ rtl8xxxu_fill_txdesc_v3(struct ieee80211_hw *hw, struct ieee80211_hdr *hdr,
 
 	tx_desc->txdw2 |= cpu_to_le32(TXDESC_ANTENNA_SELECT_A |
 				      TXDESC_ANTENNA_SELECT_B);
-	tx_desc->txdw7 |= cpu_to_le32(TXDESC_ANTENNA_SELECT_C);
+	tx_desc->txdw7 |= cpu_to_le16(TXDESC_ANTENNA_SELECT_C >> 16);
 }
 
 static void rtl8xxxu_tx(struct ieee80211_hw *hw,
Signature · 1 line
2.25.1
Tested-by on v1 1/1
#1 lore raw
Quoted 20 lines · Ping-Ke Shih

Type of txdw7 is __le16, so assign __le32 is wrong. Also, the TXDESC_ANTENNA_SELECT_C is defined for __le32, so shift 16 bits to fit the value. Compile test only.

sparse warnings: (new ones prefixed by >>)

Quoted 3 lines
Quoted 3 lines

rtl8xxxu_core.c:5198:24: sparse: sparse: invalid assignment: |=
rtl8xxxu_core.c:5198:24: sparse: left side has type restricted __le16
rtl8xxxu_core.c:5198:24: sparse: right side has type restricted __le32

---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +0 -0
index 35dc777c1fba8..0869b95f1b3f3 100644

drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c rtl8xxxu_fill_txdesc_v3(struct ieee80211_hw *hw, struct ieee80211_hdr *hdr, · line 5256

Quoted 8 lines
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +1 -1
@@ -5250,7 +5250,7 @@ rtl8xxxu_fill_txdesc_v3(struct ieee80211_hw *hw, struct ieee80211_hdr *hdr,
 
 	tx_desc->txdw2 |= cpu_to_le32(TXDESC_ANTENNA_SELECT_A |
 				      TXDESC_ANTENNA_SELECT_B);
-	tx_desc->txdw7 |= cpu_to_le32(TXDESC_ANTENNA_SELECT_C);
+	tx_desc->txdw7 |= cpu_to_le16(TXDESC_ANTENNA_SELECT_C >> 16);
 }
 
 static void rtl8xxxu_tx(struct ieee80211_hw *hw,
#2 lore raw
In reply to Ping-Ke Shih
Quoted 4 lines · Ping-Ke Shih

Type of txdw7 is __le16, so assign __le32 is wrong. Also, the TXDESC_ANTENNA_SELECT_C is defined for __le32, so shift 16 bits to fit the value. Compile test only.

Quoted 8 lines

sparse warnings: (new ones prefixed by >>)

Quoted 3 lines
Quoted 3 lines

rtl8xxxu_core.c:5198:24: sparse: sparse: invalid assignment: |=
rtl8xxxu_core.c:5198:24: sparse: left side has type restricted __le16
rtl8xxxu_core.c:5198:24: sparse: right side has type restricted __le32

Patch applied to wireless-next.git, thanks.

6869ba4911df wifi: rtl8xxxu: fix txdw7 assignment of TX DESC v3

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches