blob: 6153cdf5620dea2a964184a741c6ccd9fff3a1f8 [file] [log] [blame]
From be32df6be97cc2ffdbaa304d37c2a1f169c756e0 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Thu, 21 Mar 2024 16:52:34 +0800
Subject: [PATCH] wifi: mt76: mt7915: set channel after sta is associated to
adjust switch reason
when sta is associated to AP operating in DFS channel, a channel
setting operation is required to change the channel switch reason
from CH_SWTICH_DFS to CH_SWITCH_NORMAL.
Note that the switch reason for DFS channel during authentication is
CH_SWITCH_DFS since the DFS state is still USABLE at that point
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
mt7915/main.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/mt7915/main.c b/mt7915/main.c
index 69fcf4c..41fa450 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -792,6 +792,31 @@ out:
return ret;
}
+static void
+mt7915_event_callback(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+ const struct ieee80211_event *event)
+{
+ struct mt7915_phy *phy = mt7915_hw_phy(hw);
+ int ret;
+
+ switch (event->type) {
+ case MLME_EVENT:
+ if (event->u.mlme.data == ASSOC_EVENT &&
+ event->u.mlme.status == MLME_SUCCESS) {
+ ieee80211_stop_queues(hw);
+ ret = mt7915_set_channel(phy);
+ if (ret)
+ return;
+ ieee80211_wake_queues(hw);
+ }
+ break;
+ default:
+ break;
+ }
+
+ return;
+}
+
int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
struct ieee80211_sta *sta)
{
@@ -1771,6 +1796,7 @@ const struct ieee80211_ops mt7915_ops = {
.set_sar_specs = mt7915_set_sar_specs,
.channel_switch_beacon = mt7915_channel_switch_beacon,
.post_channel_switch = mt7915_post_channel_switch,
+ .event_callback = mt7915_event_callback,
.get_stats = mt7915_get_stats,
.get_et_sset_count = mt7915_get_et_sset_count,
.get_et_stats = mt7915_get_et_stats,
--
2.18.0