blob: a5f9932c80fec6461678c95c39100820ef69cfb9 [file] [log] [blame]
developer1f55fcf2024-10-17 14:52:33 +08001From fc4b0be9b3360a333f7bdfb75ab55e6f8edeb2d2 Mon Sep 17 00:00:00 2001
developer05f3b2b2024-08-19 19:17:34 +08002From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
3Date: Wed, 21 Feb 2024 13:41:23 +0800
developer1f55fcf2024-10-17 14:52:33 +08004Subject: [PATCH 131/193] mtk: mt76: mt7996: add post channel switch for DFS
developer05f3b2b2024-08-19 19:17:34 +08005 channel switching
6
7Add post channel switch callback for DFS channel switch support
8After CAC, we need to set channel again for DFS RDD (notify to change
9state from cac to active)
10Add IEEE80211_HW_HANDLE_QUIET_CSA flag to avoid stopping the entire vif TX
11queue when csa_blocked_tx is raised especially for DFS channel switch.
12
13Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
14---
15 mt7996/init.c | 1 +
16 mt7996/main.c | 16 ++++++++++++++++
17 2 files changed, 17 insertions(+)
18
19diff --git a/mt7996/init.c b/mt7996/init.c
developer1f55fcf2024-10-17 14:52:33 +080020index 7d0dea4..311d7cc 100644
developer05f3b2b2024-08-19 19:17:34 +080021--- a/mt7996/init.c
22+++ b/mt7996/init.c
developer1f55fcf2024-10-17 14:52:33 +080023@@ -448,6 +448,7 @@ mt7996_init_wiphy(struct ieee80211_hw *hw, struct mtk_wed_device *wed)
developer05f3b2b2024-08-19 19:17:34 +080024 ieee80211_hw_set(hw, SUPPORTS_MULTI_BSSID);
25 ieee80211_hw_set(hw, CHANCTX_STA_CSA);
26 ieee80211_hw_set(hw, CONNECTION_MONITOR);
27+ ieee80211_hw_set(hw, HANDLES_QUIET_CSA);
28
29 hw->max_tx_fragments = 4;
30
31diff --git a/mt7996/main.c b/mt7996/main.c
developer1f55fcf2024-10-17 14:52:33 +080032index c8dc068..170657f 100644
developer05f3b2b2024-08-19 19:17:34 +080033--- a/mt7996/main.c
34+++ b/mt7996/main.c
developer1f55fcf2024-10-17 14:52:33 +080035@@ -1077,6 +1077,21 @@ fail:
developer05f3b2b2024-08-19 19:17:34 +080036 mutex_unlock(&dev->mt76.mutex);
37 }
38
39+static int
40+mt7996_post_channel_switch(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
41+ struct ieee80211_bss_conf *link_conf)
42+{
43+ struct cfg80211_chan_def *chandef = &link_conf->chanreq.oper;
44+ struct mt7996_phy *phy = mt7996_band_phy(hw, chandef->chan->band);
45+ int ret;
46+
47+ ret = cfg80211_chandef_dfs_required(hw->wiphy, chandef, NL80211_IFTYPE_AP);
48+ if (ret <= 0)
49+ return ret;
50+
51+ return mt7996_set_channel(phy, chandef);
52+}
53+
54 static void mt7996_remove_link_sta(struct mt7996_dev *dev,
55 struct ieee80211_bss_conf *conf,
56 struct mt7996_bss_conf *mconf,
developer1f55fcf2024-10-17 14:52:33 +080057@@ -2794,6 +2809,7 @@ const struct ieee80211_ops mt7996_ops = {
developer05f3b2b2024-08-19 19:17:34 +080058 .release_buffered_frames = mt76_release_buffered_frames,
59 .get_txpower = mt7996_get_txpower,
60 .channel_switch_beacon = mt7996_channel_switch_beacon,
61+ .post_channel_switch = mt7996_post_channel_switch,
62 .get_stats = mt7996_get_stats,
63 .get_et_sset_count = mt7996_get_et_sset_count,
64 .get_et_stats = mt7996_get_et_stats,
65--
developerd0c89452024-10-11 16:53:27 +0800662.45.2
developer05f3b2b2024-08-19 19:17:34 +080067