diff options
author | Dan Williams <dcbw@redhat.com> | 2015-04-16 11:21:47 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2015-08-07 12:40:58 -0500 |
commit | 6d3aad25087e6c345e172006affe383a8a8b84a0 (patch) | |
tree | 324cee8387c5c2476998ab28a9ef9eb37489f607 | |
parent | d4559d0c54dc743dc4f37a39a2f1c6b8c46d712b (diff) | |
download | NetworkManager-6d3aad25087e6c345e172006affe383a8a8b84a0.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.c | 39 |
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 e9053713f8..4e5745bdf0 100644 --- a/src/devices/wifi/nm-device-wifi.c +++ b/src/devices/wifi/nm-device-wifi.c @@ -124,6 +124,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; @@ -1052,24 +1053,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; - - nm_log_dbg (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); - nm_log_dbg (LOGD_WIFI_SCAN, "Current AP list: done"); -} - static gboolean impl_device_get_access_points (NMDeviceWifi *self, GPtrArray **aps, @@ -1471,6 +1454,7 @@ supplicant_iface_scan_done_cb (NMSupplicantInterface *iface, nm_device_get_iface (NM_DEVICE (self)), 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 @@ -1489,6 +1473,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; + + nm_log_dbg (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 |