2023-10-28 12:17:10

by Shiji Yang

[permalink] [raw]
Subject: [PATCH 2/3] wifi: rt2x00: disable RTS threshold for rt2800 by default

Disable the RTS threshold for OFDM and CCK rates by default as the
initial RTS threshold is 'IEEE80211_MAX_RTS_THRESHOLD'. And RTS
thresholds for all other rates have already been disabled when init.

Signed-off-by: Shiji Yang <[email protected]>
---
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
index 6ca2f2c23..bcc63f1cb 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -6104,7 +6104,7 @@ static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)
rt2x00_set_field32(&reg, CCK_PROT_CFG_TX_OP_ALLOW_MM40, 0);
rt2x00_set_field32(&reg, CCK_PROT_CFG_TX_OP_ALLOW_GF20, 1);
rt2x00_set_field32(&reg, CCK_PROT_CFG_TX_OP_ALLOW_GF40, 0);
- rt2x00_set_field32(&reg, CCK_PROT_CFG_RTS_TH_EN, 1);
+ rt2x00_set_field32(&reg, CCK_PROT_CFG_RTS_TH_EN, 0);
rt2800_register_write(rt2x00dev, CCK_PROT_CFG, reg);

reg = rt2800_register_read(rt2x00dev, OFDM_PROT_CFG);
@@ -6117,7 +6117,7 @@ static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)
rt2x00_set_field32(&reg, OFDM_PROT_CFG_TX_OP_ALLOW_MM40, 0);
rt2x00_set_field32(&reg, OFDM_PROT_CFG_TX_OP_ALLOW_GF20, 1);
rt2x00_set_field32(&reg, OFDM_PROT_CFG_TX_OP_ALLOW_GF40, 0);
- rt2x00_set_field32(&reg, OFDM_PROT_CFG_RTS_TH_EN, 1);
+ rt2x00_set_field32(&reg, OFDM_PROT_CFG_RTS_TH_EN, 0);
rt2800_register_write(rt2x00dev, OFDM_PROT_CFG, reg);

reg = rt2800_register_read(rt2x00dev, MM20_PROT_CFG);
--
2.39.2


2023-10-28 15:12:09

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH 2/3] wifi: rt2x00: disable RTS threshold for rt2800 by default

Shiji Yang <[email protected]> writes:

> Disable the RTS threshold for OFDM and CCK rates by default as the
> initial RTS threshold is 'IEEE80211_MAX_RTS_THRESHOLD'. And RTS
> thresholds for all other rates have already been disabled when init.
>
> Signed-off-by: Shiji Yang <[email protected]>

The commit log should always answer to the question "Why?". What problem
does this patch fix?

--
https://patchwork.kernel.org/project/linux-wireless/list/

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

2023-10-29 01:10:08

by Shiji Yang

[permalink] [raw]
Subject: Re: [PATCH 2/3] wifi: rt2x00: disable RTS threshold for rt2800 by default

On Sat, 28 Oct 2023 17:54:27 +0300, Kalle Valo wrote:

>Shiji Yang <[email protected]> writes:
>
>> Disable the RTS threshold for OFDM and CCK rates by default as the
>> initial RTS threshold is 'IEEE80211_MAX_RTS_THRESHOLD'. And RTS
>> thresholds for all other rates have already been disabled when init.
>>
>> Signed-off-by: Shiji Yang <[email protected]>
>
>The commit log should always answer to the question "Why?". What problem
>does this patch fix?

Hi! Thanks for your review.

rt2800 has a lot of registers to control the RTS enable/disable
status for different rates. And the driver control them via
rt2800_set_rts_threshold(). I found that when RTS was disabled
in user interface, this function won't be called at all. This
means that the RTS is still 'on' for CCK and OFDM rates. So we'd
better to disable them by default in case they did some bad
things. The RTS for HT20 and HT40 is already default off so we
don't need to touch them. If we toggle the RTS status, these
register bits will be enabled/disabled again by
rt2800_set_rts_threshold().

If this patch is acceptable, I will add more explanations in the
v2 patch. Anyway, I don't know if it really solves some existing
problems, but I think it should be like this.

Regards,
Shiji Yang

2023-11-01 08:53:33

by Stanislaw Gruszka

[permalink] [raw]
Subject: Re: [PATCH 2/3] wifi: rt2x00: disable RTS threshold for rt2800 by default

On Sat, Oct 28, 2023 at 08:15:31PM +0800, Shiji Yang wrote:
> Disable the RTS threshold for OFDM and CCK rates by default as the
> initial RTS threshold is 'IEEE80211_MAX_RTS_THRESHOLD'. And RTS
> thresholds for all other rates have already been disabled when init.
> Signed-off-by: Shiji Yang <[email protected]>
Acked-by: Stanislaw Gruszka <[email protected]>