blob: b6e976ae3cd1101ad9cf2b4661906e4b901f46d2 [file] [log] [blame]
From 618d7f6ad1b398bc21258559c80928febba3dfac Mon Sep 17 00:00:00 2001
From: "fancy.liu" <fancy.liu@mediatek.com>
Date: Wed, 29 Nov 2023 13:51:13 +0800
Subject: [PATCH 34/37] mtk: mac80211: ACS channel time is reset by ch_restore
Issue:
There's a chance that the channel time for duty channel is zero in ACS
scan.
Root cause:
The chan_stat may be reset when restore to duty channel.
Mac80211 will notify to hostapd when scan done and then restore to duty
channel.
And mt76 will clear scan flag after restore done.
If hostapd get the chan_stat before channel_restore, will get the
correct channel time;
If hostapd get the chan_stat after channel_restore, will get zero
channel time;
Solution:
When channel switch, will check the mac80211 scan state but not the mt76 scan flag.
Mac80211 scan state will be set in scanning, and will be reset after
scan done and before restore to duty channel.
Signed-off-by: fancy.liu <fancy.liu@mediatek.com>
---
include/net/mac80211.h | 7 +++++++
net/mac80211/util.c | 9 +++++++++
2 files changed, 16 insertions(+)
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index ba8343f..453466a 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -7485,4 +7485,11 @@ int ieee80211_set_active_links(struct ieee80211_vif *vif, u16 active_links);
void ieee80211_set_active_links_async(struct ieee80211_vif *vif,
u16 active_links);
+/**
+ * ieee80211_get_scanning - get scanning bitmask
+ *
+ * @hw: pointer as obtained from ieee80211_alloc_hw()
+ */
+unsigned long ieee80211_get_scanning(struct ieee80211_hw *hw);
+
#endif /* MAC80211_H */
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index fd82488..f0bb4e8 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -5154,3 +5154,12 @@ void ieee80211_fragment_element(struct sk_buff *skb, u8 *len_pos, u8 frag_id)
*len_pos = elem_len;
}
+
+unsigned long ieee80211_get_scanning(struct ieee80211_hw *hw)
+{
+ struct ieee80211_local *local = hw_to_local(hw);
+
+ return local->scanning;
+}
+EXPORT_SYMBOL(ieee80211_get_scanning);
+
--
2.18.0