From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74A02C433E6 for ; Sat, 23 Jan 2021 08:46:03 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0CC6123A5B for ; Sat, 23 Jan 2021 08:46:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0CC6123A5B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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=d8LsbZ+trA1CYd2iWCRG/upBr0yrajsD0pGfYL2qSv0=; b=Ir1bg5PfVa0uB97HUCrMKz2Gm ncyrW/028+BWBur+R7pQ5ia0PtPJH6AJP7wHv6jlntChrIM4hfU28Al6pykmqmAqQeM76ZPracw6W NbIQi69tFHV2oEuVTDU+UFHx6R09DPqLKTqEQNkkYdjZX1fPQpaAPShL1HXpbz9O9ehbpFgmaRbL3 L7TKnxVWwe9jZ2J2IN2//RbC7wEXMkKLbaL0FA5cXF6yYXNxZVIx7RMgVXWTYxh/gO37g47JfAr4d 3rvNmW4AKjZ5zqhWjA+M9fA8Isxln49q0rmkXRUJz1NRFqGcoKmThird/WkO5OWpvXSbAl5djYATF STzQtpkVw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l3EYH-0005l0-1b; Sat, 23 Jan 2021 08:45:49 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l3EY6-0005Xt-Eu for linux-mediatek@lists.infradead.org; Sat, 23 Jan 2021 08:45:41 +0000 X-UUID: 55c79cfead154e4983ea698c0427a833-20210123 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=Dc7/fux/V2iBhc0xPrOwNGs90Pq/vpwcxqN34ZmVoSQ=; b=YSdrMm27rNnjlCER/b/O132l2HK/UIsjggIkUuDLlecY0nlPw2Zgi1tcK0UDoDLCPM+ofRDEQkuKFnEmfksdHx9iKlowirX9yoXdy4+KyPrdBFmzujAQH9wiPj6Tfs12gnzbslz9O9uHVVfOHRICbnW7oaBUc5cn5PACLmfbm9A=; X-UUID: 55c79cfead154e4983ea698c0427a833-20210123 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1623218133; Sat, 23 Jan 2021 00:45:30 -0800 Received: from MTKMBS02N1.mediatek.inc (172.21.101.77) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 23 Jan 2021 00:35:29 -0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 23 Jan 2021 16:35:17 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 23 Jan 2021 16:35:17 +0800 From: To: , Subject: [PATCH -next v7 18/22] mt76: mt7921: introduce regdomain notifier support Date: Sat, 23 Jan 2021 16:35:09 +0800 Message-ID: <6104d5fa9558ab2687c790690afdde55b35a8235.1611389300.git.objelf@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210123_034538_667787_72B6FEB1 X-CRM114-Status: UNSURE ( 9.17 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ryder.lee@mediatek.com, robin.chiu@mediatek.com, ch.yeh@mediatek.com, Eric.Liang@mediatek.com, sean.wang@mediatek.com, linux-wireless@vger.kernel.org, posh.sun@mediatek.com, YN.Chen@mediatek.com, linux-mediatek@lists.infradead.org, Soul.Huang@mediatek.com, Lorenzo Bianconi Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Lorenzo Bianconi Register regdomain notifier to determine the channel domain the hw scan should rely on. Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt7921/init.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/init.c b/drivers/net/wireless/mediatek/mt76/mt7921/init.c index efc3e94f89d5..2a80b68a588a 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c @@ -52,6 +52,21 @@ static const struct ieee80211_iface_combination if_comb[] = { } }; +static void +mt7921_regd_notifier(struct wiphy *wiphy, + struct regulatory_request *request) +{ + struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); + struct mt7921_dev *dev = mt7921_hw_dev(hw); + + memcpy(dev->mt76.alpha2, request->alpha2, sizeof(dev->mt76.alpha2)); + dev->mt76.region = request->dfs_region; + + mt7921_mutex_acquire(dev); + mt76_connac_mcu_set_channel_domain(hw->priv); + mt7921_mutex_release(dev); +} + static void mt7921_init_wiphy(struct ieee80211_hw *hw) { @@ -78,6 +93,7 @@ mt7921_init_wiphy(struct ieee80211_hw *hw) wiphy->max_match_sets = MT76_CONNAC_MAX_SCAN_MATCH; wiphy->max_sched_scan_reqs = 1; wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH; + wiphy->reg_notifier = mt7921_regd_notifier; wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_SET_SCAN_DWELL); -- 2.25.1 _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek