* [PATCH v2 1/2] wifi: rtw88: 8822c: Fix reported RX band width
@ 2024-07-22 10:50 Bitterblue Smith
2024-07-22 10:58 ` Johannes Berg
2024-07-22 11:01 ` [PATCH v2 2/2] wifi: rtw88: 8703b: " Bitterblue Smith
0 siblings, 2 replies; 5+ messages in thread
From: Bitterblue Smith @ 2024-07-22 10:50 UTC (permalink / raw)
To: linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih
"iw dev wlp2s0 station dump" shows incorrect rx bitrate:
tx bitrate: 866.7 MBit/s VHT-MCS 9 80MHz short GI VHT-NSS 2
rx bitrate: 86.7 MBit/s VHT-MCS 9 VHT-NSS 1
This is because the RX band width is calculated incorrectly. Fix the
calculation according to the phydm_rxsc_2_bw() function from the
official drivers.
After:
tx bitrate: 866.7 MBit/s VHT-MCS 9 80MHz short GI VHT-NSS 2
rx bitrate: 390.0 MBit/s VHT-MCS 9 80MHz VHT-NSS 1
It also works correctly with the AP configured for 20 MHz and 40 MHz.
Tested with RTL8822CE.
Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver")
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
v2:
- Use Fixes instead of Cc: stable.
---
drivers/net/wireless/realtek/rtw88/rtw8822c.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822c.c b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
index bc807b13e9ce..e265a35184ab 100644
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
@@ -2612,12 +2612,14 @@ static void query_phy_status_page1(struct rtw_dev *rtwdev, u8 *phy_status,
else
rxsc = GET_PHY_STAT_P1_HT_RXSC(phy_status);
- if (rxsc >= 9 && rxsc <= 12)
+ if (rxsc == 0)
+ bw = rtwdev->hal.current_band_width;
+ else if (rxsc >= 1 && rxsc <= 8)
+ bw = RTW_CHANNEL_WIDTH_20;
+ else if (rxsc >= 9 && rxsc <= 12)
bw = RTW_CHANNEL_WIDTH_40;
- else if (rxsc >= 13)
- bw = RTW_CHANNEL_WIDTH_80;
else
- bw = RTW_CHANNEL_WIDTH_20;
+ bw = RTW_CHANNEL_WIDTH_80;
channel = GET_PHY_STAT_P1_CHANNEL(phy_status);
rtw_set_rx_freq_band(pkt_stat, channel);
--
2.45.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/2] wifi: rtw88: 8822c: Fix reported RX band width
2024-07-22 10:50 [PATCH v2 1/2] wifi: rtw88: 8822c: Fix reported RX band width Bitterblue Smith
@ 2024-07-22 10:58 ` Johannes Berg
2024-07-22 11:43 ` Bitterblue Smith
2024-07-22 11:01 ` [PATCH v2 2/2] wifi: rtw88: 8703b: " Bitterblue Smith
1 sibling, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2024-07-22 10:58 UTC (permalink / raw)
To: Bitterblue Smith, linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih
On Mon, 2024-07-22 at 13:50 +0300, Bitterblue Smith wrote:
> "iw dev wlp2s0 station dump" shows incorrect rx bitrate:
>
> tx bitrate: 866.7 MBit/s VHT-MCS 9 80MHz short GI VHT-NSS 2
> rx bitrate: 86.7 MBit/s VHT-MCS 9 VHT-NSS 1
>
> This is because the RX band width is calculated incorrectly. Fix the
> calculation according to the phydm_rxsc_2_bw() function from the
> official drivers.
>
> After:
>
> tx bitrate: 866.7 MBit/s VHT-MCS 9 80MHz short GI VHT-NSS 2
> rx bitrate: 390.0 MBit/s VHT-MCS 9 80MHz VHT-NSS 1
>
> It also works correctly with the AP configured for 20 MHz and 40 MHz.
>
> Tested with RTL8822CE.
>
> Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver")
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> ---
> v2:
> - Use Fixes instead of Cc: stable.
>
For the record, if you want it backported, you really should have
_both_. Having the Fixes: is good, but will not necessarily lead to it
being backported when/where you want it.
johannes
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] wifi: rtw88: 8703b: Fix reported RX band width
2024-07-22 10:50 [PATCH v2 1/2] wifi: rtw88: 8822c: Fix reported RX band width Bitterblue Smith
2024-07-22 10:58 ` Johannes Berg
@ 2024-07-22 11:01 ` Bitterblue Smith
1 sibling, 0 replies; 5+ messages in thread
From: Bitterblue Smith @ 2024-07-22 11:01 UTC (permalink / raw)
To: linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih, Fiona Klute
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.
Fixes: 9bb762b3a957 ("wifi: rtw88: Add definitions for 8703b chip")
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
v2:
- Use Fixes instead of Cc: stable.
---
drivers/net/wireless/realtek/rtw88/rx.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
--
2.45.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/2] wifi: rtw88: 8822c: Fix reported RX band width
2024-07-22 10:58 ` Johannes Berg
@ 2024-07-22 11:43 ` Bitterblue Smith
2024-07-22 11:46 ` Johannes Berg
0 siblings, 1 reply; 5+ messages in thread
From: Bitterblue Smith @ 2024-07-22 11:43 UTC (permalink / raw)
To: Johannes Berg, linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih
On 22/07/2024 13:58, Johannes Berg wrote:
> On Mon, 2024-07-22 at 13:50 +0300, Bitterblue Smith wrote:
>> "iw dev wlp2s0 station dump" shows incorrect rx bitrate:
>>
>> tx bitrate: 866.7 MBit/s VHT-MCS 9 80MHz short GI VHT-NSS 2
>> rx bitrate: 86.7 MBit/s VHT-MCS 9 VHT-NSS 1
>>
>> This is because the RX band width is calculated incorrectly. Fix the
>> calculation according to the phydm_rxsc_2_bw() function from the
>> official drivers.
>>
>> After:
>>
>> tx bitrate: 866.7 MBit/s VHT-MCS 9 80MHz short GI VHT-NSS 2
>> rx bitrate: 390.0 MBit/s VHT-MCS 9 80MHz VHT-NSS 1
>>
>> It also works correctly with the AP configured for 20 MHz and 40 MHz.
>>
>> Tested with RTL8822CE.
>>
>> Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver")
>> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
>> ---
>> v2:
>> - Use Fixes instead of Cc: stable.
>>
>
> For the record, if you want it backported, you really should have
> _both_. Having the Fixes: is good, but will not necessarily lead to it
> being backported when/where you want it.
>
> johannes
Oh. But my other patches were backported when I used Fixes.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/2] wifi: rtw88: 8822c: Fix reported RX band width
2024-07-22 11:43 ` Bitterblue Smith
@ 2024-07-22 11:46 ` Johannes Berg
0 siblings, 0 replies; 5+ messages in thread
From: Johannes Berg @ 2024-07-22 11:46 UTC (permalink / raw)
To: Bitterblue Smith, linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih
On Mon, 2024-07-22 at 14:43 +0300, Bitterblue Smith wrote:
>
> > > - Use Fixes instead of Cc: stable.
> > >
> >
> > For the record, if you want it backported, you really should have
> > _both_. Having the Fixes: is good, but will not necessarily lead to it
> > being backported when/where you want it.
>
> Oh. But my other patches were backported when I used Fixes.
Yeah, having a small commit that says it fixes something and has a
Fixes: tag is a pretty good signal for the AUTOSEL thingie, but it's not
going to go into the process directly.
johannes
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-07-22 11:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-22 10:50 [PATCH v2 1/2] wifi: rtw88: 8822c: Fix reported RX band width Bitterblue Smith
2024-07-22 10:58 ` Johannes Berg
2024-07-22 11:43 ` Bitterblue Smith
2024-07-22 11:46 ` Johannes Berg
2024-07-22 11:01 ` [PATCH v2 2/2] wifi: rtw88: 8703b: " Bitterblue Smith
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.