From patchwork Sat Mar 3 19:40:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jouni Malinen X-Patchwork-Id: 10256153 X-Patchwork-Delegate: johannes@sipsolutions.net 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 C0C01602B5 for ; Sat, 3 Mar 2018 19:40:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA4852879E for ; Sat, 3 Mar 2018 19:40:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D252287A5; Sat, 3 Mar 2018 19:40:41 +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 4A3F72879E for ; Sat, 3 Mar 2018 19:40:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932096AbeCCTkj (ORCPT ); Sat, 3 Mar 2018 14:40:39 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:48438 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752118AbeCCTkj (ORCPT ); Sat, 3 Mar 2018 14:40:39 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id B834F60767; Sat, 3 Mar 2018 19:40:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520106038; bh=OvpddiWNI19vR3P7jsOJeF4wMapzGKs898TAy3lcpH4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=huA2YJX9iWGBV9ynAnn/KCSZXZan7cAi3994Syh6tUVpA0ixw+0wJ05ecKsB40C6t RJRxlbOhgg1sFjyi95dFDZhlzw/M/2wnzrYxW08ZEY0rXMGRDzyr183yg/4/X3GwTZ TQ4oOtUeWiKIM7r4IeSqmniziWsiC3GE/UuJ4TG4= Received: from jouni.codeaurora.org (37-136-100-69.rev.dnainternet.fi [37.136.100.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jouni@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0AE1660452; Sat, 3 Mar 2018 19:40:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520106038; bh=OvpddiWNI19vR3P7jsOJeF4wMapzGKs898TAy3lcpH4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=huA2YJX9iWGBV9ynAnn/KCSZXZan7cAi3994Syh6tUVpA0ixw+0wJ05ecKsB40C6t RJRxlbOhgg1sFjyi95dFDZhlzw/M/2wnzrYxW08ZEY0rXMGRDzyr183yg/4/X3GwTZ TQ4oOtUeWiKIM7r4IeSqmniziWsiC3GE/UuJ4TG4= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0AE1660452 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jouni@codeaurora.org From: Jouni Malinen To: Johannes Berg Cc: linux-wireless@vger.kernel.org, Amar Singhal , Kiran Kumar Lokere , Jouni Malinen Subject: [PATCH 2/2] cfg80211: Modify wiphy registration semantics for self managed hints Date: Sat, 3 Mar 2018 21:40:21 +0200 Message-Id: <1520106021-16836-2-git-send-email-jouni@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520106021-16836-1-git-send-email-jouni@codeaurora.org> References: <1520106021-16836-1-git-send-email-jouni@codeaurora.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 From: Amar Singhal Call regulatory notifier conditionally for self managed hints during wiphy registration. Call when regulatory hint source is NL80211_REGDOM_SET_BY_USER and sub-type is NL80211_USER_REG_HINT_CELL_BASE. Call the notifier with last reg-domain request. This is needed to allow trusted regulatory domain changes to be processed by the driver. Signed-off-by: Amar Singhal Signed-off-by: Kiran Kumar Lokere Signed-off-by: Jouni Malinen --- net/wireless/reg.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 4f25a11b..48eaa8d 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -3518,15 +3518,21 @@ void wiphy_regulatory_register(struct wiphy *wiphy) { struct regulatory_request *lr; - /* self-managed devices ignore external hints */ - if (wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED) + lr = get_last_request(); + + /* self-managed devices ignore beacon hints and 11d IE */ + if (wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED) { wiphy->regulatory_flags |= REGULATORY_DISABLE_BEACON_HINTS | REGULATORY_COUNTRY_IE_IGNORE; + if (lr->initiator == NL80211_REGDOM_SET_BY_USER && + lr->user_reg_hint_type == NL80211_USER_REG_HINT_CELL_BASE) + reg_call_notifier(wiphy, lr); + } + if (!reg_dev_ignore_cell_hint(wiphy)) reg_num_devs_support_basehint++; - lr = get_last_request(); wiphy_update_regulatory(wiphy, lr->initiator); wiphy_all_share_dfs_chan_state(wiphy); }