mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-08 23:30:18 +01:00
core: clean up initial device messages
This commit is contained in:
parent
13e49239bd
commit
90827aa224
3 changed files with 17 additions and 18 deletions
|
|
@ -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 = "<unknown>";
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1682,7 +1682,7 @@ hal_manager_udi_added_cb (NMHalManager *hal_mgr,
|
|||
NMManager *self = NM_MANAGER (user_data);
|
||||
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
|
||||
GObject *device;
|
||||
const char *iface;
|
||||
const char *iface, *driver;
|
||||
GType general_type = GPOINTER_TO_SIZE (general_type_ptr);
|
||||
|
||||
if (priv->sleeping)
|
||||
|
|
@ -1723,12 +1723,16 @@ hal_manager_udi_added_cb (NMHalManager *hal_mgr,
|
|||
}
|
||||
|
||||
iface = nm_device_get_iface (NM_DEVICE (device));
|
||||
driver = nm_device_get_driver (NM_DEVICE (device));
|
||||
if (!driver)
|
||||
driver = "unknown";
|
||||
|
||||
if (general_type == NM_TYPE_DEVICE_ETHERNET)
|
||||
nm_info ("Found new Ethernet device '%s'.", iface);
|
||||
nm_info ("(%s): new Ethernet device (driver: '%s')", iface, driver);
|
||||
else if (general_type == NM_TYPE_DEVICE_WIFI)
|
||||
nm_info ("Found new 802.11 WiFi device '%s'.", iface);
|
||||
nm_info ("(%s): new 802.11 WiFi device (driver: '%s')", iface, driver);
|
||||
else if (general_type == NM_TYPE_SERIAL_DEVICE)
|
||||
nm_info ("Found new Modem device '%s'.", iface);
|
||||
nm_info ("(%s): new Modem device (driver: '%s')", iface, driver);
|
||||
else
|
||||
g_assert_not_reached ();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue