diff options
author | Vasanthakumar Thiagarajan <vasanth@atheros.com> | 2010-12-15 10:30:51 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-12-16 15:22:30 -0500 |
commit | 8698bca6b53d1f6641850b270de9c953078ed1ce (patch) | |
tree | a4d1fa53c6f4588bd27d3e89716512a8c78a80eb /drivers | |
parent | 0b2084bc578128be866d6fc9926ed887c3432bb1 (diff) |
ath9k_hw: Add a helper to get paprd scale factor
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 21 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_eeprom.h | 3 |
2 files changed, 24 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c index 4149ffb6d54a..9fa5793abd27 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | |||
@@ -4843,6 +4843,27 @@ u8 *ar9003_get_spur_chan_ptr(struct ath_hw *ah, bool is_2ghz) | |||
4843 | return eep->modalHeader5G.spurChans; | 4843 | return eep->modalHeader5G.spurChans; |
4844 | } | 4844 | } |
4845 | 4845 | ||
4846 | unsigned int ar9003_get_paprd_scale_factor(struct ath_hw *ah, | ||
4847 | struct ath9k_channel *chan) | ||
4848 | { | ||
4849 | struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep; | ||
4850 | |||
4851 | if (IS_CHAN_2GHZ(chan)) | ||
4852 | return MS(le32_to_cpu(eep->modalHeader2G.papdRateMaskHt20), | ||
4853 | AR9300_PAPRD_SCALE_1); | ||
4854 | else { | ||
4855 | if (chan->channel >= 5700) | ||
4856 | return MS(le32_to_cpu(eep->modalHeader5G.papdRateMaskHt20), | ||
4857 | AR9300_PAPRD_SCALE_1); | ||
4858 | else if (chan->channel >= 5400) | ||
4859 | return MS(le32_to_cpu(eep->modalHeader5G.papdRateMaskHt40), | ||
4860 | AR9300_PAPRD_SCALE_2); | ||
4861 | else | ||
4862 | return MS(le32_to_cpu(eep->modalHeader5G.papdRateMaskHt40), | ||
4863 | AR9300_PAPRD_SCALE_1); | ||
4864 | } | ||
4865 | } | ||
4866 | |||
4846 | const struct eeprom_ops eep_ar9300_ops = { | 4867 | const struct eeprom_ops eep_ar9300_ops = { |
4847 | .check_eeprom = ath9k_hw_ar9300_check_eeprom, | 4868 | .check_eeprom = ath9k_hw_ar9300_check_eeprom, |
4848 | .get_eeprom = ath9k_hw_ar9300_get_eeprom, | 4869 | .get_eeprom = ath9k_hw_ar9300_get_eeprom, |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h index efb6a02be377..afb0b5ee1865 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h | |||
@@ -315,4 +315,7 @@ s32 ar9003_hw_get_tx_gain_idx(struct ath_hw *ah); | |||
315 | s32 ar9003_hw_get_rx_gain_idx(struct ath_hw *ah); | 315 | s32 ar9003_hw_get_rx_gain_idx(struct ath_hw *ah); |
316 | 316 | ||
317 | u8 *ar9003_get_spur_chan_ptr(struct ath_hw *ah, bool is_2ghz); | 317 | u8 *ar9003_get_spur_chan_ptr(struct ath_hw *ah, bool is_2ghz); |
318 | |||
319 | unsigned int ar9003_get_paprd_scale_factor(struct ath_hw *ah, | ||
320 | struct ath9k_channel *chan); | ||
318 | #endif | 321 | #endif |