developer | 23b6c0f | 2024-02-23 07:09:37 +0800 | [diff] [blame^] | 1 | From 618d7f6ad1b398bc21258559c80928febba3dfac Mon Sep 17 00:00:00 2001 |
developer | 5f4e6c3 | 2023-12-20 06:12:53 +0800 | [diff] [blame] | 2 | From: "fancy.liu" <fancy.liu@mediatek.com> |
| 3 | Date: Wed, 29 Nov 2023 13:51:13 +0800 |
developer | 23b6c0f | 2024-02-23 07:09:37 +0800 | [diff] [blame^] | 4 | Subject: [PATCH 34/37] mtk: mac80211: ACS channel time is reset by ch_restore |
developer | 5f4e6c3 | 2023-12-20 06:12:53 +0800 | [diff] [blame] | 5 | |
| 6 | Issue: |
| 7 | There's a chance that the channel time for duty channel is zero in ACS |
| 8 | scan. |
| 9 | |
| 10 | Root cause: |
| 11 | The chan_stat may be reset when restore to duty channel. |
| 12 | Mac80211 will notify to hostapd when scan done and then restore to duty |
| 13 | channel. |
| 14 | And mt76 will clear scan flag after restore done. |
| 15 | If hostapd get the chan_stat before channel_restore, will get the |
| 16 | correct channel time; |
| 17 | If hostapd get the chan_stat after channel_restore, will get zero |
| 18 | channel time; |
| 19 | |
| 20 | Solution: |
| 21 | When channel switch, will check the mac80211 scan state but not the mt76 scan flag. |
| 22 | Mac80211 scan state will be set in scanning, and will be reset after |
| 23 | scan done and before restore to duty channel. |
| 24 | |
| 25 | Signed-off-by: fancy.liu <fancy.liu@mediatek.com> |
| 26 | --- |
| 27 | include/net/mac80211.h | 7 +++++++ |
| 28 | net/mac80211/util.c | 9 +++++++++ |
| 29 | 2 files changed, 16 insertions(+) |
| 30 | |
| 31 | diff --git a/include/net/mac80211.h b/include/net/mac80211.h |
developer | 23b6c0f | 2024-02-23 07:09:37 +0800 | [diff] [blame^] | 32 | index ba8343f..453466a 100644 |
developer | 5f4e6c3 | 2023-12-20 06:12:53 +0800 | [diff] [blame] | 33 | --- a/include/net/mac80211.h |
| 34 | +++ b/include/net/mac80211.h |
developer | 23b6c0f | 2024-02-23 07:09:37 +0800 | [diff] [blame^] | 35 | @@ -7485,4 +7485,11 @@ int ieee80211_set_active_links(struct ieee80211_vif *vif, u16 active_links); |
developer | 5f4e6c3 | 2023-12-20 06:12:53 +0800 | [diff] [blame] | 36 | void ieee80211_set_active_links_async(struct ieee80211_vif *vif, |
| 37 | u16 active_links); |
| 38 | |
| 39 | +/** |
| 40 | + * ieee80211_get_scanning - get scanning bitmask |
| 41 | + * |
| 42 | + * @hw: pointer as obtained from ieee80211_alloc_hw() |
| 43 | + */ |
| 44 | +unsigned long ieee80211_get_scanning(struct ieee80211_hw *hw); |
| 45 | + |
| 46 | #endif /* MAC80211_H */ |
| 47 | diff --git a/net/mac80211/util.c b/net/mac80211/util.c |
developer | 23b6c0f | 2024-02-23 07:09:37 +0800 | [diff] [blame^] | 48 | index fd82488..f0bb4e8 100644 |
developer | 5f4e6c3 | 2023-12-20 06:12:53 +0800 | [diff] [blame] | 49 | --- a/net/mac80211/util.c |
| 50 | +++ b/net/mac80211/util.c |
developer | 23b6c0f | 2024-02-23 07:09:37 +0800 | [diff] [blame^] | 51 | @@ -5154,3 +5154,12 @@ void ieee80211_fragment_element(struct sk_buff *skb, u8 *len_pos, u8 frag_id) |
developer | 5f4e6c3 | 2023-12-20 06:12:53 +0800 | [diff] [blame] | 52 | |
| 53 | *len_pos = elem_len; |
| 54 | } |
| 55 | + |
| 56 | +unsigned long ieee80211_get_scanning(struct ieee80211_hw *hw) |
| 57 | +{ |
| 58 | + struct ieee80211_local *local = hw_to_local(hw); |
| 59 | + |
| 60 | + return local->scanning; |
| 61 | +} |
| 62 | +EXPORT_SYMBOL(ieee80211_get_scanning); |
| 63 | + |
| 64 | -- |
| 65 | 2.18.0 |
| 66 | |