diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index a6c6282419..6062c3c72e 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -1208,16 +1208,25 @@ real_is_available (NMDevice *dev) NMSupplicantInterface *sup_iface; guint32 state; - if (!priv->enabled) + if (!priv->enabled) { + nm_log_dbg (LOGD_WIFI, "(%s): not available because not enabled", + nm_device_get_iface (dev)); return FALSE; + } sup_iface = priv->supplicant.iface; - if (!sup_iface) + if (!sup_iface) { + nm_log_dbg (LOGD_WIFI, "(%s): not available because supplicant not running", + nm_device_get_iface (dev)); return FALSE; + } state = nm_supplicant_interface_get_state (sup_iface); - if (state != NM_SUPPLICANT_INTERFACE_STATE_READY) + if (state != NM_SUPPLICANT_INTERFACE_STATE_READY) { + nm_log_dbg (LOGD_WIFI, "(%s): not available because supplicant interface not ready", + nm_device_get_iface (dev)); return FALSE; + } return TRUE; } @@ -3499,9 +3508,16 @@ real_set_enabled (NMDeviceInterface *device, gboolean enabled) priv->enabled = enabled; + nm_log_dbg (LOGD_WIFI, "(%s): device now %s", + nm_device_get_iface (NM_DEVICE (device)), + enabled ? "enabled" : "disabled"); + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (self)); - if (state < NM_DEVICE_STATE_UNAVAILABLE) + if (state < NM_DEVICE_STATE_UNAVAILABLE) { + nm_log_dbg (LOGD_WIFI, "(%s): enable blocked by UNMANAGED state", + nm_device_get_iface (NM_DEVICE (device))); return; + } if (enabled) { gboolean no_firmware = FALSE, success; @@ -3511,6 +3527,9 @@ real_set_enabled (NMDeviceInterface *device, gboolean enabled) nm_log_warn (LOGD_CORE, "not in expected unavailable state!"); if (!nm_device_hw_bring_up (NM_DEVICE (self), TRUE, &no_firmware)) { + nm_log_dbg (LOGD_WIFI, "(%s): enable blocked by failure to bring device up", + nm_device_get_iface (NM_DEVICE (device))); + /* The device sucks, or HAL was lying to us about the killswitch state */ priv->enabled = FALSE; return; @@ -3525,6 +3544,8 @@ real_set_enabled (NMDeviceInterface *device, gboolean enabled) supplicant_interface_release (self); supplicant_interface_acquire (self); + nm_log_dbg (LOGD_WIFI, "(%s): enable waiting on supplicant state", + nm_device_get_iface (NM_DEVICE (device))); } else { nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_UNAVAILABLE, diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index 4307a9ebc2..da1a856d1b 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -768,6 +768,7 @@ static void nm_supplicant_interface_add_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpointer user_data) { NMSupplicantInfo *info = (NMSupplicantInfo *) user_data; + NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); GError *err = NULL; char *path = NULL; @@ -782,13 +783,13 @@ nm_supplicant_interface_add_cb (DBusGProxy *proxy, DBusGProxyCall *call_id, gpoi /* Interface already added, just try to get the interface */ nm_supplicant_interface_add_to_supplicant (info->interface, TRUE); } else { - nm_log_warn (LOGD_SUPPLICANT, "Unexpected supplicant error getting interface: %s", - err->message); + nm_log_err (LOGD_SUPPLICANT, "(%s): error getting interface: %s", + priv->dev, err->message); } g_error_free (err); } else { - NMSupplicantInterfacePrivate *priv = NM_SUPPLICANT_INTERFACE_GET_PRIVATE (info->interface); + nm_log_dbg (LOGD_SUPPLICANT, "(%s): interface added to supplicant", priv->dev); priv->object_path = path; @@ -887,6 +888,8 @@ nm_supplicant_interface_start (NMSupplicantInterface * self) /* Can only start the interface from INIT state */ g_return_if_fail (priv->state == NM_SUPPLICANT_INTERFACE_STATE_INIT); + nm_log_dbg (LOGD_SUPPLICANT, "(%s): adding interface to supplicant", priv->dev); + state = nm_supplicant_manager_get_state (priv->smgr); if (state == NM_SUPPLICANT_MANAGER_STATE_IDLE) { nm_supplicant_interface_set_state (self, NM_SUPPLICANT_INTERFACE_STATE_STARTING); diff --git a/src/supplicant-manager/nm-supplicant-manager.c b/src/supplicant-manager/nm-supplicant-manager.c index f8390437dc..a2cf58eb8f 100644 --- a/src/supplicant-manager/nm-supplicant-manager.c +++ b/src/supplicant-manager/nm-supplicant-manager.c @@ -288,9 +288,12 @@ nm_supplicant_manager_get_iface (NMSupplicantManager * self, } if (!iface) { + nm_log_dbg (LOGD_SUPPLICANT, "(%s): creating new supplicant interface", ifname); iface = nm_supplicant_interface_new (self, ifname, is_wireless); if (iface) priv->ifaces = g_slist_append (priv->ifaces, iface); + } else { + nm_log_dbg (LOGD_SUPPLICANT, "(%s): returning existing supplicant interface", ifname); } return iface;