diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c index 5748567e18..1e3d328ba8 100644 --- a/src/NetworkManagerUtils.c +++ b/src/NetworkManagerUtils.c @@ -99,38 +99,33 @@ nm_spawn_process (const char *args) void nm_print_device_capabilities (NMDevice *dev) { - gboolean full_support = TRUE; - guint32 caps; - const char * driver = NULL; + gboolean full_support = TRUE; + guint32 caps; + const char *driver, *iface; g_return_if_fail (dev != NULL); caps = nm_device_get_capabilities (dev); + iface = nm_device_get_iface (dev); driver = nm_device_get_driver (dev); if (!driver) driver = ""; if (caps == NM_DEVICE_CAP_NONE || !(NM_DEVICE_CAP_NM_SUPPORTED)) { - nm_info ("%s: driver '%s' is unsupported", - nm_device_get_iface (dev), driver); + nm_info ("(%s): driver '%s' is unsupported", iface, driver); return; } if (NM_IS_DEVICE_ETHERNET (dev)) { if (!(caps & NM_DEVICE_CAP_CARRIER_DETECT)) { - nm_info ("%s: driver '%s' does not support carrier detection.\n" + nm_info ("(%s): driver '%s' does not support carrier detection.\n" "\tYou must switch to it manually.", - nm_device_get_iface (dev), driver); + iface, driver); full_support = FALSE; } } else if (NM_IS_DEVICE_WIFI (dev)) { /* Print out WPA support */ } - - if (full_support) { - nm_info ("%s: driver is '%s'.", - nm_device_get_iface (dev), driver); - } } /* diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 6d3f4db628..80780d9a3f 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -557,11 +557,11 @@ constructor (GType type, scan_capa_range = (struct iw_range_with_scan_capa *) ⦥ if (scan_capa_range->scan_capa & NM_IW_SCAN_CAPA_ESSID) { priv->has_scan_capa_ssid = TRUE; - nm_info ("%s: driver supports SSID scans (scan_capa 0x%02X).", + nm_info ("(%s): driver supports SSID scans (scan_capa 0x%02X).", nm_device_get_iface (NM_DEVICE (self)), scan_capa_range->scan_capa); } else { - nm_info ("%s: driver does not support SSID scans (scan_capa 0x%02X).", + nm_info ("(%s): driver does not support SSID scans (scan_capa 0x%02X).", nm_device_get_iface (NM_DEVICE (self)), scan_capa_range->scan_capa); } diff --git a/src/nm-manager.c b/src/nm-manager.c index 25b6002245..30660f123a 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -1705,7 +1705,7 @@ static void add_device (NMManager *self, NMDevice *device) { NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self); - const char *iface; + const char *iface, *driver; priv->devices = g_slist_append (priv->devices, device); @@ -1726,14 +1726,18 @@ add_device (NMManager *self, NMDevice *device) } iface = nm_device_get_iface (device); + driver = nm_device_get_driver (NM_DEVICE (device)); + if (!driver) + driver = "unknown"; + if (NM_IS_DEVICE_ETHERNET (device)) - nm_info ("Found new Ethernet device '%s'.", iface); + nm_info ("(%s): new Ethernet device (driver: '%s')", iface, driver); else if (NM_IS_DEVICE_WIFI (device)) - nm_info ("Found new 802.11 WiFi device '%s'.", iface); + nm_info ("(%s): new 802.11 WiFi device (driver: '%s')", iface, driver); else if (nm_device_get_device_type (device) == NM_DEVICE_TYPE_GSM) - nm_info ("Found new GSM device '%s'.", iface); + nm_info ("(%s): new GSM device (driver: '%s')", iface, driver); else if (nm_device_get_device_type (device) == NM_DEVICE_TYPE_CDMA) - nm_info ("Found new CDMA device '%s'.", iface); + nm_info ("(%s): new CDMA device (driver: '%s')", iface, driver); else g_assert_not_reached ();