|
| 1 | +From 81d34af3b2198f7c7e94e3d843035efd7294de20 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Michael-CY Lee < [email protected]> |
| 3 | +Date: Thu, 18 Jan 2024 17:35:05 +0800 |
| 4 | +Subject: [PATCH] mac80211: mtk: add support for scan dwell time customization |
| 5 | + |
| 6 | +Signed-off-by: Michael-CY Lee < [email protected]> |
| 7 | +--- |
| 8 | + net/mac80211/scan.c | 10 ++++++++-- |
| 9 | + 1 file changed, 8 insertions(+), 2 deletions(-) |
| 10 | + |
| 11 | +diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c |
| 12 | +index e692a24..9d53f1a 100644 |
| 13 | +--- a/net/mac80211/scan.c |
| 14 | ++++ b/net/mac80211/scan.c |
| 15 | +@@ -683,7 +683,10 @@ static void ieee80211_scan_state_send_probe(struct ieee80211_local *local, |
| 16 | + * After sending probe requests, wait for probe responses |
| 17 | + * on the channel. |
| 18 | + */ |
| 19 | +- *next_delay = IEEE80211_CHANNEL_TIME; |
| 20 | ++ *next_delay = msecs_to_jiffies(scan_req->duration) > |
| 21 | ++ IEEE80211_PROBE_DELAY + IEEE80211_CHANNEL_TIME ? |
| 22 | ++ msecs_to_jiffies(scan_req->duration) - IEEE80211_PROBE_DELAY : |
| 23 | ++ IEEE80211_CHANNEL_TIME; |
| 24 | + local->next_scan_state = SCAN_DECISION; |
| 25 | + } |
| 26 | + |
| 27 | +@@ -1011,7 +1014,10 @@ set_channel: |
| 28 | + */ |
| 29 | + if ((chan->flags & (IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_RADAR)) || |
| 30 | + !scan_req->n_ssids) { |
| 31 | +- *next_delay = IEEE80211_PASSIVE_CHANNEL_TIME; |
| 32 | ++ *next_delay = msecs_to_jiffies(scan_req->duration) > |
| 33 | ++ IEEE80211_PASSIVE_CHANNEL_TIME ? |
| 34 | ++ msecs_to_jiffies(scan_req->duration) : |
| 35 | ++ IEEE80211_PASSIVE_CHANNEL_TIME; |
| 36 | + local->next_scan_state = SCAN_DECISION; |
| 37 | + if (scan_req->n_ssids) |
| 38 | + set_bit(SCAN_BEACON_WAIT, &local->scanning); |
| 39 | +-- |
| 40 | +2.25.1 |
| 41 | + |
0 commit comments