| From 9c1106eb80f31723780a6eb098b5c146a33d45a2 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 37/61] mac80211: mtk: 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. |
| |
| CR-Id: WCNCR00357653 |
| Signed-off-by: fancy.liu <fancy.liu@mediatek.com> |
| Change-Id: I480a956c8a362929040d941247d74ff0e5d06ffb |
| --- |
| 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 89bba19..d7b1f9d 100644 |
| --- a/include/net/mac80211.h |
| +++ b/include/net/mac80211.h |
| @@ -7665,4 +7665,11 @@ int ieee80211_emulate_switch_vif_chanctx(struct ieee80211_hw *hw, |
| int n_vifs, |
| enum ieee80211_chanctx_switch_mode mode); |
| |
| +/** |
| + * 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 dd06bd2..55f1566 100644 |
| --- a/net/mac80211/util.c |
| +++ b/net/mac80211/util.c |
| @@ -4340,3 +4340,12 @@ ieee80211_min_bw_limit_from_chandef(struct cfg80211_chan_def *chandef) |
| return IEEE80211_CONN_BW_LIMIT_20; |
| } |
| } |
| + |
| +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.39.2 |
| |