wifi: rtw89: disable RTS when broadcast/multicast
authorPo-Hao Huang <phhuang@realtek.com>
Fri, 19 Jan 2024 08:14:57 +0000 (16:14 +0800)
committerKalle Valo <kvalo@kernel.org>
Tue, 23 Jan 2024 11:38:15 +0000 (13:38 +0200)
RTS switch should not be enabled for broadcast and multicast. This
could cause incorrect behavior during AP mode, so we fix it.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240119081501.25223-5-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/core.c

index 29df1ea0c826000ab6507aeeeb1b83d7971e8a05..260da86bf04af61c63ccfa052de8e6494b183960 100644 (file)
@@ -1176,7 +1176,8 @@ static __le32 rtw89_build_txwd_info2_v1(struct rtw89_tx_desc_info *desc_info)
 
 static __le32 rtw89_build_txwd_info4(struct rtw89_tx_desc_info *desc_info)
 {
-       u32 dword = FIELD_PREP(RTW89_TXWD_INFO4_RTS_EN, 1) |
+       bool rts_en = !desc_info->is_bmc;
+       u32 dword = FIELD_PREP(RTW89_TXWD_INFO4_RTS_EN, rts_en) |
                    FIELD_PREP(RTW89_TXWD_INFO4_HW_RTS_EN, 1);
 
        return cpu_to_le32(dword);
@@ -1329,7 +1330,8 @@ static __le32 rtw89_build_txwd_info2_v2(struct rtw89_tx_desc_info *desc_info)
 
 static __le32 rtw89_build_txwd_info4_v2(struct rtw89_tx_desc_info *desc_info)
 {
-       u32 dword = FIELD_PREP(BE_TXD_INFO4_RTS_EN, 1) |
+       bool rts_en = !desc_info->is_bmc;
+       u32 dword = FIELD_PREP(BE_TXD_INFO4_RTS_EN, rts_en) |
                    FIELD_PREP(BE_TXD_INFO4_HW_RTS_EN, 1);
 
        return cpu_to_le32(dword);