summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/eeprom.h
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-04-16 22:46:31 +0200
committerJohn W. Linville <linville@tuxdriver.com>2012-04-17 14:57:13 -0400
commit23bd7cedf1f1c97a5019de6f7736ab935d7cc6a3 (patch)
tree1ed1e48edf1c61382258021b2acf8c98687300c5 /drivers/net/wireless/ath/ath9k/eeprom.h
parent86ae26d72191816fb6fdcf9094748fbae4d21779 (diff)
downloadblackbird-op-linux-23bd7cedf1f1c97a5019de6f7736ab935d7cc6a3.tar.gz
blackbird-op-linux-23bd7cedf1f1c97a5019de6f7736ab935d7cc6a3.zip
ath9k: move ath9k_hw_fbin2freq function to eeprom.h
Both eeprom.c and ar9003_eeprom.c has an indentical 'ath9k_hw_fbin2freq' function. Move the function to a common place and remove the duplicates. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/eeprom.h')
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.h b/drivers/net/wireless/ath/ath9k/eeprom.h
index 689f0d02ca0c..33acb920ed3f 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom.h
+++ b/drivers/net/wireless/ath/ath9k/eeprom.h
@@ -699,6 +699,14 @@ void ath9k_hw_get_gain_boundaries_pdadcs(struct ath_hw *ah,
u16 *pPdGainBoundaries, u8 *pPDADCValues,
u16 numXpdGains);
+static inline u16 ath9k_hw_fbin2freq(u8 fbin, bool is2GHz)
+{
+ if (fbin == AR5416_BCHAN_UNUSED)
+ return fbin;
+
+ return (u16) ((is2GHz) ? (2300 + fbin) : (4800 + 5 * fbin));
+}
+
#define ar5416_get_ntxchains(_txchainmask) \
(((_txchainmask >> 2) & 1) + \
((_txchainmask >> 1) & 1) + (_txchainmask & 1))
OpenPOWER on IntegriCloud