blob: b969ef3b72045fb103602c916d54820e5508a543 [file] [log] [blame]
developera20cdc22024-05-31 18:57:31 +08001From 29807a01daba2d3042a76b2427fbb24e1da71b28 Mon Sep 17 00:00:00 2001
developera46f6132024-03-26 14:09:54 +08002From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
3Date: Thu, 21 Mar 2024 16:52:34 +0800
developera20cdc22024-05-31 18:57:31 +08004Subject: [PATCH 1051/1051] wifi: mt76: mt7915: set channel after sta is
developerdc9eeae2024-04-08 14:36:46 +08005 associated to adjust switch reason
developera46f6132024-03-26 14:09:54 +08006
7when sta is associated to AP operating in DFS channel, a channel
8setting operation is required to change the channel switch reason
9from CH_SWTICH_DFS to CH_SWITCH_NORMAL.
10Note that the switch reason for DFS channel during authentication is
11CH_SWITCH_DFS since the DFS state is still USABLE at that point
12
13Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
14---
15 mt7915/main.c | 26 ++++++++++++++++++++++++++
16 1 file changed, 26 insertions(+)
17
18diff --git a/mt7915/main.c b/mt7915/main.c
developera20cdc22024-05-31 18:57:31 +080019index da998e1..c97974a 100644
developera46f6132024-03-26 14:09:54 +080020--- a/mt7915/main.c
21+++ b/mt7915/main.c
developera20cdc22024-05-31 18:57:31 +080022@@ -794,6 +794,31 @@ out:
developera46f6132024-03-26 14:09:54 +080023 return ret;
24 }
25
26+static void
27+mt7915_event_callback(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
28+ const struct ieee80211_event *event)
29+{
30+ struct mt7915_phy *phy = mt7915_hw_phy(hw);
31+ int ret;
32+
33+ switch (event->type) {
34+ case MLME_EVENT:
35+ if (event->u.mlme.data == ASSOC_EVENT &&
36+ event->u.mlme.status == MLME_SUCCESS) {
37+ ieee80211_stop_queues(hw);
38+ ret = mt7915_set_channel(phy);
39+ if (ret)
40+ return;
41+ ieee80211_wake_queues(hw);
42+ }
43+ break;
44+ default:
45+ break;
46+ }
47+
48+ return;
49+}
50+
51 int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
52 struct ieee80211_sta *sta)
53 {
developera20cdc22024-05-31 18:57:31 +080054@@ -1784,6 +1809,7 @@ const struct ieee80211_ops mt7915_ops = {
developera46f6132024-03-26 14:09:54 +080055 .set_sar_specs = mt7915_set_sar_specs,
56 .channel_switch_beacon = mt7915_channel_switch_beacon,
57 .post_channel_switch = mt7915_post_channel_switch,
58+ .event_callback = mt7915_event_callback,
59 .get_stats = mt7915_get_stats,
60 .get_et_sset_count = mt7915_get_et_sset_count,
61 .get_et_stats = mt7915_get_et_stats,
62--
632.18.0
64