aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath5k
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@qca.qualcomm.com>2012-07-06 18:21:51 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-07-11 15:40:23 -0400
commit2f8684ce7a47c91da7e0ccba2686277c103d02b6 (patch)
treea8abf57ce1250812190aae6749947fe41d0fbfad /drivers/net/wireless/ath/ath5k
parentce8126c334f4960fc091d57ad293b250be7f3a4f (diff)
ath5k: replace modparam_all_channels with CONFIG_ATH5K_TEST_CHANNELS
This stashes away this feature from standard kernel builds. Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k')
-rw-r--r--drivers/net/wireless/ath/ath5k/Kconfig8
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c17
2 files changed, 18 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/ath5k/Kconfig b/drivers/net/wireless/ath/ath5k/Kconfig
index e18a9aa7b6ca..338c5c42357d 100644
--- a/drivers/net/wireless/ath/ath5k/Kconfig
+++ b/drivers/net/wireless/ath/ath5k/Kconfig
@@ -64,3 +64,11 @@ config ATH5K_PCI
64 ---help--- 64 ---help---
65 This adds support for PCI type chipsets of the 5xxx Atheros 65 This adds support for PCI type chipsets of the 5xxx Atheros
66 family. 66 family.
67
68config ATH5K_TEST_CHANNELS
69 bool "Enables testing channels on ath5k"
70 depends on ATH5K && CFG80211_CERTIFICATION_ONUS
71 ---help---
72 This enables non-standard IEEE 802.11 channels on ath5k, which
73 can be used for research purposes. This option should be disabled
74 unless doing research.
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 44ad6fe0278f..8c4c040a47b8 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -74,10 +74,6 @@ bool ath5k_modparam_nohwcrypt;
74module_param_named(nohwcrypt, ath5k_modparam_nohwcrypt, bool, S_IRUGO); 74module_param_named(nohwcrypt, ath5k_modparam_nohwcrypt, bool, S_IRUGO);
75MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption."); 75MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");
76 76
77static bool modparam_all_channels;
78module_param_named(all_channels, modparam_all_channels, bool, S_IRUGO);
79MODULE_PARM_DESC(all_channels, "Expose all channels the device can use.");
80
81static bool modparam_fastchanswitch; 77static bool modparam_fastchanswitch;
82module_param_named(fastchanswitch, modparam_fastchanswitch, bool, S_IRUGO); 78module_param_named(fastchanswitch, modparam_fastchanswitch, bool, S_IRUGO);
83MODULE_PARM_DESC(fastchanswitch, "Enable fast channel switching for AR2413/AR5413 radios."); 79MODULE_PARM_DESC(fastchanswitch, "Enable fast channel switching for AR2413/AR5413 radios.");
@@ -258,8 +254,15 @@ static int ath5k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *re
258\********************/ 254\********************/
259 255
260/* 256/*
261 * Returns true for the channel numbers used without all_channels modparam. 257 * Returns true for the channel numbers used.
262 */ 258 */
259#ifdef CONFIG_ATH5K_TEST_CHANNELS
260static bool ath5k_is_standard_channel(short chan, enum ieee80211_band band)
261{
262 return true;
263}
264
265#else
263static bool ath5k_is_standard_channel(short chan, enum ieee80211_band band) 266static bool ath5k_is_standard_channel(short chan, enum ieee80211_band band)
264{ 267{
265 if (band == IEEE80211_BAND_2GHZ && chan <= 14) 268 if (band == IEEE80211_BAND_2GHZ && chan <= 14)
@@ -276,6 +279,7 @@ static bool ath5k_is_standard_channel(short chan, enum ieee80211_band band)
276 /* 802.11j 4.9GHz (20MHz) */ 279 /* 802.11j 4.9GHz (20MHz) */
277 (chan == 184 || chan == 188 || chan == 192 || chan == 196)); 280 (chan == 184 || chan == 188 || chan == 192 || chan == 196));
278} 281}
282#endif
279 283
280static unsigned int 284static unsigned int
281ath5k_setup_channels(struct ath5k_hw *ah, struct ieee80211_channel *channels, 285ath5k_setup_channels(struct ath5k_hw *ah, struct ieee80211_channel *channels,
@@ -316,8 +320,7 @@ ath5k_setup_channels(struct ath5k_hw *ah, struct ieee80211_channel *channels,
316 if (!ath5k_channel_ok(ah, &channels[count])) 320 if (!ath5k_channel_ok(ah, &channels[count]))
317 continue; 321 continue;
318 322
319 if (!modparam_all_channels && 323 if (!ath5k_is_standard_channel(ch, band))
320 !ath5k_is_standard_channel(ch, band))
321 continue; 324 continue;
322 325
323 count++; 326 count++;