From patchwork Mon May 15 11:45:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maya Erez X-Patchwork-Id: 9726755 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 AD4E260380 for ; Mon, 15 May 2017 11:46:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C35A28972 for ; Mon, 15 May 2017 11:46:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 910FB28989; Mon, 15 May 2017 11:46:20 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24D3128972 for ; Mon, 15 May 2017 11:46:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757072AbdEOLqS (ORCPT ); Mon, 15 May 2017 07:46:18 -0400 Received: from wolverine01.qualcomm.com ([199.106.114.254]:45044 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756816AbdEOLqN (ORCPT ); Mon, 15 May 2017 07:46:13 -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=1494848773; x=1526384773; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=r/I/ALHjrWj/L7PVG2rxGl3nAzLuCiAYyKvSjp9UFZ8=; b=M7ZGsch06BlF0jtoMDJCagtY2DJln8jV+lMB7vRvufoeC9m8L+AWWTGP jELOJvqPZEKC8ueyJlVNnLjIcRHigJtbb1p6DRs4/gUWekXRx7k3WtXbK MqO5CAyMcNusJ2zfa6MgZ6uH/UnAIJJJKCZ8RlmzHfgWqZMg7VmV+/f9V Q=; X-IronPort-AV: E=Sophos;i="5.38,344,1491289200"; d="scan'208";a="286072173" Received: from unknown (HELO Ironmsg04-L.qualcomm.com) ([10.53.140.111]) by wolverine01.qualcomm.com with ESMTP; 15 May 2017 04:46:13 -0700 X-IronPort-AV: E=McAfee;i="5800,7501,8529"; a="1348764090" X-MGA-submission: =?us-ascii?q?MDF6kZHf73O8vEpB4lUQ6PzeliW3bi2MJUcy+c?= =?us-ascii?q?swbMt/eoU0/qgJMIPeJWG4zT4HGl1FHLgAleVfQ6W5Umx7RoQHeltsKr?= =?us-ascii?q?uuMonxkmbKt3N6VTwCEfu3iWzzlr3XYlJIb8bqczq4wLe7Q8l9/fDtt9?= =?us-ascii?q?90?= Received: from lx-merez1.mea.qualcomm.com ([10.18.173.103]) by Ironmsg04-L.qualcomm.com with ESMTP; 15 May 2017 04:46:09 -0700 From: Maya Erez To: Kalle Valo Cc: Maya Erez , linux-wireless@vger.kernel.org, wil6210@qca.qualcomm.com, Lior David Subject: [PATCH v2 4/5] wil6210: add option to ignore OTA regulatory hints Date: Mon, 15 May 2017 14:45:58 +0300 Message-Id: <1494848759-3651-5-git-send-email-qca_merez@qca.qualcomm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1494848759-3651-1-git-send-email-qca_merez@qca.qualcomm.com> References: <1494848759-3651-1-git-send-email-qca_merez@qca.qualcomm.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On some platforms, the regulatory domain (country) is set using mechanisms external to WIFI, such as cellular modem and GPS. In these scenarios the regulatory hints that are received over the air (in beacons and similar) can conflict and even cause an incorrect country to be set. Add an option to ignore the OTA regulatory hints to better support such scenarios. Signed-off-by: Lior David Signed-off-by: Maya Erez --- drivers/net/wireless/ath/wil6210/cfg80211.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c index 567fe43..0f297c0 100644 --- a/drivers/net/wireless/ath/wil6210/cfg80211.c +++ b/drivers/net/wireless/ath/wil6210/cfg80211.c @@ -26,6 +26,11 @@ module_param(disable_ap_sme, bool, 0444); MODULE_PARM_DESC(disable_ap_sme, " let user space handle AP mode SME"); +static bool ignore_reg_hints; +module_param(ignore_reg_hints, bool, 0444); +MODULE_PARM_DESC(ignore_reg_hints, + " Ignore OTA regulatory hints (Default: false)"); + #define CHAN60G(_channel, _flags) { \ .band = NL80211_BAND_60GHZ, \ .center_freq = 56160 + (2160 * (_channel)), \ @@ -1763,6 +1768,11 @@ static void wil_wiphy_init(struct wiphy *wiphy) wiphy->n_vendor_commands = ARRAY_SIZE(wil_nl80211_vendor_commands); wiphy->vendor_commands = wil_nl80211_vendor_commands; + + if (ignore_reg_hints) { + wiphy->regulatory_flags |= REGULATORY_DISABLE_BEACON_HINTS; + wiphy->regulatory_flags |= REGULATORY_COUNTRY_IE_IGNORE; + } } struct wireless_dev *wil_cfg80211_init(struct device *dev)