From patchwork Thu Mar 23 13:30:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Wunderlich X-Patchwork-Id: 9641115 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 73DF0601E9 for ; Thu, 23 Mar 2017 13:31:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 64777284CB for ; Thu, 23 Mar 2017 13:31:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 58DAA284EC; Thu, 23 Mar 2017 13:31:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3A3AE284F2 for ; Thu, 23 Mar 2017 13:31:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=E5+V7vnfn/7Oh4+F1WmSt5ZGO50PqJyv3MdhKUitAoI=; b=l7Lo/mPSZP3TndiZpYmzwHtJ2C 8vI4LAi4dF0VJ0rEgpIkZ0j+///7JWjTT5xvrRqaqNS2kFR8PAbH0UQw3KJt16o1Si8so5g8pWf3b lSdlsjIL/eFTWhep88uZNBd8MdYghU9bUPo0r1xA6bSDFq+pxgm9Xi38BpRLsY1pV4hIhpfC4pa87 AjA5m6cX5rclIkyvsC+uBpcxh3Z8uRp48RGp0MKmY/e5fmKtofB7kdWph48ZwVp6+v1r0vJb0S2FF g3eaabnYxOlNamnL7mi72e0uP1SBYM7AZVjR2/AZaidI24ElJ3dXy6XlYR26uA8jdjrMwNfJ824wY cq+UCoIQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cr2po-0001cU-FL; Thu, 23 Mar 2017 13:31:24 +0000 Received: from packetmixer.de ([2001:4d88:2000:24::c0de] helo=mail.mail.packetmixer.de) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cr2pd-0001Ss-Ur for ath10k@lists.infradead.org; Thu, 23 Mar 2017 13:31:18 +0000 Received: from kero.packetmixer.de (p2003007C6F5BE70009DEAF779F8714A6.dip0.t-ipconnect.de [IPv6:2003:7c:6f5b:e700:9de:af77:9f87:14a6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mail.packetmixer.de (Postfix) with ESMTPSA id B01C862286; Thu, 23 Mar 2017 14:30:51 +0100 (CET) From: Simon Wunderlich To: ath10k@lists.infradead.org, ath9k-devel@qca.qualcomm.com Subject: [PATCH v2 1/3] ath9k: Support channels in licensed bands Date: Thu, 23 Mar 2017 14:30:46 +0100 Message-Id: <20170323133048.30062-2-sw@simonwunderlich.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170323133048.30062-1-sw@simonwunderlich.de> References: <20170323133048.30062-1-sw@simonwunderlich.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170323_063114_365663_F2924064 X-CRM114-Status: GOOD ( 12.68 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Julian Calaby , Ben Greear , Mathias Kretschmer , linux-wireless@vger.kernel.org, Simon Wunderlich MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ben Greear Many chips support channels in licensed bands. Add support for those, along with a corresponding kernel config option to disable them by default. Note that these channels are not selectable even if the option has been compiled unless the user modifies the regulatory database to explicitly enable the corresponding channels. NOTE: These channels must not be used in most regulatory domains unless you have a license from the FCC or similar! Signed-off-by: Ben Greear [Hide this support behind a Kconfig option] Signed-off-by: Julian Calaby [only use the 20 mhz channels, add 5 ghz, change to 4.9ghz to licensed bands, simplify] Signed-off-by: Simon Wunderlich Signed-off-by: Mathias Kretschmer --- Changes to PATCHv1: * fix bug reported by Zefir, and simplify patch more --- drivers/net/wireless/ath/ath9k/Kconfig | 20 ++++++++++++++++++++ drivers/net/wireless/ath/ath9k/common-init.c | 15 +++++++++++++++ drivers/net/wireless/ath/ath9k/hw.h | 4 ++++ 3 files changed, 39 insertions(+) diff --git a/drivers/net/wireless/ath/ath9k/Kconfig b/drivers/net/wireless/ath/ath9k/Kconfig index 783a38f1a626..23b8abf4449a 100644 --- a/drivers/net/wireless/ath/ath9k/Kconfig +++ b/drivers/net/wireless/ath/ath9k/Kconfig @@ -116,6 +116,26 @@ config ATH9K_DFS_CERTIFIED developed. At this point enabling this option won't do anything except increase code size. +config ATH9K_LICENSED_CHAN + bool "Support channels in licensed bands" + depends on ATH9K && CFG80211_CERTIFICATION_ONUS + default n + ---help--- + This option enables support for licensed channels on such as + 4.9 GHz (public safety). + + These are PUBLIC SAFETY CHANNELS and MUST NOT BE USED in most + regulatory domains UNLESS YOU HAVE A FULL LICENSE for their use from + your local radio regulator, e.g. the FCC or equivalent. Using these + channels without proper authorisation may result in serious legal + consequences. + + You will also have to build a regulatory database with these channels + enabled to actually use them. + + If you are a distro kernel builder or have any doubt whatsoever about + your legal ability to use these channels, say N. + config ATH9K_DYNACK bool "Atheros ath9k ACK timeout estimation algorithm (EXPERIMENTAL)" depends on ATH9K diff --git a/drivers/net/wireless/ath/ath9k/common-init.c b/drivers/net/wireless/ath/ath9k/common-init.c index 8b4f7fdabf58..3d65dce13048 100644 --- a/drivers/net/wireless/ath/ath9k/common-init.c +++ b/drivers/net/wireless/ath/ath9k/common-init.c @@ -86,6 +86,21 @@ static const struct ieee80211_channel ath9k_5ghz_chantable[] = { CHAN5G(5785, 35), /* Channel 157 */ CHAN5G(5805, 36), /* Channel 161 */ CHAN5G(5825, 37), /* Channel 165 */ + +#ifdef CONFIG_ATH9K_LICENSED_CHAN + /* 4.9Ghz channels, public safety channels, license is required in US + * and most other regulatory domains! + */ + /* 802.11j 4.9 GHz (20 MHz) */ + CHAN5G(4920, 38), /* channel 184 */ + CHAN5G(4940, 39), /* channel 188 */ + CHAN5G(4960, 40), /* channel 192 */ + CHAN5G(4980, 41), /* channel 196 */ + /* 802.11j 5.030 - 5.080 GHz (20 MHz) */ + CHAN5G(5040, 42), /* channel 8 */ + CHAN5G(5060, 43), /* channel 12 */ + CHAN5G(5080, 44), /* channel 16 */ +#endif }; /* Atheros hardware rate code addition for short premble */ diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index 9cbca1229bac..2166f644599d 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h @@ -73,7 +73,11 @@ #define ATH9K_RSSI_BAD -128 +#ifdef CONFIG_ATH9K_LICENSED_CHAN +#define ATH9K_NUM_CHANNELS 45 +#else #define ATH9K_NUM_CHANNELS 38 +#endif /* Register read/write primitives */ #define REG_WRITE(_ah, _reg, _val) \