aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2010-10-05 05:32:17 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-10-05 13:37:52 -0400
commit970bf9d40c03e48cc34ee2c1a70693a0e0fca3f6 (patch)
tree8ab38c35017c1107fc1cc72e1b204fe98fed0bf7
parent4198a8d036c998ca8cec1b08116ab9f6a3a9ffff (diff)
ath9k: get correct tx gain type in ath9k_hw_4k_get_eeprom
The base_eep_header_4k structure contains information that the device supports high power tx gain table or not. However the ath9k_hw_4k_get_eeprom function does not return that value when it is called with EEP_TXGAIN_TYPE. This leads to that the tx gain initialization will use the init values from the original tx gain table even if the device inidicates that the high power table should be used. Changes-licensed-under: ISC Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: Shu Hwa Shen <shensh@zcomm.com.cn> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom_4k.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_4k.c b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
index d6eed1f02e8..872e75b0b57 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
@@ -179,6 +179,9 @@ static u32 ath9k_hw_4k_get_eeprom(struct ath_hw *ah,
179 struct ar5416_eeprom_4k *eep = &ah->eeprom.map4k; 179 struct ar5416_eeprom_4k *eep = &ah->eeprom.map4k;
180 struct modal_eep_4k_header *pModal = &eep->modalHeader; 180 struct modal_eep_4k_header *pModal = &eep->modalHeader;
181 struct base_eep_header_4k *pBase = &eep->baseEepHeader; 181 struct base_eep_header_4k *pBase = &eep->baseEepHeader;
182 u16 ver_minor;
183
184 ver_minor = pBase->version & AR5416_EEP_VER_MINOR_MASK;
182 185
183 switch (param) { 186 switch (param) {
184 case EEP_NFTHRESH_2: 187 case EEP_NFTHRESH_2:
@@ -204,7 +207,7 @@ static u32 ath9k_hw_4k_get_eeprom(struct ath_hw *ah,
204 case EEP_DB_2: 207 case EEP_DB_2:
205 return pModal->db1_1; 208 return pModal->db1_1;
206 case EEP_MINOR_REV: 209 case EEP_MINOR_REV:
207 return pBase->version & AR5416_EEP_VER_MINOR_MASK; 210 return ver_minor;
208 case EEP_TX_MASK: 211 case EEP_TX_MASK:
209 return pBase->txMask; 212 return pBase->txMask;
210 case EEP_RX_MASK: 213 case EEP_RX_MASK:
@@ -217,6 +220,11 @@ static u32 ath9k_hw_4k_get_eeprom(struct ath_hw *ah,
217 return pModal->version; 220 return pModal->version;
218 case EEP_ANT_DIV_CTL1: 221 case EEP_ANT_DIV_CTL1:
219 return pModal->antdiv_ctl1; 222 return pModal->antdiv_ctl1;
223 case EEP_TXGAIN_TYPE:
224 if (ver_minor >= AR5416_EEP_MINOR_VER_19)
225 return pBase->txGainType;
226 else
227 return AR5416_EEP_TXGAIN_ORIGINAL;
220 default: 228 default:
221 return 0; 229 return 0;
222 } 230 }