developer | 2980895 | 2023-11-18 07:50:06 +0800 | [diff] [blame] | 1 | From 063ffcd8a8fdb835e3d74082b4dc411750f2a234 Mon Sep 17 00:00:00 2001 |
| 2 | From: Evelyn Tsai <evelyn.tsai@mediatek.com> |
| 3 | Date: Sat, 18 Nov 2023 07:36:45 +0800 |
| 4 | Subject: [PATCH] wifi: mt76: ACS channel time too long on duty channel |
| 5 | |
| 6 | Step and issue: |
| 7 | 1. Set channel to 36 in hostapd config; |
| 8 | 2. Bootup; |
| 9 | 3. Enable ACS through UCI command and reload; |
| 10 | 4. Check hostapd log, channel 36 channel_time is much longer than other channels. |
| 11 | |
| 12 | Root cause: |
| 13 | The reset chan_stat condition missed duty channel. |
| 14 | |
| 15 | Solution: |
| 16 | When scan start, need to reset chan_stat in each channel switch. |
| 17 | --- |
| 18 | mac80211.c | 2 +- |
| 19 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 20 | |
| 21 | diff --git a/mac80211.c b/mac80211.c |
| 22 | index aaaf6a9..0b13602 100644 |
| 23 | --- a/mac80211.c |
| 24 | +++ b/mac80211.c |
| 25 | @@ -931,7 +931,7 @@ void mt76_set_channel(struct mt76_phy *phy) |
| 26 | if (!offchannel) |
| 27 | phy->main_chan = chandef->chan; |
| 28 | |
| 29 | - if (chandef->chan != phy->main_chan) |
| 30 | + if (chandef->chan != phy->main_chan || test_bit(MT76_SCANNING, &phy->state)) |
| 31 | memset(phy->chan_state, 0, sizeof(*phy->chan_state)); |
| 32 | } |
| 33 | EXPORT_SYMBOL_GPL(mt76_set_channel); |
| 34 | -- |
| 35 | 2.18.0 |
| 36 | |