P2P: Add more debug prints for GO start routines
This makes it easier to debug issues in starting GO mode. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
d4534bde9c
commit
ac06fb12f5
3 changed files with 24 additions and 4 deletions
|
@ -851,6 +851,8 @@ static void wpa_supplicant_req_new_scan(struct wpa_supplicant *wpa_s,
|
||||||
* we don't wait timeout seconds before transitioning
|
* we don't wait timeout seconds before transitioning
|
||||||
* to INACTIVE state.
|
* 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);
|
wpa_supplicant_set_state(wpa_s, WPA_INACTIVE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -848,12 +848,18 @@ static void wpas_start_wps_go(struct wpa_supplicant *wpa_s,
|
||||||
{
|
{
|
||||||
struct wpa_ssid *ssid;
|
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;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ssid = wpa_config_add_network(wpa_s->conf);
|
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;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
wpa_s->show_group_started = 0;
|
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->connect_without_scan = ssid;
|
||||||
wpa_s->reassociate = 1;
|
wpa_s->reassociate = 1;
|
||||||
wpa_s->disconnected = 0;
|
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);
|
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;
|
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;
|
return wpa_s;
|
||||||
|
}
|
||||||
|
|
||||||
if (wpas_p2p_add_group_interface(wpa_s, go ? WPA_IF_P2P_GO :
|
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;
|
return NULL;
|
||||||
|
}
|
||||||
group_wpa_s = wpas_p2p_init_group_interface(wpa_s, go);
|
group_wpa_s = wpas_p2p_init_group_interface(wpa_s, go);
|
||||||
if (group_wpa_s == NULL) {
|
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);
|
wpas_p2p_remove_pending_group_interface(wpa_s);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Use separate group interface %s",
|
||||||
|
group_wpa_s->ifname);
|
||||||
return group_wpa_s;
|
return group_wpa_s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -451,6 +451,7 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wpa_s->disconnected && !wpa_s->scan_req) {
|
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);
|
wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue