diff options
author | Sujith Manoharan <c_manoha@qca.qualcomm.com> | 2012-12-09 20:52:37 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-12-10 15:49:50 -0500 |
commit | 0f21ee8d9c8a041b974cfb75d81d07b61bd0869f (patch) | |
tree | 98f302397e27e08b361d3e2233616720a4fb46a3 /drivers/net | |
parent | d882d242e4bfb2016e611a5aab0112fcece7a8ac (diff) |
ath9k_hw: Add HW cap for PAPRD
Add a HW capability to indicate whether PAPRD is enabled
for the card, since PAPRD could be enabled in the EEPROM, but
disabled in the driver. This makes things clearer.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_paprd.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/link.c | 2 |
5 files changed, 18 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c index c86cb6400040..6b8861c559ed 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | |||
@@ -2987,10 +2987,6 @@ static u32 ath9k_hw_ar9300_get_eeprom(struct ath_hw *ah, | |||
2987 | case EEP_RX_MASK: | 2987 | case EEP_RX_MASK: |
2988 | return pBase->txrxMask & 0xf; | 2988 | return pBase->txrxMask & 0xf; |
2989 | case EEP_PAPRD: | 2989 | case EEP_PAPRD: |
2990 | if (AR_SREV_9462(ah)) | ||
2991 | return false; | ||
2992 | if (!ah->config.enable_paprd) | ||
2993 | return false; | ||
2994 | return !!(pBase->featureEnable & BIT(5)); | 2990 | return !!(pBase->featureEnable & BIT(5)); |
2995 | case EEP_CHAIN_MASK_REDUCE: | 2991 | case EEP_CHAIN_MASK_REDUCE: |
2996 | return (pBase->miscConfiguration >> 0x3) & 0x1; | 2992 | return (pBase->miscConfiguration >> 0x3) & 0x1; |
@@ -5097,7 +5093,7 @@ static void ath9k_hw_ar9300_set_txpower(struct ath_hw *ah, | |||
5097 | */ | 5093 | */ |
5098 | ar9003_hw_get_target_power_eeprom(ah, chan, targetPowerValT2); | 5094 | ar9003_hw_get_target_power_eeprom(ah, chan, targetPowerValT2); |
5099 | 5095 | ||
5100 | if (ah->eep_ops->get_eeprom(ah, EEP_PAPRD)) { | 5096 | if (ar9003_is_paprd_enabled(ah)) { |
5101 | if (IS_CHAN_2GHZ(chan)) | 5097 | if (IS_CHAN_2GHZ(chan)) |
5102 | modal_hdr = &eep->modalHeader2G; | 5098 | modal_hdr = &eep->modalHeader2G; |
5103 | else | 5099 | else |
@@ -5138,7 +5134,7 @@ static void ath9k_hw_ar9300_set_txpower(struct ath_hw *ah, | |||
5138 | twiceAntennaReduction, | 5134 | twiceAntennaReduction, |
5139 | powerLimit); | 5135 | powerLimit); |
5140 | 5136 | ||
5141 | if (ah->eep_ops->get_eeprom(ah, EEP_PAPRD)) { | 5137 | if (ar9003_is_paprd_enabled(ah)) { |
5142 | for (i = 0; i < ar9300RateSize; i++) { | 5138 | for (i = 0; i < ar9300RateSize; i++) { |
5143 | if ((ah->paprd_ratemask & (1 << i)) && | 5139 | if ((ah->paprd_ratemask & (1 << i)) && |
5144 | (abs(targetPowerValT2[i] - | 5140 | (abs(targetPowerValT2[i] - |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c index fb3a87eeb678..aea190883141 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c | |||
@@ -991,3 +991,12 @@ exit: | |||
991 | return !!paprd_done; | 991 | return !!paprd_done; |
992 | } | 992 | } |
993 | EXPORT_SYMBOL(ar9003_paprd_is_done); | 993 | EXPORT_SYMBOL(ar9003_paprd_is_done); |
994 | |||
995 | bool ar9003_is_paprd_enabled(struct ath_hw *ah) | ||
996 | { | ||
997 | if ((ah->caps.hw_caps & ATH9K_HW_CAP_PAPRD) && ah->config.enable_paprd) | ||
998 | return true; | ||
999 | |||
1000 | return false; | ||
1001 | } | ||
1002 | EXPORT_SYMBOL(ar9003_is_paprd_enabled); | ||
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index e06bcec655a7..7cb787065913 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -2599,6 +2599,10 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah) | |||
2599 | pCap->hw_caps |= ATH9K_HW_WOW_PATTERN_MATCH_DWORD; | 2599 | pCap->hw_caps |= ATH9K_HW_WOW_PATTERN_MATCH_DWORD; |
2600 | } | 2600 | } |
2601 | 2601 | ||
2602 | if (AR_SREV_9300_20_OR_LATER(ah) && | ||
2603 | ah->eep_ops->get_eeprom(ah, EEP_PAPRD)) | ||
2604 | pCap->hw_caps |= ATH9K_HW_CAP_PAPRD; | ||
2605 | |||
2602 | return 0; | 2606 | return 0; |
2603 | } | 2607 | } |
2604 | 2608 | ||
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index fe87d0e67a1b..eff67592db18 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -247,6 +247,7 @@ enum ath9k_hw_caps { | |||
247 | ATH9K_HW_WOW_DEVICE_CAPABLE = BIT(17), | 247 | ATH9K_HW_WOW_DEVICE_CAPABLE = BIT(17), |
248 | ATH9K_HW_WOW_PATTERN_MATCH_EXACT = BIT(18), | 248 | ATH9K_HW_WOW_PATTERN_MATCH_EXACT = BIT(18), |
249 | ATH9K_HW_WOW_PATTERN_MATCH_DWORD = BIT(19), | 249 | ATH9K_HW_WOW_PATTERN_MATCH_DWORD = BIT(19), |
250 | ATH9K_HW_CAP_PAPRD = BIT(20), | ||
250 | }; | 251 | }; |
251 | 252 | ||
252 | /* | 253 | /* |
@@ -1061,6 +1062,7 @@ int ar9003_paprd_create_curve(struct ath_hw *ah, | |||
1061 | void ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain); | 1062 | void ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain); |
1062 | int ar9003_paprd_init_table(struct ath_hw *ah); | 1063 | int ar9003_paprd_init_table(struct ath_hw *ah); |
1063 | bool ar9003_paprd_is_done(struct ath_hw *ah); | 1064 | bool ar9003_paprd_is_done(struct ath_hw *ah); |
1065 | bool ar9003_is_paprd_enabled(struct ath_hw *ah); | ||
1064 | 1066 | ||
1065 | /* Hardware family op attach helpers */ | 1067 | /* Hardware family op attach helpers */ |
1066 | void ar5008_hw_attach_phy_ops(struct ath_hw *ah); | 1068 | void ar5008_hw_attach_phy_ops(struct ath_hw *ah); |
diff --git a/drivers/net/wireless/ath/ath9k/link.c b/drivers/net/wireless/ath/ath9k/link.c index c70b31a72556..ade3afb21f91 100644 --- a/drivers/net/wireless/ath/ath9k/link.c +++ b/drivers/net/wireless/ath/ath9k/link.c | |||
@@ -435,7 +435,7 @@ set_timer: | |||
435 | 435 | ||
436 | mod_timer(&common->ani.timer, jiffies + msecs_to_jiffies(cal_interval)); | 436 | mod_timer(&common->ani.timer, jiffies + msecs_to_jiffies(cal_interval)); |
437 | 437 | ||
438 | if (ah->eep_ops->get_eeprom(ah, EEP_PAPRD) && ah->caldata) { | 438 | if (ar9003_is_paprd_enabled(ah) && ah->caldata) { |
439 | if (!ah->caldata->paprd_done) { | 439 | if (!ah->caldata->paprd_done) { |
440 | ieee80211_queue_work(sc->hw, &sc->paprd_work); | 440 | ieee80211_queue_work(sc->hw, &sc->paprd_work); |
441 | } else if (!ah->paprd_table_write_done) { | 441 | } else if (!ah->paprd_table_write_done) { |