From patchwork Mon Jan 4 08:37:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keng-Yu Lin X-Patchwork-Id: 562274 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 42DDC1402DE; Mon, 4 Jan 2016 19:38:06 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1aG0eO-00031u-On; Mon, 04 Jan 2016 08:38:00 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1aG0eI-0002ys-VO for kernel-team@lists.ubuntu.com; Mon, 04 Jan 2016 08:37:55 +0000 Received: from 61-231-142-110.dynamic.hinet.net ([61.231.142.110] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1aG0eI-0004Pd-5u; Mon, 04 Jan 2016 08:37:54 +0000 From: Keng-Yu Lin To: kernel-team@lists.ubuntu.com Subject: [PATCH 4/8] [Vivid][SRU re-spin][SAUCE] mwifiex: don't follow AP if country code received from EEPROM Date: Mon, 4 Jan 2016 16:37:30 +0800 Message-Id: <1451896654-24765-5-git-send-email-kengyu@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1451896654-24765-1-git-send-email-kengyu@canonical.com> References: <1451896654-24765-1-git-send-email-kengyu@canonical.com> Cc: alex.kaluzhny@canonical.com, gavin.lin@canonical.com, tim.chen119@canonical.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com From: Amitkumar Karwar If device has already received country information from EEPROM, we won't parse AP's country IE and download it to firmware. We will also set regulatory flags to disable beacon hints and ignore country IE. BugLink: https://launchpad.net/bugs/1528910 Signed-off-by: Amitkumar Karwar Signed-off-by: Cathy Luo Signed-off-by: Keng-Yu Lin Tested-by: Gavin Lin Reviewed-by: Wen-chien Jesse Sung --- drivers/net/wireless/mwifiex/cfg80211.c | 4 ++++ drivers/net/wireless/mwifiex/sta_ioctl.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index a63464f..f1eb01c 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c @@ -2964,6 +2964,10 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter) wiphy->cipher_suites = mwifiex_cipher_suites; wiphy->n_cipher_suites = ARRAY_SIZE(mwifiex_cipher_suites); + if (adapter->region_code) + wiphy->regulatory_flags |= REGULATORY_DISABLE_BEACON_HINTS | + REGULATORY_COUNTRY_IE_IGNORE; + memcpy(wiphy->perm_addr, priv->curr_addr, ETH_ALEN); wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME | diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c index 01041af..032fac4 100644 --- a/drivers/net/wireless/mwifiex/sta_ioctl.c +++ b/drivers/net/wireless/mwifiex/sta_ioctl.c @@ -268,7 +268,8 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, priv->scan_block = false; if (bss) { - mwifiex_process_country_ie(priv, bss); + if (adapter->region_code == 0x00) + mwifiex_process_country_ie(priv, bss); /* Allocate and fill new bss descriptor */ bss_desc = kzalloc(sizeof(struct mwifiex_bssdescriptor),