b3e95da5a60d0bb92e580535f661e473102eb504
[openwrt/staging/ansuel.git] /
1 From 570beb6285fd355904b22625da20809f477096c5 Mon Sep 17 00:00:00 2001
2 From: Shiji Yang <yangshiji66@outlook.com>
3 Date: Sat, 4 Nov 2023 16:57:59 +0800
4 Subject: wifi: rt2x00: disable RTS threshold for rt2800 by default
5
6 rt2800 has a lot of registers to control the RTS enable/disable
7 status for different rates. And the driver control them via
8 rt2800_set_rts_threshold(). When RTS was disabled in user
9 interface, this function won't be called at all. This means that
10 the RTS is still 'on' for CCK and OFDM rates. So we'd better to
11 disable them by default because it should be like this. The RTS
12 for HT20 and HT40 is already default off so we don't need to
13 touch them. If we toggle the RTS status, these register bits
14 will be enable/disable again by rt2800_set_rts_threshold().
15
16 Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
17 Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
18 Signed-off-by: Kalle Valo <kvalo@kernel.org>
19 Link: https://lore.kernel.org/r/TYAP286MB03155DDB953155B7A2DE849ABCA4A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM
20 ---
21 drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 4 ++--
22 1 file changed, 2 insertions(+), 2 deletions(-)
23
24 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
25 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
26 @@ -6100,7 +6100,7 @@ static int rt2800_init_registers(struct
27 rt2x00_set_field32(&reg, CCK_PROT_CFG_TX_OP_ALLOW_MM40, 0);
28 rt2x00_set_field32(&reg, CCK_PROT_CFG_TX_OP_ALLOW_GF20, 1);
29 rt2x00_set_field32(&reg, CCK_PROT_CFG_TX_OP_ALLOW_GF40, 0);
30 - rt2x00_set_field32(&reg, CCK_PROT_CFG_RTS_TH_EN, 1);
31 + rt2x00_set_field32(&reg, CCK_PROT_CFG_RTS_TH_EN, 0);
32 rt2800_register_write(rt2x00dev, CCK_PROT_CFG, reg);
33
34 reg = rt2800_register_read(rt2x00dev, OFDM_PROT_CFG);
35 @@ -6113,7 +6113,7 @@ static int rt2800_init_registers(struct
36 rt2x00_set_field32(&reg, OFDM_PROT_CFG_TX_OP_ALLOW_MM40, 0);
37 rt2x00_set_field32(&reg, OFDM_PROT_CFG_TX_OP_ALLOW_GF20, 1);
38 rt2x00_set_field32(&reg, OFDM_PROT_CFG_TX_OP_ALLOW_GF40, 0);
39 - rt2x00_set_field32(&reg, OFDM_PROT_CFG_RTS_TH_EN, 1);
40 + rt2x00_set_field32(&reg, OFDM_PROT_CFG_RTS_TH_EN, 0);
41 rt2800_register_write(rt2x00dev, OFDM_PROT_CFG, reg);
42
43 reg = rt2800_register_read(rt2x00dev, MM20_PROT_CFG);