summaryrefslogtreecommitdiff
path: root/src/supplicant/nm-supplicant-interface.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-02-15 11:17:55 +0100
committerThomas Haller <thaller@redhat.com>2017-02-17 14:41:26 +0100
commit29a53b1cd7fb48984221c71b38b049c3ced9b560 (patch)
treec8fdf0414996a08a5a389db83718c5f03951eca3 /src/supplicant/nm-supplicant-interface.c
parentc47026715ec6a9612752f469358a7251aabbdee7 (diff)
downloadNetworkManager-29a53b1cd7fb48984221c71b38b049c3ced9b560.tar.gz
supplicant: merge NEW_BSS signal with BSS_UPDATED
Before, the NEW_BSS signal was not careful to emit the signal only when the BSS is seen for the first time. Consequently, supplicant_iface_new_bss_cb() checked whether it already knows about the new BSS. Merge NEW_BSS and BSS_UPDATED. Now we emit BSS_UPDATED when either the BSS is new or changed. Also, in supplicant_iface_new_bss_cb() (now supplicant_iface_bss_updated_cb()) no longer constructs an @ap instance if we have a @found_ap. In some situations there can be a value of having a separate ADD signal. But only when there the consumers care, and if the consumers can trust that ADD is not just an UPDATE. The only consumer doesn't care and it not not be trusted, so merge the signals.
Diffstat (limited to 'src/supplicant/nm-supplicant-interface.c')
-rw-r--r--src/supplicant/nm-supplicant-interface.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/supplicant/nm-supplicant-interface.c b/src/supplicant/nm-supplicant-interface.c
index 62cf96be63..2590b1de44 100644
--- a/src/supplicant/nm-supplicant-interface.c
+++ b/src/supplicant/nm-supplicant-interface.c
@@ -62,8 +62,7 @@ typedef struct _AddNetworkData {
enum {
STATE, /* change in the interface's state */
REMOVED, /* interface was removed by the supplicant */
- NEW_BSS, /* interface saw a new access point from a scan */
- BSS_UPDATED, /* a BSS property changed */
+ BSS_UPDATED, /* a new BSS appeared or an existing had properties changed */
BSS_REMOVED, /* supplicant removed BSS from its scan list */
SCAN_DONE, /* wifi scan is complete */
CREDENTIALS_REQUEST, /* 802.1x identity or password requested */
@@ -229,7 +228,7 @@ on_bss_proxy_acquired (GDBusProxy *proxy, GAsyncResult *result, gpointer user_da
g_object_set_qdata (G_OBJECT (proxy), bss_proxy_inited_quark (), GUINT_TO_POINTER (TRUE));
- g_signal_emit (self, signals[NEW_BSS], 0,
+ g_signal_emit (self, signals[BSS_UPDATED], 0,
g_dbus_proxy_get_object_path (proxy),
g_variant_ref_sink (props));
}
@@ -577,13 +576,13 @@ wpas_iface_scan_done (GDBusProxy *proxy,
/* Cache last scan completed time */
priv->last_scan = nm_utils_get_monotonic_timestamp_s ();
- /* Emit NEW_BSS so that wifi device has the APs (in case it removed them) */
+ /* Emit BSS_UPDATED so that wifi device has the APs (in case it removed them) */
g_hash_table_iter_init (&iter, priv->bss_proxies);
while (g_hash_table_iter_next (&iter, (gpointer) &bss_path, (gpointer) &bss_proxy)) {
if (g_object_get_qdata (G_OBJECT (bss_proxy), bss_proxy_inited_quark ())) {
props = _get_bss_proxy_properties (self, bss_proxy);
if (props) {
- g_signal_emit (self, signals[NEW_BSS], 0,
+ g_signal_emit (self, signals[BSS_UPDATED], 0,
bss_path,
g_variant_ref_sink (props));
g_variant_unref (props);
@@ -1634,14 +1633,6 @@ nm_supplicant_interface_class_init (NMSupplicantInterfaceClass *klass)
NULL, NULL, NULL,
G_TYPE_NONE, 0);
- signals[NEW_BSS] =
- g_signal_new (NM_SUPPLICANT_INTERFACE_NEW_BSS,
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- 0,
- NULL, NULL, NULL,
- G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_VARIANT);
-
signals[BSS_UPDATED] =
g_signal_new (NM_SUPPLICANT_INTERFACE_BSS_UPDATED,
G_OBJECT_CLASS_TYPE (object_class),