nl80211: Add more debug prints for mode changes and interface add/remove

This commit is contained in:
Jouni Malinen 2009-12-28 13:25:17 +02:00 committed by Jouni Malinen
parent 4832ecd754
commit c6e8e8e41f

View file

@ -2535,6 +2535,8 @@ static void nl80211_remove_iface(struct wpa_driver_nl80211_data *drv,
{ {
struct nl_msg *msg; struct nl_msg *msg;
wpa_printf(MSG_DEBUG, "nl80211: Remove interface ifindex=%d", ifidx);
#ifdef HOSTAPD #ifdef HOSTAPD
/* stop listening for EAPOL on this interface */ /* stop listening for EAPOL on this interface */
del_ifidx(drv, ifidx); del_ifidx(drv, ifidx);
@ -2603,6 +2605,8 @@ static int nl80211_create_iface_once(struct wpa_driver_nl80211_data *drv,
} }
ifidx = if_nametoindex(ifname); ifidx = if_nametoindex(ifname);
wpa_printf(MSG_DEBUG, "nl80211: New interface %s created: ifindex=%d",
ifname, ifidx);
if (ifidx <= 0) if (ifidx <= 0)
return -1; return -1;
@ -3546,6 +3550,8 @@ static int wpa_driver_nl80211_set_mode(void *priv, int mode)
} }
if (nlmode == drv->nlmode) { if (nlmode == drv->nlmode) {
wpa_printf(MSG_DEBUG, "nl80211: Interface already in "
"requested mode - ignore error");
ret = 0; ret = 0;
goto done; /* Already in the requested mode */ goto done; /* Already in the requested mode */
} }
@ -3561,8 +3567,11 @@ static int wpa_driver_nl80211_set_mode(void *priv, int mode)
ret = -1; ret = -1;
} }
if (!ret) if (!ret) {
wpa_printf(MSG_DEBUG, "nl80211: Mode change succeeded while "
"interface is down");
drv->nlmode = nlmode; drv->nlmode = nlmode;
}
done: done:
if (!ret && nlmode == NL80211_IFTYPE_AP) { if (!ret && nlmode == NL80211_IFTYPE_AP) {
@ -3575,6 +3584,10 @@ done:
nl80211_remove_monitor_interface(drv); nl80211_remove_monitor_interface(drv);
} }
if (ret)
wpa_printf(MSG_DEBUG, "nl80211: Interface mode change to %d "
"from %d failed", nlmode, drv->nlmode);
return ret; return ret;
} }