P2P: Add Device Password ID to GO Neg Request RX event
authorJouni Malinen <jouni.malinen@atheros.com>
Mon, 26 Jul 2010 22:31:19 +0000 (15:31 -0700)
committerJouni Malinen <j@w1.fi>
Thu, 9 Sep 2010 14:17:20 +0000 (07:17 -0700)
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

doc/ctrl_iface.doxygen
src/p2p/p2p.h
src/p2p/p2p_go_neg.c
wpa_supplicant/p2p_supplicant.c
wpa_supplicant/p2p_supplicant.h

index f63e770..85847f6 100644 (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.
 
 \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
 
 \subsection ctrl_iface_event_P2P_EVENT_GO_NEG_SUCCESS P2P-GO-NEG-SUCCESS
index c5ace02..a5e7ac1 100644 (file)
@@ -398,6 +398,7 @@ struct p2p_config {
         * go_neg_req_rx - Notification of a receive GO Negotiation Request
         * @ctx: Callback context from cb_ctx
         * @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
         * 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
         * 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
index 227b47c..f55bba7 100644 (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;
                if (dev)
                        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) {
                wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
                        "P2P: Already in Group Formation with another peer");
index 38a51db..fa6cfed 100644 (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;
-       wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_GO_NEG_REQUEST MACSTR,
-               MAC2STR(src));
+       wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_GO_NEG_REQUEST MACSTR
+               " dev_passwd_id=%u", MAC2STR(src), dev_passwd_id);
 }
 
 
index 11674e0..beaa64d 100644 (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,
                    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_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,
                        const u8 *dev_addr, const u8 *pri_dev_type,
                        const char *dev_name, u16 supp_config_methods,