aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath5k/base.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath5k/base.c')
-rw-r--r--drivers/net/wireless/ath5k/base.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index a08bc8a4fb69..d8c60c53d953 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -64,6 +64,10 @@ static int modparam_nohwcrypt;
64module_param_named(nohwcrypt, modparam_nohwcrypt, int, 0444); 64module_param_named(nohwcrypt, modparam_nohwcrypt, int, 0444);
65MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption."); 65MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");
66 66
67static int modparam_all_channels;
68module_param_named(all_channels, modparam_all_channels, int, 0444);
69MODULE_PARM_DESC(all_channels, "Expose all channels the device can use.");
70
67 71
68/******************\ 72/******************\
69* Internal defines * 73* Internal defines *
@@ -862,6 +866,20 @@ ath5k_ieee2mhz(short chan)
862 return 2212 + chan * 20; 866 return 2212 + chan * 20;
863} 867}
864 868
869/*
870 * Returns true for the channel numbers used without all_channels modparam.
871 */
872static bool ath5k_is_standard_channel(short chan)
873{
874 return ((chan <= 14) ||
875 /* UNII 1,2 */
876 ((chan & 3) == 0 && chan >= 36 && chan <= 64) ||
877 /* midband */
878 ((chan & 3) == 0 && chan >= 100 && chan <= 140) ||
879 /* UNII-3 */
880 ((chan & 3) == 1 && chan >= 149 && chan <= 165));
881}
882
865static unsigned int 883static unsigned int
866ath5k_copy_channels(struct ath5k_hw *ah, 884ath5k_copy_channels(struct ath5k_hw *ah,
867 struct ieee80211_channel *channels, 885 struct ieee80211_channel *channels,
@@ -899,6 +917,9 @@ ath5k_copy_channels(struct ath5k_hw *ah,
899 if (!ath5k_channel_ok(ah, freq, chfreq)) 917 if (!ath5k_channel_ok(ah, freq, chfreq))
900 continue; 918 continue;
901 919
920 if (!modparam_all_channels && !ath5k_is_standard_channel(ch))
921 continue;
922
902 /* Write channel info and increment counter */ 923 /* Write channel info and increment counter */
903 channels[count].center_freq = freq; 924 channels[count].center_freq = freq;
904 channels[count].band = (chfreq == CHANNEL_2GHZ) ? 925 channels[count].band = (chfreq == CHANNEL_2GHZ) ?