summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2015-04-16 11:21:47 -0500
committerDan Williams <dcbw@redhat.com>2015-05-06 15:14:06 -0500
commitbe370859ef2fd781a8ad0a479a8cd1f02751323b (patch)
tree3cc62ecadd2772d0ee83ccbf08c7a692c6a3b3ca
parent6ee7e22acb873a1c90ae08ec426cf835044c546b (diff)
downloadNetworkManager-be370859ef2fd781a8ad0a479a8cd1f02751323b.tar.gz
wifi: condense AP list dump log message
Remove the trailing message, and indicate when the last scan took place and when the next one will happen.
-rw-r--r--src/devices/wifi/nm-device-wifi.c39
1 files changed, 21 insertions, 18 deletions
diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c
index c56595fcfb..513bd8719c 100644
--- a/src/devices/wifi/nm-device-wifi.c
+++ b/src/devices/wifi/nm-device-wifi.c
@@ -127,6 +127,7 @@ struct _NMDeviceWifiPrivate {
guint32 rate;
gboolean enabled; /* rfkilled or not */
+ gint32 last_scan;
gint32 scheduled_scan_time;
guint8 scan_interval; /* seconds */
guint pending_scan_id;
@@ -1021,24 +1022,6 @@ get_sorted_ap_list (NMDeviceWifi *self)
return g_slist_sort (sorted, (GCompareFunc) ap_id_compare);
}
-static void
-ap_list_dump (NMDeviceWifi *self)
-{
- GSList *sorted, *iter;
-
- g_return_if_fail (NM_IS_DEVICE_WIFI (self));
-
- if (!nm_logging_enabled (LOGL_DEBUG, LOGD_WIFI_SCAN))
- return;
-
- _LOGD (LOGD_WIFI_SCAN, "Current AP list:");
- sorted = get_sorted_ap_list (self);
- for (iter = sorted; iter; iter = iter->next)
- nm_ap_dump (NM_AP (iter->data), "List AP: ", nm_device_get_iface (NM_DEVICE (self)));
- g_slist_free (sorted);
- _LOGD (LOGD_WIFI_SCAN, "Current AP list: done");
-}
-
static gboolean
impl_device_get_access_points (NMDeviceWifi *self,
GPtrArray **aps,
@@ -1434,6 +1417,7 @@ supplicant_iface_scan_done_cb (NMSupplicantInterface *iface,
_LOGD (LOGD_WIFI_SCAN, "scan %s", success ? "successful" : "failed");
+ priv->last_scan = nm_utils_get_monotonic_timestamp_s ();
schedule_scan (self, success);
/* Ensure that old APs get removed, which otherwise only
@@ -1452,6 +1436,25 @@ supplicant_iface_scan_done_cb (NMSupplicantInterface *iface,
*
*/
+static void
+ap_list_dump (NMDeviceWifi *self)
+{
+ NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
+ GSList *sorted, *iter;
+
+ if (!nm_logging_enabled (LOGL_DEBUG, LOGD_WIFI_SCAN))
+ return;
+
+ _LOGD (LOGD_WIFI_SCAN, "APs: [now:%u last:%u next:%u]",
+ nm_utils_get_monotonic_timestamp_s (),
+ priv->last_scan,
+ priv->scheduled_scan_time);
+ sorted = get_sorted_ap_list (self);
+ for (iter = sorted; iter; iter = iter->next)
+ nm_ap_dump (NM_AP (iter->data), " ", nm_device_get_iface (NM_DEVICE (self)));
+ g_slist_free (sorted);
+}
+
#define WPAS_REMOVED_TAG "supplicant-removed"
static void