From: <sean.wang@mediatek.com>
To: <nbd@nbd.name>, <lorenzo.bianconi@redhat.com>
Cc: <sean.wang@mediatek.com>, <Soul.Huang@mediatek.com>,
<YN.Chen@mediatek.com>, <robin.chiu@mediatek.com>,
<ch.yeh@mediatek.com>, <posh.sun@mediatek.com>,
<Eric.Liang@mediatek.com>, <ryder.lee@mediatek.com>,
<linux-wireless@vger.kernel.org>,
<linux-mediatek@lists.infradead.org>,
Lorenzo Bianconi <lorenzo@kernel.org>
Subject: [PATCH -next v7 18/22] mt76: mt7921: introduce regdomain notifier support
Date: Sat, 23 Jan 2021 16:35:09 +0800 [thread overview]
Message-ID: <6104d5fa9558ab2687c790690afdde55b35a8235.1611389300.git.objelf@gmail.com> (raw)
In-Reply-To: <cover.1611389300.git.objelf@gmail.com>
From: Lorenzo Bianconi <lorenzo@kernel.org>
Register regdomain notifier to determine the channel domain the hw scan
should rely on.
Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
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
next prev parent reply other threads:[~2021-01-23 8:37 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-23 8:34 [PATCH -next v7 00/22] introduce mt7921e support sean.wang
2021-01-23 8:34 ` [PATCH -next v7 01/22] mt76: mt7921: add MAC support sean.wang
2021-01-23 8:34 ` [PATCH -next v7 02/22] mt76: mt7921: add MCU support sean.wang
2021-01-23 8:34 ` [PATCH -next v7 03/22] mt76: mt7921: add DMA support sean.wang
2021-01-23 8:34 ` [PATCH -next v7 04/22] mt76: mt7921: add EEPROM support sean.wang
2021-01-23 8:34 ` [PATCH -next v7 05/22] mt76: mt7921: add ieee80211_ops sean.wang
2021-01-23 8:34 ` [PATCH -next v7 06/22] mt76: mt7921: introduce mt7921e support sean.wang
2021-01-23 8:34 ` [PATCH -next v7 07/22] mt76: mt7921: add debugfs support sean.wang
2021-01-23 8:34 ` [PATCH -next v7 08/22] mt76: mt7921: add module support sean.wang
2021-01-23 23:48 ` Ryder Lee
2021-01-23 8:35 ` [PATCH -next v7 09/22] mt76: mt7921: introduce schedule scan support sean.wang
2021-01-23 8:35 ` [PATCH -next v7 10/22] mt76: mt7921: introduce 802.11 PS support in sta mode sean.wang
2021-01-23 8:35 ` [PATCH -next v7 11/22] mt76: mt7921: introduce support for hardware beacon filter sean.wang
2021-01-23 8:35 ` [PATCH -next v7 12/22] mt76: mt7921: introduce beacon_loss mcu event sean.wang
2021-01-23 8:35 ` [PATCH -next v7 13/22] mt76: mt7921: introduce PM support sean.wang
2021-01-23 8:35 ` [PATCH -next v7 14/22] mt76: mt7921: rely on mt76_connac_mcu common library sean.wang
2021-01-23 8:35 ` [PATCH -next v7 15/22] mt76: mt7921: rely on mt76_connac_mcu module for sched_scan and hw_scan sean.wang
2021-01-23 8:35 ` [PATCH -next v7 16/22] mt76: mt7921: rely on mt76_connac_mcu module for suspend and WoW support sean.wang
2021-01-23 8:35 ` [PATCH -next v7 17/22] mt76: mt7921: introduce Runtime PM support sean.wang
2021-01-23 8:35 ` sean.wang [this message]
2021-01-23 8:35 ` [PATCH -next v7 19/22] mt76: mt7921: enable MSI interrupts sean.wang
2021-01-23 8:35 ` [PATCH -next v7 20/22] mt76: mt7921: add coredump support sean.wang
2021-01-23 8:35 ` [PATCH -next v7 21/22] mt76: mt7663: introduce " sean.wang
2021-01-23 8:35 ` [PATCH -next v7 22/22] mt76: mt7921: add sta statistics sean.wang
2021-01-23 23:42 ` Ryder Lee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6104d5fa9558ab2687c790690afdde55b35a8235.1611389300.git.objelf@gmail.com \
--to=sean.wang@mediatek.com \
--cc=Eric.Liang@mediatek.com \
--cc=Soul.Huang@mediatek.com \
--cc=YN.Chen@mediatek.com \
--cc=ch.yeh@mediatek.com \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=lorenzo@kernel.org \
--cc=nbd@nbd.name \
--cc=posh.sun@mediatek.com \
--cc=robin.chiu@mediatek.com \
--cc=ryder.lee@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).