public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH] knownnetworks: limit 5 recent frequencies per network
Date: Wed, 20 Dec 2023 05:15:09 -0800	[thread overview]
Message-ID: <20231220131509.267549-1-prestwoj@gmail.com> (raw)

Since this is meant to be used for quick/roam scans we should be
putting a cap on the frequencies scanned. For large networks with
many BSS's this could end up scanning quite a few frequencies which
isn't very 'quick' as it should be.

Since the known frequency list is now sorted in most recently used
order we can grab the first 5 frequencies per network and be
somewhat confident that this will result in a BSS to connect to.
---
 src/knownnetworks.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

 - Whoops, this did not make it into the original patch set:
   "Reduce and optimize quick/roam scan frequencies"

diff --git a/src/knownnetworks.c b/src/knownnetworks.c
index e44109fd..ecdd79a1 100644
--- a/src/knownnetworks.c
+++ b/src/knownnetworks.c
@@ -540,10 +540,12 @@ struct scan_freq_set *known_networks_get_recent_frequencies(
 				network_entry = network_entry->next,
 						num_networks_tosearch--) {
 		const struct network_info *network = network_entry->data;
+		uint8_t num_freqs = 5;
 
 		for (freq_entry = l_queue_get_entries(
 						network->known_frequencies);
-				freq_entry; freq_entry = freq_entry->next) {
+				freq_entry && num_freqs;
+				freq_entry = freq_entry->next, num_freqs--) {
 			const struct known_frequency *known_freq =
 							freq_entry->data;
 
-- 
2.34.1


                 reply	other threads:[~2023-12-20 13:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231220131509.267549-1-prestwoj@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=iwd@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox