P2P: Mark P2P events global (not specific to interface)

This removes the "IFNAME=<ifname> " prefix from P2P events that are
received through the global control interface since these events are not
really specific to any network interface, but the full device.

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2013-05-18 18:59:51 +03:00
parent ed496f131f
commit 92c4465b75

View file

@ -306,9 +306,9 @@ static int wpas_p2p_group_delete(struct wpa_supplicant *wpa_s,
gtype = "GO"; gtype = "GO";
if (wpa_s->cross_connect_in_use) { if (wpa_s->cross_connect_in_use) {
wpa_s->cross_connect_in_use = 0; wpa_s->cross_connect_in_use = 0;
wpa_msg(wpa_s->parent, MSG_INFO, wpa_msg_global(wpa_s->parent, MSG_INFO,
P2P_EVENT_CROSS_CONNECT_DISABLE "%s %s", P2P_EVENT_CROSS_CONNECT_DISABLE "%s %s",
wpa_s->ifname, wpa_s->cross_connect_uplink); wpa_s->ifname, wpa_s->cross_connect_uplink);
} }
switch (removal_reason) { switch (removal_reason) {
case P2P_GROUP_REMOVAL_REQUESTED: case P2P_GROUP_REMOVAL_REQUESTED:
@ -331,9 +331,9 @@ static int wpas_p2p_group_delete(struct wpa_supplicant *wpa_s,
break; break;
} }
if (removal_reason != P2P_GROUP_REMOVAL_SILENT) { if (removal_reason != P2P_GROUP_REMOVAL_SILENT) {
wpa_msg(wpa_s->parent, MSG_INFO, wpa_msg_global(wpa_s->parent, MSG_INFO,
P2P_EVENT_GROUP_REMOVED "%s %s%s", P2P_EVENT_GROUP_REMOVED "%s %s%s",
wpa_s->ifname, gtype, reason); wpa_s->ifname, gtype, reason);
} }
if (eloop_cancel_timeout(wpas_p2p_group_idle_timeout, wpa_s, NULL) > 0) if (eloop_cancel_timeout(wpas_p2p_group_idle_timeout, wpa_s, NULL) > 0)
@ -640,14 +640,15 @@ static void wpas_group_formation_completed(struct wpa_supplicant *wpa_s,
wpa_s->p2p_in_provisioning = 0; wpa_s->p2p_in_provisioning = 0;
if (!success) { if (!success) {
wpa_msg(wpa_s->parent, MSG_INFO, wpa_msg_global(wpa_s->parent, MSG_INFO,
P2P_EVENT_GROUP_FORMATION_FAILURE); P2P_EVENT_GROUP_FORMATION_FAILURE);
wpas_p2p_group_delete(wpa_s, wpas_p2p_group_delete(wpa_s,
P2P_GROUP_REMOVAL_FORMATION_FAILED); P2P_GROUP_REMOVAL_FORMATION_FAILED);
return; return;
} }
wpa_msg(wpa_s->parent, MSG_INFO, P2P_EVENT_GROUP_FORMATION_SUCCESS); wpa_msg_global(wpa_s->parent, MSG_INFO,
P2P_EVENT_GROUP_FORMATION_SUCCESS);
ssid = wpa_s->current_ssid; ssid = wpa_s->current_ssid;
if (ssid && ssid->mode == WPAS_MODE_P2P_GROUP_FORMATION) { if (ssid && ssid->mode == WPAS_MODE_P2P_GROUP_FORMATION) {
@ -687,22 +688,23 @@ static void wpas_group_formation_completed(struct wpa_supplicant *wpa_s,
} else if (ssid && ssid->passphrase == NULL && ssid->psk_set) { } else if (ssid && ssid->passphrase == NULL && ssid->psk_set) {
char psk[65]; char psk[65];
wpa_snprintf_hex(psk, sizeof(psk), ssid->psk, 32); wpa_snprintf_hex(psk, sizeof(psk), ssid->psk, 32);
wpa_msg(wpa_s->parent, MSG_INFO, P2P_EVENT_GROUP_STARTED wpa_msg_global(wpa_s->parent, MSG_INFO, P2P_EVENT_GROUP_STARTED
"%s GO ssid=\"%s\" freq=%d psk=%s go_dev_addr=" MACSTR "%s GO ssid=\"%s\" freq=%d psk=%s go_dev_addr="
"%s", MACSTR "%s",
wpa_s->ifname, ssid_txt, ssid->frequency, psk, wpa_s->ifname, ssid_txt, ssid->frequency, psk,
MAC2STR(go_dev_addr), MAC2STR(go_dev_addr),
persistent ? " [PERSISTENT]" : ""); persistent ? " [PERSISTENT]" : "");
wpas_p2p_cross_connect_setup(wpa_s); wpas_p2p_cross_connect_setup(wpa_s);
wpas_p2p_set_group_idle_timeout(wpa_s); wpas_p2p_set_group_idle_timeout(wpa_s);
} else { } else {
wpa_msg(wpa_s->parent, MSG_INFO, P2P_EVENT_GROUP_STARTED wpa_msg_global(wpa_s->parent, MSG_INFO, P2P_EVENT_GROUP_STARTED
"%s GO ssid=\"%s\" freq=%d passphrase=\"%s\" " "%s GO ssid=\"%s\" freq=%d passphrase=\"%s\" "
"go_dev_addr=" MACSTR "%s", "go_dev_addr=" MACSTR "%s",
wpa_s->ifname, ssid_txt, ssid ? ssid->frequency : 0, wpa_s->ifname, ssid_txt,
ssid && ssid->passphrase ? ssid->passphrase : "", ssid ? ssid->frequency : 0,
MAC2STR(go_dev_addr), ssid && ssid->passphrase ? ssid->passphrase : "",
persistent ? " [PERSISTENT]" : ""); MAC2STR(go_dev_addr),
persistent ? " [PERSISTENT]" : "");
wpas_p2p_cross_connect_setup(wpa_s); wpas_p2p_cross_connect_setup(wpa_s);
wpas_p2p_set_group_idle_timeout(wpa_s); wpas_p2p_set_group_idle_timeout(wpa_s);
} }
@ -825,26 +827,30 @@ static void p2p_go_configured(void *ctx, void *data)
if (wpa_s->global->p2p_group_formation == wpa_s) if (wpa_s->global->p2p_group_formation == wpa_s)
wpa_s->global->p2p_group_formation = NULL; wpa_s->global->p2p_group_formation = NULL;
if (os_strlen(params->passphrase) > 0) { if (os_strlen(params->passphrase) > 0) {
wpa_msg(wpa_s->parent, MSG_INFO, P2P_EVENT_GROUP_STARTED wpa_msg_global(wpa_s->parent, MSG_INFO,
"%s GO ssid=\"%s\" freq=%d passphrase=\"%s\" " P2P_EVENT_GROUP_STARTED
"go_dev_addr=" MACSTR "%s", wpa_s->ifname, "%s GO ssid=\"%s\" freq=%d "
wpa_ssid_txt(ssid->ssid, ssid->ssid_len), "passphrase=\"%s\" go_dev_addr=" MACSTR
ssid->frequency, params->passphrase, "%s", wpa_s->ifname,
MAC2STR(wpa_s->global->p2p_dev_addr), wpa_ssid_txt(ssid->ssid, ssid->ssid_len),
params->persistent_group ? " [PERSISTENT]" : ssid->frequency, params->passphrase,
""); MAC2STR(wpa_s->global->p2p_dev_addr),
params->persistent_group ?
" [PERSISTENT]" : "");
} else { } else {
char psk[65]; char psk[65];
wpa_snprintf_hex(psk, sizeof(psk), params->psk, wpa_snprintf_hex(psk, sizeof(psk), params->psk,
sizeof(params->psk)); sizeof(params->psk));
wpa_msg(wpa_s->parent, MSG_INFO, P2P_EVENT_GROUP_STARTED wpa_msg_global(wpa_s->parent, MSG_INFO,
"%s GO ssid=\"%s\" freq=%d psk=%s " P2P_EVENT_GROUP_STARTED
"go_dev_addr=" MACSTR "%s", wpa_s->ifname, "%s GO ssid=\"%s\" freq=%d psk=%s "
wpa_ssid_txt(ssid->ssid, ssid->ssid_len), "go_dev_addr=" MACSTR "%s",
ssid->frequency, psk, wpa_s->ifname,
MAC2STR(wpa_s->global->p2p_dev_addr), wpa_ssid_txt(ssid->ssid, ssid->ssid_len),
params->persistent_group ? " [PERSISTENT]" : ssid->frequency, psk,
""); MAC2STR(wpa_s->global->p2p_dev_addr),
params->persistent_group ?
" [PERSISTENT]" : "");
} }
if (params->persistent_group) if (params->persistent_group)
@ -918,8 +924,8 @@ static void wpas_start_wps_go(struct wpa_supplicant *wpa_s,
if (os_strlen(params->passphrase) > 0) { if (os_strlen(params->passphrase) > 0) {
ssid->passphrase = os_strdup(params->passphrase); ssid->passphrase = os_strdup(params->passphrase);
if (ssid->passphrase == NULL) { if (ssid->passphrase == NULL) {
wpa_msg(wpa_s, MSG_ERROR, "P2P: Failed to copy " wpa_msg_global(wpa_s, MSG_ERROR,
"passphrase for GO"); "P2P: Failed to copy passphrase for GO");
wpa_config_remove_network(wpa_s->conf, ssid->id); wpa_config_remove_network(wpa_s->conf, ssid->id);
return; return;
} }
@ -1115,8 +1121,9 @@ void wpas_go_neg_completed(void *ctx, struct p2p_go_neg_results *res)
} }
if (res->status) { if (res->status) {
wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_GO_NEG_FAILURE "status=%d", wpa_msg_global(wpa_s, MSG_INFO,
res->status); P2P_EVENT_GO_NEG_FAILURE "status=%d",
res->status);
wpas_notify_p2p_go_neg_completed(wpa_s, res); wpas_notify_p2p_go_neg_completed(wpa_s, res);
wpas_p2p_remove_pending_group_interface(wpa_s); wpas_p2p_remove_pending_group_interface(wpa_s);
return; return;
@ -1125,7 +1132,7 @@ void wpas_go_neg_completed(void *ctx, struct p2p_go_neg_results *res)
if (wpa_s->p2p_go_ht40) if (wpa_s->p2p_go_ht40)
res->ht40 = 1; res->ht40 = 1;
wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_GO_NEG_SUCCESS); wpa_msg_global(wpa_s, MSG_INFO, P2P_EVENT_GO_NEG_SUCCESS);
wpas_notify_p2p_go_neg_completed(wpa_s, res); wpas_notify_p2p_go_neg_completed(wpa_s, res);
if (res->role_go && wpa_s->p2p_persistent_id >= 0) { if (res->role_go && wpa_s->p2p_persistent_id >= 0) {
@ -1185,8 +1192,8 @@ void wpas_go_neg_completed(void *ctx, struct p2p_go_neg_results *res)
void wpas_go_neg_req_rx(void *ctx, const u8 *src, u16 dev_passwd_id) void wpas_go_neg_req_rx(void *ctx, const u8 *src, u16 dev_passwd_id)
{ {
struct wpa_supplicant *wpa_s = ctx; struct wpa_supplicant *wpa_s = ctx;
wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_GO_NEG_REQUEST MACSTR wpa_msg_global(wpa_s, MSG_INFO, P2P_EVENT_GO_NEG_REQUEST MACSTR
" dev_passwd_id=%u", MAC2STR(src), dev_passwd_id); " dev_passwd_id=%u", MAC2STR(src), dev_passwd_id);
wpas_notify_p2p_go_neg_req(wpa_s, src, dev_passwd_id); wpas_notify_p2p_go_neg_req(wpa_s, src, dev_passwd_id);
} }
@ -1200,13 +1207,13 @@ void wpas_dev_found(void *ctx, const u8 *addr,
struct wpa_supplicant *wpa_s = ctx; struct wpa_supplicant *wpa_s = ctx;
char devtype[WPS_DEV_TYPE_BUFSIZE]; char devtype[WPS_DEV_TYPE_BUFSIZE];
wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_DEVICE_FOUND MACSTR wpa_msg_global(wpa_s, MSG_INFO, P2P_EVENT_DEVICE_FOUND MACSTR
" p2p_dev_addr=" MACSTR " p2p_dev_addr=" MACSTR
" pri_dev_type=%s name='%s' config_methods=0x%x " " pri_dev_type=%s name='%s' config_methods=0x%x "
"dev_capab=0x%x group_capab=0x%x", "dev_capab=0x%x group_capab=0x%x",
MAC2STR(addr), MAC2STR(info->p2p_device_addr), MAC2STR(addr), MAC2STR(info->p2p_device_addr),
wps_dev_type_bin2str(info->pri_dev_type, devtype, wps_dev_type_bin2str(info->pri_dev_type, devtype,
sizeof(devtype)), sizeof(devtype)),
info->device_name, info->config_methods, info->device_name, info->config_methods,
info->dev_capab, info->group_capab); info->dev_capab, info->group_capab);
#endif /* CONFIG_NO_STDOUT_DEBUG */ #endif /* CONFIG_NO_STDOUT_DEBUG */
@ -1219,8 +1226,8 @@ static void wpas_dev_lost(void *ctx, const u8 *dev_addr)
{ {
struct wpa_supplicant *wpa_s = ctx; struct wpa_supplicant *wpa_s = ctx;
wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_DEVICE_LOST wpa_msg_global(wpa_s, MSG_INFO, P2P_EVENT_DEVICE_LOST
"p2p_dev_addr=" MACSTR, MAC2STR(dev_addr)); "p2p_dev_addr=" MACSTR, MAC2STR(dev_addr));
wpas_notify_p2p_device_lost(wpa_s, dev_addr); wpas_notify_p2p_device_lost(wpa_s, dev_addr);
} }
@ -1229,7 +1236,7 @@ static void wpas_dev_lost(void *ctx, const u8 *dev_addr)
static void wpas_find_stopped(void *ctx) static void wpas_find_stopped(void *ctx)
{ {
struct wpa_supplicant *wpa_s = ctx; struct wpa_supplicant *wpa_s = ctx;
wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_FIND_STOPPED); wpa_msg_global(wpa_s, MSG_INFO, P2P_EVENT_FIND_STOPPED);
} }
@ -2214,16 +2221,16 @@ static void wpas_prov_disc_local_display(struct wpa_supplicant *wpa_s,
const u8 *peer, const char *params, const u8 *peer, const char *params,
unsigned int generated_pin) unsigned int generated_pin)
{ {
wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_PROV_DISC_SHOW_PIN MACSTR " %08d%s", wpa_msg_global(wpa_s, MSG_INFO, P2P_EVENT_PROV_DISC_SHOW_PIN MACSTR
MAC2STR(peer), generated_pin, params); " %08d%s", MAC2STR(peer), generated_pin, params);
} }
static void wpas_prov_disc_local_keypad(struct wpa_supplicant *wpa_s, static void wpas_prov_disc_local_keypad(struct wpa_supplicant *wpa_s,
const u8 *peer, const char *params) const u8 *peer, const char *params)
{ {
wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_PROV_DISC_ENTER_PIN MACSTR "%s", wpa_msg_global(wpa_s, MSG_INFO, P2P_EVENT_PROV_DISC_ENTER_PIN MACSTR
MAC2STR(peer), params); "%s", MAC2STR(peer), params);
} }
@ -2275,8 +2282,8 @@ void wpas_prov_disc_req(void *ctx, const u8 *peer, u16 config_methods,
} else if (config_methods & WPS_CONFIG_KEYPAD) } else if (config_methods & WPS_CONFIG_KEYPAD)
wpas_prov_disc_local_keypad(wpa_s, peer, params); wpas_prov_disc_local_keypad(wpa_s, peer, params);
else if (config_methods & WPS_CONFIG_PUSHBUTTON) else if (config_methods & WPS_CONFIG_PUSHBUTTON)
wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_PROV_DISC_PBC_REQ MACSTR wpa_msg_global(wpa_s, MSG_INFO, P2P_EVENT_PROV_DISC_PBC_REQ
"%s", MAC2STR(peer), params); MACSTR "%s", MAC2STR(peer), params);
wpas_notify_p2p_provision_discovery(wpa_s, peer, 1 /* request */, wpas_notify_p2p_provision_discovery(wpa_s, peer, 1 /* request */,
P2P_PROV_DISC_SUCCESS, P2P_PROV_DISC_SUCCESS,
@ -2314,8 +2321,8 @@ void wpas_prov_disc_resp(void *ctx, const u8 *peer, u16 config_methods)
wpas_prov_disc_local_display(wpa_s, peer, params, wpas_prov_disc_local_display(wpa_s, peer, params,
generated_pin); generated_pin);
} else if (config_methods & WPS_CONFIG_PUSHBUTTON) } else if (config_methods & WPS_CONFIG_PUSHBUTTON)
wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_PROV_DISC_PBC_RESP MACSTR wpa_msg_global(wpa_s, MSG_INFO, P2P_EVENT_PROV_DISC_PBC_RESP
"%s", MAC2STR(peer), params); MACSTR "%s", MAC2STR(peer), params);
wpas_notify_p2p_provision_discovery(wpa_s, peer, 0 /* response */, wpas_notify_p2p_provision_discovery(wpa_s, peer, 0 /* response */,
P2P_PROV_DISC_SUCCESS, P2P_PROV_DISC_SUCCESS,
@ -2344,9 +2351,9 @@ static void wpas_prov_disc_fail(void *ctx, const u8 *peer,
return; return;
} }
wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_PROV_DISC_FAILURE wpa_msg_global(wpa_s, MSG_INFO, P2P_EVENT_PROV_DISC_FAILURE
" p2p_dev_addr=" MACSTR " status=%d", " p2p_dev_addr=" MACSTR " status=%d",
MAC2STR(peer), status); MAC2STR(peer), status);
wpas_notify_p2p_provision_discovery(wpa_s, peer, 0 /* response */, wpas_notify_p2p_provision_discovery(wpa_s, peer, 0 /* response */,
status, 0, 0); status, 0, 0);
@ -2497,27 +2504,30 @@ static void wpas_invitation_received(void *ctx, const u8 *sa, const u8 *bssid,
if (!s) { if (!s) {
if (bssid) { if (bssid) {
wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_INVITATION_RECEIVED wpa_msg_global(wpa_s, MSG_INFO,
"sa=" MACSTR " go_dev_addr=" MACSTR P2P_EVENT_INVITATION_RECEIVED
" bssid=" MACSTR " unknown-network", "sa=" MACSTR " go_dev_addr=" MACSTR
MAC2STR(sa), MAC2STR(go_dev_addr), " bssid=" MACSTR " unknown-network",
MAC2STR(bssid)); MAC2STR(sa), MAC2STR(go_dev_addr),
MAC2STR(bssid));
} else { } else {
wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_INVITATION_RECEIVED wpa_msg_global(wpa_s, MSG_INFO,
"sa=" MACSTR " go_dev_addr=" MACSTR P2P_EVENT_INVITATION_RECEIVED
" unknown-network", "sa=" MACSTR " go_dev_addr=" MACSTR
MAC2STR(sa), MAC2STR(go_dev_addr)); " unknown-network",
MAC2STR(sa), MAC2STR(go_dev_addr));
} }
return; return;
} }
if (s->mode == WPAS_MODE_P2P_GO && op_freq) { if (s->mode == WPAS_MODE_P2P_GO && op_freq) {
wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_INVITATION_RECEIVED "sa=" wpa_msg_global(wpa_s, MSG_INFO, P2P_EVENT_INVITATION_RECEIVED
MACSTR " persistent=%d freq=%d", "sa=" MACSTR " persistent=%d freq=%d",
MAC2STR(sa), s->id, op_freq); MAC2STR(sa), s->id, op_freq);
} else { } else {
wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_INVITATION_RECEIVED "sa=" wpa_msg_global(wpa_s, MSG_INFO, P2P_EVENT_INVITATION_RECEIVED
MACSTR " persistent=%d", MAC2STR(sa), s->id); "sa=" MACSTR " persistent=%d",
MAC2STR(sa), s->id);
} }
} }
@ -2589,12 +2599,12 @@ static void wpas_invitation_result(void *ctx, int status, const u8 *bssid,
struct wpa_ssid *ssid; struct wpa_ssid *ssid;
if (bssid) { if (bssid) {
wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_INVITATION_RESULT wpa_msg_global(wpa_s, MSG_INFO, P2P_EVENT_INVITATION_RESULT
"status=%d " MACSTR, "status=%d " MACSTR,
status, MAC2STR(bssid)); status, MAC2STR(bssid));
} else { } else {
wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_INVITATION_RESULT wpa_msg_global(wpa_s, MSG_INFO, P2P_EVENT_INVITATION_RESULT
"status=%d ", status); "status=%d ", status);
} }
wpas_notify_p2p_invitation_result(wpa_s, status, bssid); wpas_notify_p2p_invitation_result(wpa_s, status, bssid);
@ -2932,7 +2942,7 @@ static int wpas_go_connected(void *ctx, const u8 *dev_addr)
static void wpas_p2p_debug_print(void *ctx, int level, const char *msg) static void wpas_p2p_debug_print(void *ctx, int level, const char *msg)
{ {
struct wpa_supplicant *wpa_s = ctx; struct wpa_supplicant *wpa_s = ctx;
wpa_msg(wpa_s, level, "P2P: %s", msg); wpa_msg_global(wpa_s, level, "P2P: %s", msg);
} }
@ -3266,13 +3276,14 @@ static void wpas_p2p_check_join_scan_limit(struct wpa_supplicant *wpa_s)
eloop_cancel_timeout(wpas_p2p_join_scan, wpa_s, NULL); eloop_cancel_timeout(wpas_p2p_join_scan, wpa_s, NULL);
if (wpa_s->p2p_auto_pd) { if (wpa_s->p2p_auto_pd) {
wpa_s->p2p_auto_pd = 0; wpa_s->p2p_auto_pd = 0;
wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_PROV_DISC_FAILURE wpa_msg_global(wpa_s, MSG_INFO,
" p2p_dev_addr=" MACSTR " status=N/A", P2P_EVENT_PROV_DISC_FAILURE
MAC2STR(wpa_s->pending_join_dev_addr)); " p2p_dev_addr=" MACSTR " status=N/A",
MAC2STR(wpa_s->pending_join_dev_addr));
return; return;
} }
wpa_msg(wpa_s->parent, MSG_INFO, wpa_msg_global(wpa_s->parent, MSG_INFO,
P2P_EVENT_GROUP_FORMATION_FAILURE); P2P_EVENT_GROUP_FORMATION_FAILURE);
} }
} }
@ -3396,9 +3407,10 @@ static void wpas_p2p_scan_res_join(struct wpa_supplicant *wpa_s,
wpa_s->pending_pd_config_methods, join, wpa_s->pending_pd_config_methods, join,
0, wpa_s->user_initiated_pd) < 0) { 0, wpa_s->user_initiated_pd) < 0) {
wpa_s->p2p_auto_pd = 0; wpa_s->p2p_auto_pd = 0;
wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_PROV_DISC_FAILURE wpa_msg_global(wpa_s, MSG_INFO,
" p2p_dev_addr=" MACSTR " status=N/A", P2P_EVENT_PROV_DISC_FAILURE
MAC2STR(wpa_s->pending_join_dev_addr)); " p2p_dev_addr=" MACSTR " status=N/A",
MAC2STR(wpa_s->pending_join_dev_addr));
} }
return; return;
} }
@ -3460,9 +3472,9 @@ static void wpas_p2p_scan_res_join(struct wpa_supplicant *wpa_s,
u16 method; u16 method;
if (wpas_check_freq_conflict(wpa_s, freq) > 0) { if (wpas_check_freq_conflict(wpa_s, freq) > 0) {
wpa_msg(wpa_s->parent, MSG_INFO, wpa_msg_global(wpa_s->parent, MSG_INFO,
P2P_EVENT_GROUP_FORMATION_FAILURE P2P_EVENT_GROUP_FORMATION_FAILURE
"reason=FREQ_CONFLICT"); "reason=FREQ_CONFLICT");
return; return;
} }
@ -4164,13 +4176,14 @@ wpas_p2p_get_group_iface(struct wpa_supplicant *wpa_s, int addr_allocated,
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"); wpa_msg_global(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 " wpa_msg_global(wpa_s, MSG_ERROR,
"interface"); "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;
} }
@ -4974,20 +4987,20 @@ void wpas_p2p_completed(struct wpa_supplicant *wpa_s)
if (ssid->passphrase == NULL && ssid->psk_set) { if (ssid->passphrase == NULL && ssid->psk_set) {
char psk[65]; char psk[65];
wpa_snprintf_hex(psk, sizeof(psk), ssid->psk, 32); wpa_snprintf_hex(psk, sizeof(psk), ssid->psk, 32);
wpa_msg(wpa_s->parent, MSG_INFO, P2P_EVENT_GROUP_STARTED wpa_msg_global(wpa_s->parent, MSG_INFO, P2P_EVENT_GROUP_STARTED
"%s client ssid=\"%s\" freq=%d psk=%s go_dev_addr=" "%s client ssid=\"%s\" freq=%d psk=%s "
MACSTR "%s", "go_dev_addr=" MACSTR "%s",
wpa_s->ifname, ssid_txt, freq, psk, wpa_s->ifname, ssid_txt, freq, psk,
MAC2STR(go_dev_addr), MAC2STR(go_dev_addr),
persistent ? " [PERSISTENT]" : ""); persistent ? " [PERSISTENT]" : "");
} else { } else {
wpa_msg(wpa_s->parent, MSG_INFO, P2P_EVENT_GROUP_STARTED wpa_msg_global(wpa_s->parent, MSG_INFO, P2P_EVENT_GROUP_STARTED
"%s client ssid=\"%s\" freq=%d passphrase=\"%s\" " "%s client ssid=\"%s\" freq=%d "
"go_dev_addr=" MACSTR "%s", "passphrase=\"%s\" go_dev_addr=" MACSTR "%s",
wpa_s->ifname, ssid_txt, freq, wpa_s->ifname, ssid_txt, freq,
ssid->passphrase ? ssid->passphrase : "", ssid->passphrase ? ssid->passphrase : "",
MAC2STR(go_dev_addr), MAC2STR(go_dev_addr),
persistent ? " [PERSISTENT]" : ""); persistent ? " [PERSISTENT]" : "");
} }
if (persistent) if (persistent)
@ -5319,9 +5332,10 @@ int wpas_p2p_set_cross_connect(struct wpa_supplicant *wpa_s, int enabled)
iface->cross_connect_enabled = 0; iface->cross_connect_enabled = 0;
iface->cross_connect_in_use = 0; iface->cross_connect_in_use = 0;
wpa_msg(iface->parent, MSG_INFO, wpa_msg_global(iface->parent, MSG_INFO,
P2P_EVENT_CROSS_CONNECT_DISABLE "%s %s", P2P_EVENT_CROSS_CONNECT_DISABLE "%s %s",
iface->ifname, iface->cross_connect_uplink); iface->ifname,
iface->cross_connect_uplink);
} }
} }
@ -5348,9 +5362,9 @@ static void wpas_p2p_enable_cross_connect(struct wpa_supplicant *uplink)
continue; continue;
iface->cross_connect_in_use = 1; iface->cross_connect_in_use = 1;
wpa_msg(iface->parent, MSG_INFO, wpa_msg_global(iface->parent, MSG_INFO,
P2P_EVENT_CROSS_CONNECT_ENABLE "%s %s", P2P_EVENT_CROSS_CONNECT_ENABLE "%s %s",
iface->ifname, iface->cross_connect_uplink); iface->ifname, iface->cross_connect_uplink);
} }
} }
@ -5368,9 +5382,9 @@ static void wpas_p2p_disable_cross_connect(struct wpa_supplicant *uplink)
if (!iface->cross_connect_in_use) if (!iface->cross_connect_in_use)
continue; continue;
wpa_msg(iface->parent, MSG_INFO, wpa_msg_global(iface->parent, MSG_INFO,
P2P_EVENT_CROSS_CONNECT_DISABLE "%s %s", P2P_EVENT_CROSS_CONNECT_DISABLE "%s %s",
iface->ifname, iface->cross_connect_uplink); iface->ifname, iface->cross_connect_uplink);
iface->cross_connect_in_use = 0; iface->cross_connect_in_use = 0;
} }
} }
@ -5430,9 +5444,9 @@ static void wpas_p2p_cross_connect_setup(struct wpa_supplicant *wpa_s)
break; break;
wpa_s->cross_connect_in_use = 1; wpa_s->cross_connect_in_use = 1;
wpa_msg(wpa_s->parent, MSG_INFO, wpa_msg_global(wpa_s->parent, MSG_INFO,
P2P_EVENT_CROSS_CONNECT_ENABLE "%s %s", P2P_EVENT_CROSS_CONNECT_ENABLE "%s %s",
wpa_s->ifname, wpa_s->cross_connect_uplink); wpa_s->ifname, wpa_s->cross_connect_uplink);
break; break;
} }
} }