blob: eabad848e2223d98252e090ba98bad5651faefdf [file] [log] [blame]
From 1d18008ab9d67f318932ed993103bd46d9f0215d 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 1051/1052] 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 04301300..eab45737 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -794,6 +794,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)
{
@@ -1835,6 +1860,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