diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-12-01 13:07:47 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-12-02 14:10:33 -0500 |
commit | f67e07eb3decd7840b621fba37fd600adfdf99f8 (patch) | |
tree | cbc88e82877d36383543ad116601a95f86a9aaf1 /drivers/net | |
parent | e702ba18f25887c76d26c8a85cc1706463c62e9a (diff) |
ath9k_hw: fix more bitfield related endian issues
A few LNA control related flags were also specified as a bitfields, however
for some strange reason they were written in big-endian order this time.
Fix this by using flags instead.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/eeprom.h | 14 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/eeprom_def.c | 11 |
2 files changed, 16 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.h b/drivers/net/wireless/ath/ath9k/eeprom.h index 41ad1fe62527..dd59f09441a3 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom.h +++ b/drivers/net/wireless/ath/ath9k/eeprom.h | |||
@@ -236,6 +236,15 @@ | |||
236 | #define CTL_EDGE_TPOWER(_ctl) ((_ctl) & 0x3f) | 236 | #define CTL_EDGE_TPOWER(_ctl) ((_ctl) & 0x3f) |
237 | #define CTL_EDGE_FLAGS(_ctl) (((_ctl) >> 6) & 0x03) | 237 | #define CTL_EDGE_FLAGS(_ctl) (((_ctl) >> 6) & 0x03) |
238 | 238 | ||
239 | #define LNA_CTL_BUF_MODE BIT(0) | ||
240 | #define LNA_CTL_ISEL_LO BIT(1) | ||
241 | #define LNA_CTL_ISEL_HI BIT(2) | ||
242 | #define LNA_CTL_BUF_IN BIT(3) | ||
243 | #define LNA_CTL_FEM_BAND BIT(4) | ||
244 | #define LNA_CTL_LOCAL_BIAS BIT(5) | ||
245 | #define LNA_CTL_FORCE_XPA BIT(6) | ||
246 | #define LNA_CTL_USE_ANT1 BIT(7) | ||
247 | |||
239 | enum eeprom_param { | 248 | enum eeprom_param { |
240 | EEP_NFTHRESH_5, | 249 | EEP_NFTHRESH_5, |
241 | EEP_NFTHRESH_2, | 250 | EEP_NFTHRESH_2, |
@@ -381,10 +390,7 @@ struct modal_eep_header { | |||
381 | u8 xatten2Margin[AR5416_MAX_CHAINS]; | 390 | u8 xatten2Margin[AR5416_MAX_CHAINS]; |
382 | u8 ob_ch1; | 391 | u8 ob_ch1; |
383 | u8 db_ch1; | 392 | u8 db_ch1; |
384 | u8 useAnt1:1, | 393 | u8 lna_ctl; |
385 | force_xpaon:1, | ||
386 | local_bias:1, | ||
387 | femBandSelectUsed:1, xlnabufin:1, xlnaisel:2, xlnabufmode:1; | ||
388 | u8 miscBits; | 394 | u8 miscBits; |
389 | u16 xpaBiasLvlFreq[3]; | 395 | u16 xpaBiasLvlFreq[3]; |
390 | u8 futureModal[6]; | 396 | u8 futureModal[6]; |
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_def.c b/drivers/net/wireless/ath/ath9k/eeprom_def.c index 76b4d65472dd..526d7c933f7f 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom_def.c +++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c | |||
@@ -451,9 +451,10 @@ static void ath9k_hw_def_set_board_values(struct ath_hw *ah, | |||
451 | ath9k_hw_analog_shift_rmw(ah, AR_AN_TOP2, | 451 | ath9k_hw_analog_shift_rmw(ah, AR_AN_TOP2, |
452 | AR_AN_TOP2_LOCALBIAS, | 452 | AR_AN_TOP2_LOCALBIAS, |
453 | AR_AN_TOP2_LOCALBIAS_S, | 453 | AR_AN_TOP2_LOCALBIAS_S, |
454 | pModal->local_bias); | 454 | !!(pModal->lna_ctl & |
455 | LNA_CTL_LOCAL_BIAS)); | ||
455 | REG_RMW_FIELD(ah, AR_PHY_XPA_CFG, AR_PHY_FORCE_XPA_CFG, | 456 | REG_RMW_FIELD(ah, AR_PHY_XPA_CFG, AR_PHY_FORCE_XPA_CFG, |
456 | pModal->force_xpaon); | 457 | !!(pModal->lna_ctl & LNA_CTL_FORCE_XPA)); |
457 | } | 458 | } |
458 | 459 | ||
459 | REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, | 460 | REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, |
@@ -1428,9 +1429,9 @@ static u8 ath9k_hw_def_get_num_ant_config(struct ath_hw *ah, | |||
1428 | 1429 | ||
1429 | num_ant_config = 1; | 1430 | num_ant_config = 1; |
1430 | 1431 | ||
1431 | if (pBase->version >= 0x0E0D) | 1432 | if (pBase->version >= 0x0E0D && |
1432 | if (pModal->useAnt1) | 1433 | (pModal->lna_ctl & LNA_CTL_USE_ANT1)) |
1433 | num_ant_config += 1; | 1434 | num_ant_config += 1; |
1434 | 1435 | ||
1435 | return num_ant_config; | 1436 | return num_ant_config; |
1436 | } | 1437 | } |