From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH 3/7] network: call network_connected with BSS
Date: Wed, 20 Dec 2023 05:11:56 -0800 [thread overview]
Message-ID: <20231220131200.267489-4-prestwoj@gmail.com> (raw)
In-Reply-To: <20231220131200.267489-1-prestwoj@gmail.com>
This will allow the BSS frequency to be inserted at the head of the
known frequency list, allowing future scans to prefer that frequency.
---
src/network.c | 4 +++-
src/network.h | 2 +-
src/station.c | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/network.c b/src/network.c
index 3e8770bc..f4496c25 100644
--- a/src/network.c
+++ b/src/network.c
@@ -167,7 +167,7 @@ static bool network_secret_check_cacheable(void *data, void *user_data)
return false;
}
-void network_connected(struct network *network)
+void network_connected(struct network *network, struct scan_bss *bss)
{
enum security security = network_get_security(network);
const char *ssid = network_get_ssid(network);
@@ -190,6 +190,8 @@ void network_connected(struct network *network)
if (err < 0)
l_error("Error %i touching network config", err);
+ known_network_add_connected_frequency(network->info,
+ bss->frequency);
/* Syncs frequencies of already known network*/
known_network_frequency_sync(network->info);
}
diff --git a/src/network.h b/src/network.h
index f29649f7..e7638899 100644
--- a/src/network.h
+++ b/src/network.h
@@ -31,7 +31,7 @@ struct scan_bss;
struct handshake_state;
struct erp_cache_entry;
-void network_connected(struct network *network);
+void network_connected(struct network *network, struct scan_bss *bss);
void network_disconnected(struct network *network);
bool network_rankmod(const struct network *network, double *rankmod);
diff --git a/src/station.c b/src/station.c
index 73de26bb..4facc0bc 100644
--- a/src/station.c
+++ b/src/station.c
@@ -3213,7 +3213,7 @@ static void station_connect_ok(struct station *station)
l_warn("Could not request neighbor report");
}
- network_connected(station->connected_network);
+ network_connected(station->connected_network, station->connected_bss);
if (station->netconfig) {
if (hs->fils_ip_req_ie && hs->fils_ip_resp_ie) {
--
2.34.1
next prev parent reply other threads:[~2023-12-20 13:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-20 13:11 [PATCH 0/7] Reduce and optimize quick/roam scan frequencies James Prestwood
2023-12-20 13:11 ` [PATCH 1/7] known_network: rename known_network_add_frequency James Prestwood
2023-12-22 22:09 ` Denis Kenzior
2023-12-20 13:11 ` [PATCH 2/7] knownnetworks: add known_network_add_connected_frequency James Prestwood
2023-12-22 22:13 ` Denis Kenzior
2024-01-02 13:18 ` James Prestwood
2023-12-20 13:11 ` James Prestwood [this message]
2023-12-20 13:11 ` [PATCH 4/7] network: add network_roamed James Prestwood
2023-12-20 13:11 ` [PATCH 5/7] station: use network_roamed James Prestwood
2023-12-20 13:11 ` [PATCH 6/7] auto-t: update known frequency test to check order James Prestwood
2023-12-20 13:12 ` [PATCH 7/7] knownnetworks: limit 5 recent frequencies per network James Prestwood
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=20231220131200.267489-4-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