blob: d62352fbde3b0a33c446891ab6a9c0668ef482ac [file] [log] [blame]
From 469ce653f972aa5b6cf213418cfdcecffe0af924 Mon Sep 17 00:00:00 2001
From: Michael-CY Lee <michael-cy.lee@mediatek.com>
Date: Thu, 22 Feb 2024 11:09:10 +0800
Subject: [PATCH 108/116] mtk: mt76: mt7996: hw_scan: ACS channel time too long
on duty channel
This problem happens in SW scan and was already fixed.
(https://gerrit.mediatek.inc/c/gateway/WiFi7/mac80211/mt76/+/8312969)
This commit applys same solution for HW scan.
CR-Id: WCNCR00289305
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
---
mt7996/main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mt7996/main.c b/mt7996/main.c
index 05efec469..6943b28ba 100644
--- a/mt7996/main.c
+++ b/mt7996/main.c
@@ -497,6 +497,7 @@ static void ___mt7996_set_channel(struct mt7996_phy *phy,
struct mt76_phy *mphy = phy->mt76;
bool offchannel = phy->scan_chan != NULL;
int timeout = HZ / 5;
+ unsigned long was_scanning = ieee80211_get_scanning(mphy->hw);
wait_event_timeout(mdev->tx_wait, !mt76_has_tx_pending(mphy), timeout);
mt76_update_survey(mphy);
@@ -511,7 +512,7 @@ static void ___mt7996_set_channel(struct mt7996_phy *phy,
if (!offchannel)
mphy->main_chan = chandef->chan;
- if (chandef->chan != mphy->main_chan)
+ if (chandef->chan != mphy->main_chan || was_scanning)
memset(mphy->chan_state, 0, sizeof(*mphy->chan_state));
}
--
2.39.2