blob: 8dbeb72fbdd67ed932b60d31f0a1554c212d0b40 [file] [log] [blame]
developera20cdc22024-05-31 18:57:31 +08001From 96ee52ffd24c36443d93df103b2a856832a41443 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
developerdc9eeae2024-04-08 14:36:46 +080013index 61a1dbb..71e0d55 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 {
developera46f6132024-03-26 14:09:54 +080044@@ -1701,6 +1722,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