Skip to content

Commit 331c5ea

Browse files
Mohammed Shafi Shajakhanlinvjw
authored andcommitted
ath9k_hw: Disable PAPRD based on paprd_ht20_mask for 5GHz
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent e156103 commit 331c5ea

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

‎drivers/net/wireless/ath/ath9k/ar9003_paprd.c‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,36 @@ void ar9003_paprd_enable(struct ath_hw *ah, bool val)
2121
{
2222
struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
2323
struct ath9k_channel *chan = ah->curchan;
24+
struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep;
25+
26+
/*
27+
* 3 bits for modalHeader5G.papdRateMaskHt20
28+
* is used for sub-band disabling of PAPRD.
29+
* 5G band is divided into 3 sub-bands -- upper,
30+
* middle, lower.
31+
* if bit 30 of modalHeader5G.papdRateMaskHt20 is set
32+
* -- disable PAPRD for upper band 5GHz
33+
* if bit 29 of modalHeader5G.papdRateMaskHt20 is set
34+
* -- disable PAPRD for middle band 5GHz
35+
* if bit 28 of modalHeader5G.papdRateMaskHt20 is set
36+
* -- disable PAPRD for lower band 5GHz
37+
*/
38+
39+
if (IS_CHAN_5GHZ(chan)) {
40+
if (chan->channel >= UPPER_5G_SUB_BAND_START) {
41+
if (le32_to_cpu(eep->modalHeader5G.papdRateMaskHt20)
42+
& BIT(30))
43+
val = false;
44+
} else if (chan->channel >= MID_5G_SUB_BAND_START) {
45+
if (le32_to_cpu(eep->modalHeader5G.papdRateMaskHt20)
46+
& BIT(29))
47+
val = false;
48+
} else {
49+
if (le32_to_cpu(eep->modalHeader5G.papdRateMaskHt20)
50+
& BIT(28))
51+
val = false;
52+
}
53+
}
2454

2555
if (val) {
2656
ah->paprd_table_write_done = true;

‎drivers/net/wireless/ath/ath9k/hw.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@
143143
#define AR_KEYTABLE_SIZE 128
144144
#define POWER_UP_TIME 10000
145145
#define SPUR_RSSI_THRESH 40
146+
#define UPPER_5G_SUB_BAND_START 5700
147+
#define MID_5G_SUB_BAND_START 5400
146148

147149
#define CAB_TIMEOUT_VAL 10
148150
#define BEACON_TIMEOUT_VAL 10

0 commit comments

Comments
 (0)