core: clean up initial device messages
This commit is contained in:
@@ -99,38 +99,33 @@ nm_spawn_process (const char *args)
|
|||||||
void
|
void
|
||||||
nm_print_device_capabilities (NMDevice *dev)
|
nm_print_device_capabilities (NMDevice *dev)
|
||||||
{
|
{
|
||||||
gboolean full_support = TRUE;
|
gboolean full_support = TRUE;
|
||||||
guint32 caps;
|
guint32 caps;
|
||||||
const char * driver = NULL;
|
const char *driver, *iface;
|
||||||
|
|
||||||
g_return_if_fail (dev != NULL);
|
g_return_if_fail (dev != NULL);
|
||||||
|
|
||||||
caps = nm_device_get_capabilities (dev);
|
caps = nm_device_get_capabilities (dev);
|
||||||
|
iface = nm_device_get_iface (dev);
|
||||||
driver = nm_device_get_driver (dev);
|
driver = nm_device_get_driver (dev);
|
||||||
if (!driver)
|
if (!driver)
|
||||||
driver = "<unknown>";
|
driver = "<unknown>";
|
||||||
|
|
||||||
if (caps == NM_DEVICE_CAP_NONE || !(NM_DEVICE_CAP_NM_SUPPORTED)) {
|
if (caps == NM_DEVICE_CAP_NONE || !(NM_DEVICE_CAP_NM_SUPPORTED)) {
|
||||||
nm_info ("%s: driver '%s' is unsupported",
|
nm_info ("(%s): driver '%s' is unsupported", iface, driver);
|
||||||
nm_device_get_iface (dev), driver);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NM_IS_DEVICE_ETHERNET (dev)) {
|
if (NM_IS_DEVICE_ETHERNET (dev)) {
|
||||||
if (!(caps & NM_DEVICE_CAP_CARRIER_DETECT)) {
|
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.",
|
"\tYou must switch to it manually.",
|
||||||
nm_device_get_iface (dev), driver);
|
iface, driver);
|
||||||
full_support = FALSE;
|
full_support = FALSE;
|
||||||
}
|
}
|
||||||
} else if (NM_IS_DEVICE_WIFI (dev)) {
|
} else if (NM_IS_DEVICE_WIFI (dev)) {
|
||||||
/* Print out WPA support */
|
/* Print out WPA support */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (full_support) {
|
|
||||||
nm_info ("%s: driver is '%s'.",
|
|
||||||
nm_device_get_iface (dev), driver);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -557,11 +557,11 @@ constructor (GType type,
|
|||||||
scan_capa_range = (struct iw_range_with_scan_capa *) ⦥
|
scan_capa_range = (struct iw_range_with_scan_capa *) ⦥
|
||||||
if (scan_capa_range->scan_capa & NM_IW_SCAN_CAPA_ESSID) {
|
if (scan_capa_range->scan_capa & NM_IW_SCAN_CAPA_ESSID) {
|
||||||
priv->has_scan_capa_ssid = TRUE;
|
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)),
|
nm_device_get_iface (NM_DEVICE (self)),
|
||||||
scan_capa_range->scan_capa);
|
scan_capa_range->scan_capa);
|
||||||
} else {
|
} 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)),
|
nm_device_get_iface (NM_DEVICE (self)),
|
||||||
scan_capa_range->scan_capa);
|
scan_capa_range->scan_capa);
|
||||||
}
|
}
|
||||||
|
@@ -1705,7 +1705,7 @@ static void
|
|||||||
add_device (NMManager *self, NMDevice *device)
|
add_device (NMManager *self, NMDevice *device)
|
||||||
{
|
{
|
||||||
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
|
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
|
||||||
const char *iface;
|
const char *iface, *driver;
|
||||||
|
|
||||||
priv->devices = g_slist_append (priv->devices, device);
|
priv->devices = g_slist_append (priv->devices, device);
|
||||||
|
|
||||||
@@ -1726,14 +1726,18 @@ add_device (NMManager *self, NMDevice *device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
iface = nm_device_get_iface (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))
|
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))
|
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)
|
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)
|
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
|
else
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user