1 --- a/drivers/net/wireless/ath/ath9k/eeprom.h
2 +++ b/drivers/net/wireless/ath/ath9k/eeprom.h
4 #define CTL_EDGE_TPOWER(_ctl) ((_ctl) & 0x3f)
5 #define CTL_EDGE_FLAGS(_ctl) (((_ctl) >> 6) & 0x03)
7 +#define LNA_CTL_BUF_MODE BIT(0)
8 +#define LNA_CTL_ISEL_LO BIT(1)
9 +#define LNA_CTL_ISEL_HI BIT(2)
10 +#define LNA_CTL_BUF_IN BIT(3)
11 +#define LNA_CTL_FEM_BAND BIT(4)
12 +#define LNA_CTL_LOCAL_BIAS BIT(5)
13 +#define LNA_CTL_FORCE_XPA BIT(6)
14 +#define LNA_CTL_USE_ANT1 BIT(7)
19 @@ -381,10 +390,7 @@ struct modal_eep_header {
20 u8 xatten2Margin[AR5416_MAX_CHAINS];
26 - femBandSelectUsed:1, xlnabufin:1, xlnaisel:2, xlnabufmode:1;
29 u16 xpaBiasLvlFreq[3];
31 --- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
32 +++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
33 @@ -451,9 +451,10 @@ static void ath9k_hw_def_set_board_value
34 ath9k_hw_analog_shift_rmw(ah, AR_AN_TOP2,
36 AR_AN_TOP2_LOCALBIAS_S,
37 - pModal->local_bias);
38 + !!(pModal->lna_ctl &
39 + LNA_CTL_LOCAL_BIAS));
40 REG_RMW_FIELD(ah, AR_PHY_XPA_CFG, AR_PHY_FORCE_XPA_CFG,
41 - pModal->force_xpaon);
42 + !!(pModal->lna_ctl & LNA_CTL_FORCE_XPA));
45 REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH,
46 @@ -1432,9 +1433,9 @@ static u8 ath9k_hw_def_get_num_ant_confi
50 - if (pBase->version >= 0x0E0D)
51 - if (pModal->useAnt1)
52 - num_ant_config += 1;
53 + if (pBase->version >= 0x0E0D &&
54 + (pModal->lna_ctl & LNA_CTL_USE_ANT1))
55 + num_ant_config += 1;
57 return num_ant_config;