]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Add more debug prints for GO start routines
authorJouni Malinen <j@w1.fi>
Sun, 23 Sep 2012 22:05:51 +0000 (01:05 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 23 Sep 2012 22:05:51 +0000 (01:05 +0300)
This makes it easier to debug issues in starting GO mode.

Signed-hostap: Jouni Malinen <j@w1.fi>

wpa_supplicant/events.c
wpa_supplicant/p2p_supplicant.c
wpa_supplicant/scan.c

index 17db4082d4bd11d633e5df81ccadd62e25ccb4cb..e245d4acd2565dc9965a168d62a7b1d7eaff1190 100644 (file)
@@ -851,6 +851,8 @@ static void wpa_supplicant_req_new_scan(struct wpa_supplicant *wpa_s,
                 * we don't wait timeout seconds before transitioning
                 * to INACTIVE state.
                 */
+               wpa_dbg(wpa_s, MSG_DEBUG, "Short-circuit new scan request "
+                       "since there are no enabled networks");
                wpa_supplicant_set_state(wpa_s, WPA_INACTIVE);
                return;
        }
index 4463eb6c86421cc8f5832dae74ee60197a3d33be..883761a5020f264d1705992c657337aae4f60593 100644 (file)
@@ -848,12 +848,18 @@ static void wpas_start_wps_go(struct wpa_supplicant *wpa_s,
 {
        struct wpa_ssid *ssid;
 
-       if (wpas_copy_go_neg_results(wpa_s, params) < 0)
+       wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Starting GO");
+       if (wpas_copy_go_neg_results(wpa_s, params) < 0) {
+               wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Could not copy GO Negotiation "
+                       "results");
                return;
+       }
 
        ssid = wpa_config_add_network(wpa_s->conf);
-       if (ssid == NULL)
+       if (ssid == NULL) {
+               wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Could not add network for GO");
                return;
+       }
 
        wpa_s->show_group_started = 0;
 
@@ -890,6 +896,8 @@ static void wpas_start_wps_go(struct wpa_supplicant *wpa_s,
        wpa_s->connect_without_scan = ssid;
        wpa_s->reassociate = 1;
        wpa_s->disconnected = 0;
+       wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Request scan (that will be skipped) to "
+               "start GO)");
        wpa_supplicant_req_scan(wpa_s, 0, 0);
 }
 
@@ -3731,18 +3739,27 @@ wpas_p2p_get_group_iface(struct wpa_supplicant *wpa_s, int addr_allocated,
 {
        struct wpa_supplicant *group_wpa_s;
 
-       if (!wpas_p2p_create_iface(wpa_s))
+       if (!wpas_p2p_create_iface(wpa_s)) {
+               wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Use same interface for group "
+                       "operations");
                return wpa_s;
+       }
 
        if (wpas_p2p_add_group_interface(wpa_s, go ? WPA_IF_P2P_GO :
-                                        WPA_IF_P2P_CLIENT) < 0)
+                                        WPA_IF_P2P_CLIENT) < 0) {
+               wpa_msg(wpa_s, MSG_ERROR, "P2P: Failed to add group interface");
                return NULL;
+       }
        group_wpa_s = wpas_p2p_init_group_interface(wpa_s, go);
        if (group_wpa_s == NULL) {
+               wpa_msg(wpa_s, MSG_ERROR, "P2P: Failed to initialize group "
+                       "interface");
                wpas_p2p_remove_pending_group_interface(wpa_s);
                return NULL;
        }
 
+       wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Use separate group interface %s",
+               group_wpa_s->ifname);
        return group_wpa_s;
 }
 
index c01867119b8d0958818e83b6ead6e12ee6e85a88..f32354bd73c883868ab4d0c782d9c6af20a617f9 100644 (file)
@@ -451,6 +451,7 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
        }
 
        if (wpa_s->disconnected && !wpa_s->scan_req) {
+               wpa_dbg(wpa_s, MSG_DEBUG, "Disconnected - do not scan");
                wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED);
                return;
        }