From 3a3a315bc63d3211e9126286a5a1dba098d7bb9b Mon Sep 17 00:00:00 2001 From: Marek Kwaczynski Date: Tue, 15 Oct 2024 13:44:33 +0200 Subject: [PATCH] mac80211: scan: Decrease passive scan channel time in sw_scan Allow configuring small values of duration time for passive scanning in software scan. Fixes: WIFI-14822 Signed-off-by: Marek Kwaczynski --- ...0211-decrease-passive-scan-chan-time.patch | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 feeds/mediatek-sdk/mac80211/patches/subsys/mtk-9905-mac80211-decrease-passive-scan-chan-time.patch diff --git a/feeds/mediatek-sdk/mac80211/patches/subsys/mtk-9905-mac80211-decrease-passive-scan-chan-time.patch b/feeds/mediatek-sdk/mac80211/patches/subsys/mtk-9905-mac80211-decrease-passive-scan-chan-time.patch new file mode 100644 index 000000000..5e3026cd9 --- /dev/null +++ b/feeds/mediatek-sdk/mac80211/patches/subsys/mtk-9905-mac80211-decrease-passive-scan-chan-time.patch @@ -0,0 +1,34 @@ +Index: backports-5.15.81-1/net/mac80211/scan.c +=================================================================== +--- backports-5.15.81-1.orig/net/mac80211/scan.c ++++ backports-5.15.81-1/net/mac80211/scan.c +@@ -29,6 +29,9 @@ + #define IEEE80211_CHANNEL_TIME (HZ / 33) + #define IEEE80211_PASSIVE_CHANNEL_TIME (HZ / 9) + ++/* Additional time used for passive SW scaning */ ++#define IEEE80211_PASSIVE_MIN_CHANNEL_TIME (HZ / 13) ++ + void ieee80211_rx_bss_put(struct ieee80211_local *local, + struct ieee80211_bss *bss) + { +@@ -1014,10 +1017,15 @@ set_channel: + */ + if ((chan->flags & (IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_RADAR)) || + !scan_req->n_ssids) { +- *next_delay = msecs_to_jiffies(scan_req->duration) > +- IEEE80211_PASSIVE_CHANNEL_TIME ? +- msecs_to_jiffies(scan_req->duration) : +- IEEE80211_PASSIVE_CHANNEL_TIME; ++ if (msecs_to_jiffies(scan_req->duration) > IEEE80211_PASSIVE_CHANNEL_TIME) { ++ *next_delay = msecs_to_jiffies(scan_req->duration); ++ } else if (scan_req->duration > 0) { ++ *next_delay = scan_req->duration > IEEE80211_PASSIVE_MIN_CHANNEL_TIME ? ++ msecs_to_jiffies(scan_req->duration - IEEE80211_PASSIVE_MIN_CHANNEL_TIME) : ++ 0; ++ } else { ++ *next_delay = IEEE80211_PASSIVE_CHANNEL_TIME; ++ } + local->next_scan_state = SCAN_DECISION; + if (scan_req->n_ssids) + set_bit(SCAN_BEACON_WAIT, &local->scanning);