diff mbox series

[2/2] wifi: rtw88: 8703b: Fix reported RX band width

Message ID 712d08e3-fc90-48ad-bb61-bb601b2cf953@gmail.com (mailing list archive)
State Superseded
Delegated to: Ping-Ke Shih
Headers show
Series [1/2] wifi: rtw88: 8822c: Fix reported RX band width | expand

Commit Message

Bitterblue Smith July 21, 2024, 10:55 p.m. UTC
The definition of GET_RX_DESC_BW is incorrect. Fix it according to the
GET_RX_STATUS_DESC_BW_8703B macro from the official driver.

Tested only with RTL8812AU, which uses the same bits.

Cc: stable@vger.kernel.org
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
 drivers/net/wireless/realtek/rtw88/rx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ping-Ke Shih July 22, 2024, 3:39 a.m. UTC | #1
Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> The definition of GET_RX_DESC_BW is incorrect. Fix it according to the
> GET_RX_STATUS_DESC_BW_8703B macro from the official driver.
> 
> Tested only with RTL8812AU, which uses the same bits.
> 
> Cc: stable@vger.kernel.org

Add a Fixes tag? as well as patch 1/2. 
Otherwise looks good to me. 

> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Bitterblue Smith July 22, 2024, 11:07 a.m. UTC | #2
On 22/07/2024 06:39, Ping-Ke Shih wrote:
> Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
>> The definition of GET_RX_DESC_BW is incorrect. Fix it according to the
>> GET_RX_STATUS_DESC_BW_8703B macro from the official driver.
>>
>> Tested only with RTL8812AU, which uses the same bits.
>>
>> Cc: stable@vger.kernel.org
> 
> Add a Fixes tag? as well as patch 1/2. 
> Otherwise looks good to me. 
> 
>> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> 
> 

Done.

By the way, there is another problem with the RX rate: rtw88
doesn't report if short guard interval was used. The older
chips like RTL8703B have the sgi_en bit in the PHY status
struct, but I couldn't find out how the newer chips do it.
Ping-Ke Shih July 23, 2024, 1:27 a.m. UTC | #3
Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> By the way, there is another problem with the RX rate: rtw88
> doesn't report if short guard interval was used. The older
> chips like RTL8703B have the sgi_en bit in the PHY status
> struct, but I couldn't find out how the newer chips do it.

The newer chips don't have that bit for RX.
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw88/rx.h b/drivers/net/wireless/realtek/rtw88/rx.h
index d3668c4efc24..8a072dd3d73c 100644
--- a/drivers/net/wireless/realtek/rtw88/rx.h
+++ b/drivers/net/wireless/realtek/rtw88/rx.h
@@ -41,7 +41,7 @@  enum rtw_rx_desc_enc {
 #define GET_RX_DESC_TSFL(rxdesc)                                               \
 	le32_get_bits(*((__le32 *)(rxdesc) + 0x05), GENMASK(31, 0))
 #define GET_RX_DESC_BW(rxdesc)                                                 \
-	(le32_get_bits(*((__le32 *)(rxdesc) + 0x04), GENMASK(31, 24)))
+	(le32_get_bits(*((__le32 *)(rxdesc) + 0x04), GENMASK(5, 4)))
 
 void rtw_rx_stats(struct rtw_dev *rtwdev, struct ieee80211_vif *vif,
 		  struct sk_buff *skb);