From patchwork Tue Jul 3 23:15:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Luis R. Rodriguez" X-Patchwork-Id: 1153441 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 8C5A3DFFF3 for ; Tue, 3 Jul 2012 23:15:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933164Ab2GCXPf (ORCPT ); Tue, 3 Jul 2012 19:15:35 -0400 Received: from wolverine02.qualcomm.com ([199.106.114.251]:17555 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933064Ab2GCXPe (ORCPT ); Tue, 3 Jul 2012 19:15:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1341357335; x=1372893335; h=cc:from:to:subject:date:message-id:in-reply-to: references:mime-version; bh=oZKgF7ZUXojo9KWJLcYOzKK51pcWERBm1sFbtZKouDU=; b=zjnzsukFaI1OFn2i413NbrOAi1xbU9sp4xWwOiSasx4og+MtbILEYAdU 3sN1N2Yymdjc/NBSPOzfeYL7s6IumonBmLx+IFFqKYqt3WC3u8NU+e4Yk Rydczef7CaM2Wehu2AO6yhF6ydCdCLzCP05htn1A5CrJwwlYfk/MiB6oK Y=; X-IronPort-AV: E=McAfee;i="5400,1158,6761"; a="204910217" Received: from ironmsg04-l.qualcomm.com ([172.30.48.19]) by wolverine02.qualcomm.com with ESMTP; 03 Jul 2012 16:15:35 -0700 Cc: , , , , , "Luis R. Rodriguez" X-IronPort-AV: E=Sophos;i="4.77,518,1336374000"; d="scan'208";a="252906410" Received: from nasanexhc07.na.qualcomm.com ([172.30.39.190]) by Ironmsg04-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 03 Jul 2012 16:15:35 -0700 Received: from tux (172.30.39.5) by qcmail1.qualcomm.com (172.30.39.190) with Microsoft SMTP Server (TLS) id 14.2.283.3; Tue, 3 Jul 2012 16:15:31 -0700 Received: by tux (sSMTP sendmail emulation); Tue, 03 Jul 2012 16:15:29 -0700 From: "Luis R. Rodriguez" To: , Subject: [PATCH 2/4] ath5k: replace modparam_all_channels with CONFIG_ATH5K_TEST_CHANNELS Date: Tue, 3 Jul 2012 16:15:13 -0700 Message-ID: <1341357315-8053-3-git-send-email-rodrigue@qca.qualcomm.com> X-Mailer: git-send-email 1.7.10.rc1.22.gf5241 In-Reply-To: <1341357315-8053-1-git-send-email-rodrigue@qca.qualcomm.com> References: <1341357315-8053-1-git-send-email-rodrigue@qca.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [172.30.39.5] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: "Luis R. Rodriguez" This stashes away this feature from standard kernel builds. Signed-off-by: Luis R. Rodriguez --- drivers/net/wireless/ath/ath5k/Kconfig | 8 ++++++++ drivers/net/wireless/ath/ath5k/base.c | 17 ++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/ath5k/Kconfig b/drivers/net/wireless/ath/ath5k/Kconfig index e18a9aa..338c5c4 100644 --- a/drivers/net/wireless/ath/ath5k/Kconfig +++ b/drivers/net/wireless/ath/ath5k/Kconfig @@ -64,3 +64,11 @@ config ATH5K_PCI ---help--- This adds support for PCI type chipsets of the 5xxx Atheros family. + +config ATH5K_TEST_CHANNELS + bool "Enables testing channels on ath5k" + depends on ATH5K && CFG80211_CERTIFICATION_ONUS + ---help--- + This enables non-standard IEEE 802.11 channels on ath5k, which + can be used for research purposes. This option should be disabled + unless doing research. diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 44ad6fe..8c4c040 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; module_param_named(nohwcrypt, ath5k_modparam_nohwcrypt, bool, S_IRUGO); MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption."); -static bool modparam_all_channels; -module_param_named(all_channels, modparam_all_channels, bool, S_IRUGO); -MODULE_PARM_DESC(all_channels, "Expose all channels the device can use."); - static bool modparam_fastchanswitch; module_param_named(fastchanswitch, modparam_fastchanswitch, bool, S_IRUGO); MODULE_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 \********************/ /* - * Returns true for the channel numbers used without all_channels modparam. + * Returns true for the channel numbers used. */ +#ifdef CONFIG_ATH5K_TEST_CHANNELS +static bool ath5k_is_standard_channel(short chan, enum ieee80211_band band) +{ + return true; +} + +#else static bool ath5k_is_standard_channel(short chan, enum ieee80211_band band) { if (band == IEEE80211_BAND_2GHZ && chan <= 14) @@ -276,6 +279,7 @@ static bool ath5k_is_standard_channel(short chan, enum ieee80211_band band) /* 802.11j 4.9GHz (20MHz) */ (chan == 184 || chan == 188 || chan == 192 || chan == 196)); } +#endif static unsigned int ath5k_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, if (!ath5k_channel_ok(ah, &channels[count])) continue; - if (!modparam_all_channels && - !ath5k_is_standard_channel(ch, band)) + if (!ath5k_is_standard_channel(ch, band)) continue; count++;