P2P: Add Device Password ID to GO Neg Request RX event

This event indicates the Device Password ID that the peer tried
to use in GO Negotiation. For example:
P2P-GO-NEG-REQUEST 02:40:61:c2:f3:b7 dev_passwd_id=4
This commit is contained in:
Jouni Malinen 2010-07-26 15:31:19 -07:00 committed by Jouni Malinen
parent 4147a2cc64
commit 3dfda83d9c
5 changed files with 9 additions and 7 deletions

View file

@ -913,7 +913,7 @@ P2P_EVENT_GO_NEG_REQUEST: A P2P device requested GO negotiation, but we
were not ready to start the negotiation. were not ready to start the negotiation.
\verbatim \verbatim
P2P-GO-NEG-REQUEST 02:40:61:c2:f3:b7 P2P-GO-NEG-REQUEST 02:40:61:c2:f3:b7 dev_passwd_id=4
\endverbatim \endverbatim
\subsection ctrl_iface_event_P2P_EVENT_GO_NEG_SUCCESS P2P-GO-NEG-SUCCESS \subsection ctrl_iface_event_P2P_EVENT_GO_NEG_SUCCESS P2P-GO-NEG-SUCCESS

View file

@ -398,6 +398,7 @@ struct p2p_config {
* go_neg_req_rx - Notification of a receive GO Negotiation Request * go_neg_req_rx - Notification of a receive GO Negotiation Request
* @ctx: Callback context from cb_ctx * @ctx: Callback context from cb_ctx
* @src: Source address of the message triggering this notification * @src: Source address of the message triggering this notification
* @dev_passwd_id: WPS Device Password ID
* *
* This callback is used to notify that a P2P Device is requesting * This callback is used to notify that a P2P Device is requesting
* group owner negotiation with us, but we do not have all the * group owner negotiation with us, but we do not have all the
@ -406,7 +407,7 @@ struct p2p_config {
* PIN or PBC button press. This information can be provided with a * PIN or PBC button press. This information can be provided with a
* call to p2p_connect(). * call to p2p_connect().
*/ */
void (*go_neg_req_rx)(void *ctx, const u8 *src); void (*go_neg_req_rx)(void *ctx, const u8 *src, u16 dev_passwd_id);
/** /**
* go_neg_completed - Notification of GO Negotiation results * go_neg_completed - Notification of GO Negotiation results

View file

@ -395,7 +395,8 @@ void p2p_process_go_neg_req(struct p2p_data *p2p, const u8 *sa,
status = P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE; status = P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE;
if (dev) if (dev)
dev->flags |= P2P_DEV_PEER_WAITING_RESPONSE; dev->flags |= P2P_DEV_PEER_WAITING_RESPONSE;
p2p->cfg->go_neg_req_rx(p2p->cfg->cb_ctx, sa); p2p->cfg->go_neg_req_rx(p2p->cfg->cb_ctx, sa,
msg.dev_password_id);
} else if (p2p->go_neg_peer && p2p->go_neg_peer != dev) { } else if (p2p->go_neg_peer && p2p->go_neg_peer != dev) {
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
"P2P: Already in Group Formation with another peer"); "P2P: Already in Group Formation with another peer");

View file

@ -978,11 +978,11 @@ void wpas_go_neg_completed(void *ctx, struct p2p_go_neg_results *res)
} }
void wpas_go_neg_req_rx(void *ctx, const u8 *src) 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(wpa_s, MSG_INFO, P2P_EVENT_GO_NEG_REQUEST MACSTR
MAC2STR(src)); " dev_passwd_id=%u", MAC2STR(src), dev_passwd_id);
} }

View file

@ -63,7 +63,7 @@ void wpas_dev_found(void *ctx, const u8 *addr, const u8 *dev_addr,
const u8 *pri_dev_type, const char *dev_name, const u8 *pri_dev_type, const char *dev_name,
u16 config_methods, u8 dev_capab, u8 group_capab); u16 config_methods, u8 dev_capab, u8 group_capab);
void wpas_go_neg_completed(void *ctx, struct p2p_go_neg_results *res); void wpas_go_neg_completed(void *ctx, struct p2p_go_neg_results *res);
void wpas_go_neg_req_rx(void *ctx, const u8 *src); void wpas_go_neg_req_rx(void *ctx, const u8 *src, u16 dev_passwd_id);
void wpas_prov_disc_req(void *ctx, const u8 *peer, u16 config_methods, void wpas_prov_disc_req(void *ctx, const u8 *peer, u16 config_methods,
const u8 *dev_addr, const u8 *pri_dev_type, const u8 *dev_addr, const u8 *pri_dev_type,
const char *dev_name, u16 supp_config_methods, const char *dev_name, u16 supp_config_methods,