aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-04-16 16:46:31 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-17 14:57:13 -0400
commit23bd7cedf1f1c97a5019de6f7736ab935d7cc6a3 (patch)
tree1ed1e48edf1c61382258021b2acf8c98687300c5
parent86ae26d72191816fb6fdcf9094748fbae4d21779 (diff)
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>
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_eeprom.c9
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom.c8
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom.h8
3 files changed, 8 insertions, 17 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index 8bfd0ef7f23b..f2333135738e 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -2931,15 +2931,6 @@ static const struct ar9300_eeprom *ar9003_eeprom_struct_find_by_id(int id)
2931#undef N_LOOP 2931#undef N_LOOP
2932} 2932}
2933 2933
2934
2935static u16 ath9k_hw_fbin2freq(u8 fbin, bool is2GHz)
2936{
2937 if (fbin == AR5416_BCHAN_UNUSED)
2938 return fbin;
2939
2940 return (u16) ((is2GHz) ? (2300 + fbin) : (4800 + 5 * fbin));
2941}
2942
2943static int ath9k_hw_ar9300_check_eeprom(struct ath_hw *ah) 2934static int ath9k_hw_ar9300_check_eeprom(struct ath_hw *ah)
2944{ 2935{
2945 return 0; 2936 return 0;
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.c b/drivers/net/wireless/ath/ath9k/eeprom.c
index 9457825c2c7c..0512397a293c 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom.c
@@ -16,14 +16,6 @@
16 16
17#include "hw.h" 17#include "hw.h"
18 18
19static inline u16 ath9k_hw_fbin2freq(u8 fbin, bool is2GHz)
20{
21 if (fbin == AR5416_BCHAN_UNUSED)
22 return fbin;
23
24 return (u16) ((is2GHz) ? (2300 + fbin) : (4800 + 5 * fbin));
25}
26
27void ath9k_hw_analog_shift_regwrite(struct ath_hw *ah, u32 reg, u32 val) 19void ath9k_hw_analog_shift_regwrite(struct ath_hw *ah, u32 reg, u32 val)
28{ 20{
29 REG_WRITE(ah, reg, val); 21 REG_WRITE(ah, reg, val);
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,
699 u16 *pPdGainBoundaries, u8 *pPDADCValues, 699 u16 *pPdGainBoundaries, u8 *pPDADCValues,
700 u16 numXpdGains); 700 u16 numXpdGains);
701 701
702static inline u16 ath9k_hw_fbin2freq(u8 fbin, bool is2GHz)
703{
704 if (fbin == AR5416_BCHAN_UNUSED)
705 return fbin;
706
707 return (u16) ((is2GHz) ? (2300 + fbin) : (4800 + 5 * fbin));
708}
709
702#define ar5416_get_ntxchains(_txchainmask) \ 710#define ar5416_get_ntxchains(_txchainmask) \
703 (((_txchainmask >> 2) & 1) + \ 711 (((_txchainmask >> 2) & 1) + \
704 ((_txchainmask >> 1) & 1) + (_txchainmask & 1)) 712 ((_txchainmask >> 1) & 1) + (_txchainmask & 1))