aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath5k/eeprom.c
diff options
context:
space:
mode:
authorBruno Randolf <br1@einfach.org>2010-12-21 03:30:43 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-12-22 15:43:28 -0500
commit0207c0c51a37659a92232e665f2a7fadec170556 (patch)
treebc5755f6252c47c7722c3e69eee92c7274b36320 /drivers/net/wireless/ath/ath5k/eeprom.c
parent26a51ad7f285236ca593c57cffcaadd40514084a (diff)
ath5k: Use helper function to get eeprom mode from channel
Introduce a helper function to get the EEPROM mode from channel and remove multiple similar switch statements. Also since it's now easy to get the EEPROM mode from the channel, use them inside the functions which need it, instead of passing a redundant ee_mode parameter. Signed-off-by: Bruno Randolf <br1@einfach.org> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/eeprom.c')
-rw-r--r--drivers/net/wireless/ath/ath5k/eeprom.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath5k/eeprom.c b/drivers/net/wireless/ath/ath5k/eeprom.c
index 97eaa9a4415..80e625608ba 100644
--- a/drivers/net/wireless/ath/ath5k/eeprom.c
+++ b/drivers/net/wireless/ath/ath5k/eeprom.c
@@ -1802,3 +1802,19 @@ ath5k_eeprom_detach(struct ath5k_hw *ah)
1802 for (mode = AR5K_EEPROM_MODE_11A; mode <= AR5K_EEPROM_MODE_11G; mode++) 1802 for (mode = AR5K_EEPROM_MODE_11A; mode <= AR5K_EEPROM_MODE_11G; mode++)
1803 ath5k_eeprom_free_pcal_info(ah, mode); 1803 ath5k_eeprom_free_pcal_info(ah, mode);
1804} 1804}
1805
1806int
1807ath5k_eeprom_mode_from_channel(struct ieee80211_channel *channel)
1808{
1809 switch (channel->hw_value & CHANNEL_MODES) {
1810 case CHANNEL_A:
1811 case CHANNEL_XR:
1812 return AR5K_EEPROM_MODE_11A;
1813 case CHANNEL_G:
1814 return AR5K_EEPROM_MODE_11G;
1815 case CHANNEL_B:
1816 return AR5K_EEPROM_MODE_11B;
1817 default:
1818 return -1;
1819 }
1820}