blob: c40f2aec888680ca3f6f14d35fde7c556e8193f7 [file] [log] [blame]
developer05f3b2b2024-08-19 19:17:34 +08001From d5a9af18ab8f2c8c6a46c10ef99f2a50e08ae9c3 Mon Sep 17 00:00:00 2001
developer1a173672023-12-21 14:49:33 +08002From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
3Date: Thu, 16 Nov 2023 14:41:54 +0800
developera20cdc22024-05-31 18:57:31 +08004Subject: [PATCH 07/21] wifi: mt76: mt7915: add post channel switch for DFS
developer753619c2024-02-22 13:42:45 +08005 channel switching
developer1a173672023-12-21 14:49:33 +08006
7Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
8---
9 mt7915/main.c | 22 ++++++++++++++++++++++
10 1 file changed, 22 insertions(+)
11
12diff --git a/mt7915/main.c b/mt7915/main.c
developer05f3b2b2024-08-19 19:17:34 +080013index ec2360c3..0d24e74c 100644
developer1a173672023-12-21 14:49:33 +080014--- a/mt7915/main.c
15+++ b/mt7915/main.c
16@@ -736,6 +736,27 @@ mt7915_channel_switch_beacon(struct ieee80211_hw *hw,
17 mutex_unlock(&dev->mt76.mutex);
18 }
19
20+static int
21+mt7915_post_channel_switch(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
22+{
23+ struct mt7915_phy *phy = mt7915_hw_phy(hw);
24+ struct cfg80211_chan_def *chandef = &phy->mt76->chandef;
25+ int ret;
26+
27+ ret = cfg80211_chandef_dfs_required(hw->wiphy, chandef, NL80211_IFTYPE_AP);
28+ if (ret <= 0)
29+ goto out;
30+
31+ ieee80211_stop_queues(hw);
32+ ret = mt7915_set_channel(phy);
33+ if (ret)
34+ goto out;
35+ ieee80211_wake_queues(hw);
36+
37+out:
38+ return ret;
39+}
40+
41 int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
42 struct ieee80211_sta *sta)
43 {
developer05f3b2b2024-08-19 19:17:34 +080044@@ -1705,6 +1726,7 @@ const struct ieee80211_ops mt7915_ops = {
developer1a173672023-12-21 14:49:33 +080045 .get_txpower = mt76_get_txpower,
46 .set_sar_specs = mt7915_set_sar_specs,
47 .channel_switch_beacon = mt7915_channel_switch_beacon,
48+ .post_channel_switch = mt7915_post_channel_switch,
49 .get_stats = mt7915_get_stats,
50 .get_et_sset_count = mt7915_get_et_sset_count,
51 .get_et_stats = mt7915_get_et_stats,
52--
532.18.0
54