Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1782352d authored by Felix Fietkau's avatar Felix Fietkau Committed by John W. Linville
Browse files

ath9k_hw: fix the PA predistortion rate mask



The EEPROM PAPRD rate mask fields only contain mask values for actual
rates in the low 25 bits. The upper bits are reserved for tx power
scale values. Add the proper mask definitions and use them before
writing the values to the register.

Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 7607cbe2
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -31,6 +31,12 @@
#define AR9300_ANT_16S               25
#define AR9300_ANT_16S               25
#define AR9300_FUTURE_MODAL_SZ       6
#define AR9300_FUTURE_MODAL_SZ       6


#define AR9300_PAPRD_RATE_MASK		0x01ffffff
#define AR9300_PAPRD_SCALE_1		0x0e000000
#define AR9300_PAPRD_SCALE_1_S		25
#define AR9300_PAPRD_SCALE_2		0x70000000
#define AR9300_PAPRD_SCALE_2_S		28

/* Delta from which to start power to pdadc table */
/* Delta from which to start power to pdadc table */
/* This offset is used in both open loop and closed loop power control
/* This offset is used in both open loop and closed loop power control
 * schemes. In open loop power control, it is not really needed, but for
 * schemes. In open loop power control, it is not really needed, but for
+2 −2
Original line number Original line Diff line number Diff line
@@ -52,8 +52,8 @@ static void ar9003_paprd_setup_single_table(struct ath_hw *ah)
	else
	else
		hdr = &eep->modalHeader2G;
		hdr = &eep->modalHeader2G;


	am_mask = le32_to_cpu(hdr->papdRateMaskHt20);
	am_mask = le32_to_cpu(hdr->papdRateMaskHt20) & AR9300_PAPRD_RATE_MASK;
	ht40_mask = le32_to_cpu(hdr->papdRateMaskHt40);
	ht40_mask = le32_to_cpu(hdr->papdRateMaskHt40) & AR9300_PAPRD_RATE_MASK;


	REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2AM, AR_PHY_PAPRD_AM2AM_MASK, am_mask);
	REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2AM, AR_PHY_PAPRD_AM2AM_MASK, am_mask);
	REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2PM, AR_PHY_PAPRD_AM2PM_MASK, am_mask);
	REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2PM, AR_PHY_PAPRD_AM2PM_MASK, am_mask);