From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH v2 3/6] network: remove BasicServiceSet DBus registration code
Date: Mon, 19 Aug 2024 08:57:31 -0700 [thread overview]
Message-ID: <20240819155734.1276476-3-prestwoj@gmail.com> (raw)
In-Reply-To: <20240819155734.1276476-1-prestwoj@gmail.com>
This was moved into station.
---
src/network.c | 100 ++------------------------------------------------
src/network.h | 2 -
2 files changed, 4 insertions(+), 98 deletions(-)
diff --git a/src/network.c b/src/network.c
index a8e61d48..b9194b3c 100644
--- a/src/network.c
+++ b/src/network.c
@@ -75,7 +75,6 @@ struct network {
struct l_ecc_point *sae_pt_20; /* SAE PT for Group 20 */
unsigned int agent_request;
struct l_queue *bss_list;
- struct l_queue *old_bss_list;
struct l_settings *settings;
struct l_queue *secrets;
struct l_queue *blacklist; /* temporary blacklist for BSS's */
@@ -1147,101 +1146,20 @@ const char *network_bss_get_path(const struct network *network,
return __network_path_append_bss(network->object_path, bss);
}
-static bool network_unregister_bss(void *a, void *user_data)
-{
- struct scan_bss *bss = a;
- struct network *network = user_data;
-
- l_dbus_unregister_object(dbus_get_bus(),
- network_bss_get_path(network, bss));
-
- l_dbus_property_changed(dbus_get_bus(), network->object_path,
- IWD_NETWORK_INTERFACE, "ExtendedServiceSet");
-
- return true;
-}
-
-static bool network_register_bss(struct network *network, struct scan_bss *bss)
-{
- const char *path = network_bss_get_path(network, bss);
- struct scan_bss *old;
-
- /*
- * If we find this path in the object tree update the data to the new
- * scan_bss pointer, as this one will be freed soon.
- */
- old = l_dbus_object_get_data(dbus_get_bus(), path, IWD_BSS_INTERFACE);
- if (old)
- return l_dbus_object_set_data(dbus_get_bus(), path,
- IWD_BSS_INTERFACE, bss);
-
- if (!l_dbus_object_add_interface(dbus_get_bus(), path,
- IWD_BSS_INTERFACE, bss))
- return false;
-
- if (!l_dbus_object_add_interface(dbus_get_bus(), path,
- L_DBUS_INTERFACE_PROPERTIES, bss))
- return false;
-
- l_dbus_property_changed(dbus_get_bus(), network->object_path,
- IWD_NETWORK_INTERFACE, "ExtendedServiceSet");
-
- return true;
-}
-
void network_bss_start_update(struct network *network)
{
- network->old_bss_list = network->bss_list;
+ l_queue_destroy(network->bss_list, NULL);
network->bss_list = l_queue_new();
}
-void network_bss_stop_update(struct network *network,
- const struct scan_freq_set *limit_freqs)
-{
- const struct l_queue_entry *e;
-
- /*
- * Update has finished, clean up any BSS's from the old list that have
- * been registered on DBus.
- */
- for (e = l_queue_get_entries(network->old_bss_list); e; e = e->next) {
- const struct scan_bss *old = e->data;
- const struct scan_bss *bss;
- const char *path = network_bss_get_path(network, old);
-
- bss = l_dbus_object_get_data(dbus_get_bus(), path,
- IWD_BSS_INTERFACE);
-
- /*
- * Don't remove BSS's who's frequencies were not in the set.
- * This happens due to scan subsets (i.e. from station) so some
- * BSS's won't be seen since the frequency is not being scanned.
- * These BSS's will get cleared out eventually if they have
- * actually disappeared.
- */
- if (!scan_freq_set_contains(limit_freqs, bss->frequency))
- continue;
-
- /*
- * The lookup matched the user data of an old BSS. This should
- * be unregistered from DBus
- */
- if (bss && bss == old)
- l_dbus_object_remove_interface(dbus_get_bus(), path,
- IWD_BSS_INTERFACE);
- }
-
- l_queue_destroy(network->old_bss_list, NULL);
- network->old_bss_list = NULL;
-}
-
bool network_bss_add(struct network *network, struct scan_bss *bss)
{
if (!l_queue_insert(network->bss_list, bss, scan_bss_rank_compare,
NULL))
return false;
- network_register_bss(network, bss);
+ l_dbus_property_changed(dbus_get_bus(), network->object_path,
+ IWD_NETWORK_INTERFACE, "ExtendedServiceSet");
/* Done if BSS is not HS20 or we already have network_info set */
if (!bss->hs20_capable)
@@ -1276,8 +1194,6 @@ bool network_bss_update(struct network *network, struct scan_bss *bss)
l_queue_insert(network->bss_list, bss, scan_bss_rank_compare, NULL);
- network_register_bss(network, bss);
-
/* Sync frequency for already known networks */
if (network->info) {
known_network_add_frequency(network->info, bss->frequency);
@@ -1294,12 +1210,7 @@ bool network_bss_list_isempty(struct network *network)
struct scan_bss *network_bss_list_pop(struct network *network)
{
- struct scan_bss *bss = l_queue_pop_head(network->bss_list);
-
- if (bss)
- network_unregister_bss(bss, network);
-
- return bss;
+ return l_queue_pop_head(network->bss_list);
}
struct scan_bss *network_bss_find_by_addr(struct network *network,
@@ -2030,9 +1941,6 @@ static void network_unregister(struct network *network, int reason)
void network_remove(struct network *network, int reason)
{
- l_queue_foreach_remove(network->bss_list,
- network_unregister_bss, network);
-
if (network->object_path)
network_unregister(network, reason);
diff --git a/src/network.h b/src/network.h
index c9f73200..73d2ddb0 100644
--- a/src/network.h
+++ b/src/network.h
@@ -69,8 +69,6 @@ int network_can_connect_bss(struct network *network,
int network_autoconnect(struct network *network, struct scan_bss *bss);
void network_connect_failed(struct network *network, bool in_handshake);
void network_bss_start_update(struct network *network);
-void network_bss_stop_update(struct network *network,
- const struct scan_freq_set *freqs);
bool network_bss_add(struct network *network, struct scan_bss *bss);
bool network_bss_update(struct network *network, struct scan_bss *bss);
const char *network_bss_get_path(const struct network *network,
--
2.34.1
next prev parent reply other threads:[~2024-08-19 15:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-19 15:57 [PATCH v2 1/6] network: add __network_path_append_bss James Prestwood
2024-08-19 15:57 ` [PATCH v2 2/6] station: move BasicServiceSet DBus management into station James Prestwood
2024-08-19 15:57 ` James Prestwood [this message]
2024-08-19 15:57 ` [PATCH v2 4/6] network: add back network_bss_list_clear James Prestwood
2024-08-19 15:57 ` [PATCH v2 5/6] auto-t: Add ExtendedServiceSet property James Prestwood
2024-08-19 15:57 ` [PATCH v2 6/6] auto-t: Add test for BasicServiceSets James Prestwood
2024-08-19 16:53 ` [PATCH v2 1/6] network: add __network_path_append_bss Denis Kenzior
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=20240819155734.1276476-3-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