From patchwork Fri Jun 3 07:01:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Chaitanya X-Patchwork-Id: 9151937 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 8504A60221 for ; Fri, 3 Jun 2016 07:01:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 740BA27BFA for ; Fri, 3 Jun 2016 07:01:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66872282EE; Fri, 3 Jun 2016 07:01:28 +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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 0F9D527BFA for ; Fri, 3 Jun 2016 07:01:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751800AbcFCHB0 (ORCPT ); Fri, 3 Jun 2016 03:01:26 -0400 Received: from mail-yw0-f194.google.com ([209.85.161.194]:34914 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751159AbcFCHBZ (ORCPT ); Fri, 3 Jun 2016 03:01:25 -0400 Received: by mail-yw0-f194.google.com with SMTP id n16so9837323ywd.2 for ; Fri, 03 Jun 2016 00:01:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=UJxNBDnTt6jbQV2hxeieHHh1PEniHYU7JY5nSCOgOMQ=; b=Ko7SY8D9fmAmVTfnHKHa8zF49JoDXaySkxUDJ0WPNglzsph68FBftSO0y6KKNFBTU4 28L7Zgy937kIH2/7N/arK6o/S0tNV/N1rs1FhCQikzSKLZFwFINXL4krFHod9vOAxbXQ XZOJ0kzH31PIWgN7eLRH9A3VDnQf/I0uQZWd+UjzmMXU+rT+OippK/w14t0oOrUDCymu fxkIC158AJzyNt1dWa8VScc3pLSLO6PlfZ9Kv5fX8qETpe2E0dtfLfacTRRH9yCb4oPG xcuKWOVfsWwc8UDVUIQBxABYED5JruCRSnm23yX3n8YMrC5Culfzu/aemqEbNkZCYpI6 ZIdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=UJxNBDnTt6jbQV2hxeieHHh1PEniHYU7JY5nSCOgOMQ=; b=YfXsHLIJMTs7FJqki4kt3Z+nXN9D5hZMR0gYinaWpFRL7PNQKZIjXt7hW02ZMGCZvR izjJa2WLWQn5ZT+j62YGQdOL37QraLiPtN6lbhQfUCPg7WujnNLwb1DtZql5CwtCe7GG OTToal2RLJ+EnUr3OoQ9RQew1rKdReNcomKx2Pna3mii1nreJN+hzQ1Hz44q8R13h8mu AivbSPGQNbok35BPs8wD3yOpGA2zmdLD42kbwSJQtfR0gbZJVg2KmFKazcEwRFay8OBR 3zLQDA/qrYEFD+MVCfmw8GlZMRhQ8Jb0iZTTp491OLvGIjfJUGbvV4IDzqH72jPAe/Bz 89EQ== X-Gm-Message-State: ALyK8tJUBVOYbIb2gEYRLw8ZS7C2Pm/FZTIUm6n5vxF+7L0Sff6LrC1vR0b6VhxDPexoTT2qKMZBjwNSKBjfrw== X-Received: by 10.129.77.68 with SMTP id a65mr1330409ywb.89.1464937284489; Fri, 03 Jun 2016 00:01:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.122.5 with HTTP; Fri, 3 Jun 2016 00:01:05 -0700 (PDT) In-Reply-To: References: From: Krishna Chaitanya Date: Fri, 3 Jun 2016 12:31:05 +0530 Message-ID: Subject: Re: iw reg overwritten after connecting to AP To: Belisko Marek Cc: "linux-wireless@vger.kernel.org" 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 Fri, Jun 3, 2016 at 2:02 AM, Belisko Marek wrote: > > Hi Krishna, > > On Thu, Jun 2, 2016 at 10:21 PM, Krishna Chaitanya > wrote: > > On Thu, Jun 2, 2016 at 7:34 PM, Belisko Marek wrote: > >> > >> Hello, > >> > >> I'm using kernel 4.1 with option CONFIG_CFG80211_INTERNAL_REGDB > >> enabled. I have set one country in db.txt which during startup I set > >> via 'iw reg set XX'. When connected to some AP which sends country > >> code (e.g. SK) region is overwritten to 00 (in kernel log there is > >> some timeout message - I suppose it's communication with crda daemon > >> which I'm not using). Is there a way how to override this behavior (to > >> keep my regulatory persistent). Many thanks. > >> > > You need to disable country_ie hints, you driver has to advertise > > REGULATORY_WIPHY_SELF_MANAGED in the wiphy.regualtory_flags > > to disable beacon and country_ie hints. > I would like to keep beacon hinting (maybe disable only country_ie). I > have same setup but with 3.9 kernel and regulatory isn't overwritten. > > > > Which driver are you using? > I'm using mwifiex driver I am not familiar with this driver. But looks like for any other country except for WORLD mode it is disabling both beacon and country_ie hints. But for any other country these hints are enabled. may be you can try the below patch (not based on 4.1 so you might have to port) for your case disabling country_ie for all regulatory domains. wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; --- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c index 6db202f..cb95138 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -4072,8 +4072,9 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter) wiphy->n_cipher_suites = ARRAY_SIZE(mwifiex_cipher_suites); if (adapter->region_code) - wiphy->regulatory_flags |= REGULATORY_DISABLE_BEACON_HINTS | - REGULATORY_COUNTRY_IE_IGNORE; + wiphy->regulatory_flags |= REGULATORY_DISABLE_BEACON_HINTS; + + wiphy->regulatory_flags |= REGULATORY_COUNTRY_IE_IGNORE; ether_addr_copy(wiphy->perm_addr, adapter->perm_addr);