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:
parent
ed496f131f
commit
92c4465b75
1 changed files with 139 additions and 125 deletions
|
@ -306,7 +306,7 @@ 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);
|
||||||
}
|
}
|
||||||
|
@ -331,7 +331,7 @@ 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);
|
||||||
}
|
}
|
||||||
|
@ -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,19 +688,20 @@ 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->frequency : 0,
|
||||||
ssid && ssid->passphrase ? ssid->passphrase : "",
|
ssid && ssid->passphrase ? ssid->passphrase : "",
|
||||||
MAC2STR(go_dev_addr),
|
MAC2STR(go_dev_addr),
|
||||||
persistent ? " [PERSISTENT]" : "");
|
persistent ? " [PERSISTENT]" : "");
|
||||||
|
@ -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 "
|
||||||
|
"passphrase=\"%s\" go_dev_addr=" MACSTR
|
||||||
|
"%s", wpa_s->ifname,
|
||||||
wpa_ssid_txt(ssid->ssid, ssid->ssid_len),
|
wpa_ssid_txt(ssid->ssid, ssid->ssid_len),
|
||||||
ssid->frequency, params->passphrase,
|
ssid->frequency, params->passphrase,
|
||||||
MAC2STR(wpa_s->global->p2p_dev_addr),
|
MAC2STR(wpa_s->global->p2p_dev_addr),
|
||||||
params->persistent_group ? " [PERSISTENT]" :
|
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,
|
||||||
|
P2P_EVENT_GROUP_STARTED
|
||||||
"%s GO ssid=\"%s\" freq=%d psk=%s "
|
"%s GO ssid=\"%s\" freq=%d psk=%s "
|
||||||
"go_dev_addr=" MACSTR "%s", wpa_s->ifname,
|
"go_dev_addr=" MACSTR "%s",
|
||||||
|
wpa_s->ifname,
|
||||||
wpa_ssid_txt(ssid->ssid, ssid->ssid_len),
|
wpa_ssid_txt(ssid->ssid, ssid->ssid_len),
|
||||||
ssid->frequency, psk,
|
ssid->frequency, psk,
|
||||||
MAC2STR(wpa_s->global->p2p_dev_addr),
|
MAC2STR(wpa_s->global->p2p_dev_addr),
|
||||||
params->persistent_group ? " [PERSISTENT]" :
|
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,7 +1121,8 @@ 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,
|
||||||
|
P2P_EVENT_GO_NEG_FAILURE "status=%d",
|
||||||
res->status);
|
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);
|
||||||
|
@ -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,7 +1192,7 @@ 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,7 +1207,7 @@ 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",
|
||||||
|
@ -1219,7 +1226,7 @@ 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,7 +2351,7 @@ 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);
|
||||||
|
|
||||||
|
@ -2497,13 +2504,15 @@ 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,
|
||||||
|
P2P_EVENT_INVITATION_RECEIVED
|
||||||
"sa=" MACSTR " go_dev_addr=" MACSTR
|
"sa=" MACSTR " go_dev_addr=" MACSTR
|
||||||
" bssid=" MACSTR " unknown-network",
|
" bssid=" MACSTR " unknown-network",
|
||||||
MAC2STR(sa), MAC2STR(go_dev_addr),
|
MAC2STR(sa), MAC2STR(go_dev_addr),
|
||||||
MAC2STR(bssid));
|
MAC2STR(bssid));
|
||||||
} else {
|
} else {
|
||||||
wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_INVITATION_RECEIVED
|
wpa_msg_global(wpa_s, MSG_INFO,
|
||||||
|
P2P_EVENT_INVITATION_RECEIVED
|
||||||
"sa=" MACSTR " go_dev_addr=" MACSTR
|
"sa=" MACSTR " go_dev_addr=" MACSTR
|
||||||
" unknown-network",
|
" unknown-network",
|
||||||
MAC2STR(sa), MAC2STR(go_dev_addr));
|
MAC2STR(sa), MAC2STR(go_dev_addr));
|
||||||
|
@ -2512,12 +2521,13 @@ static void wpas_invitation_received(void *ctx, const u8 *sa, const u8 *bssid,
|
||||||
}
|
}
|
||||||
|
|
||||||
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,11 +2599,11 @@ 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,12 +3276,13 @@ 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_EVENT_PROV_DISC_FAILURE
|
||||||
" p2p_dev_addr=" MACSTR " status=N/A",
|
" p2p_dev_addr=" MACSTR " status=N/A",
|
||||||
MAC2STR(wpa_s->pending_join_dev_addr));
|
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,7 +3407,8 @@ 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_EVENT_PROV_DISC_FAILURE
|
||||||
" p2p_dev_addr=" MACSTR " status=N/A",
|
" p2p_dev_addr=" MACSTR " status=N/A",
|
||||||
MAC2STR(wpa_s->pending_join_dev_addr));
|
MAC2STR(wpa_s->pending_join_dev_addr));
|
||||||
}
|
}
|
||||||
|
@ -3460,7 +3472,7 @@ 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,16 +4987,16 @@ 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),
|
||||||
|
@ -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,7 +5362,7 @@ 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,7 +5382,7 @@ 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,7 +5444,7 @@ 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;
|
||||||
|
|
Loading…
Reference in a new issue