]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Let the driver wrapper know if association is for P2P group
authorJouni Malinen <jouni.malinen@atheros.com>
Sun, 18 Jul 2010 21:30:25 +0000 (14:30 -0700)
committerJouni Malinen <j@w1.fi>
Thu, 9 Sep 2010 14:17:17 +0000 (07:17 -0700)
wpa_supplicant/ap.c
wpa_supplicant/sme.c
wpa_supplicant/wpa_supplicant.c

index 9e5d390716ec15839a4f27cc3cf7d41217f84ba1..30875423fb3cbb6ab90e2f30778e2d42c7300115 100644 (file)
@@ -290,6 +290,12 @@ int wpa_supplicant_create_ap(struct wpa_supplicant *wpa_s,
        params.pairwise_suite = cipher_suite2driver(wpa_s->pairwise_cipher);
        params.group_suite = params.pairwise_suite;
 
+#ifdef CONFIG_P2P
+       if (ssid->mode == WPAS_MODE_P2P_GO ||
+           ssid->mode == WPAS_MODE_P2P_GROUP_FORMATION)
+               params.p2p = 1;
+#endif /* CONFIG_P2P */
+
        if (wpa_drv_associate(wpa_s, &params) < 0) {
                wpa_msg(wpa_s, MSG_INFO, "Failed to start AP functionality");
                return -1;
index 5604e97cb3eece7afde1a42f194e7c04e606ed3d..a11a896d0a41e7cb94209addcca7ec28bb5ffcae 100644 (file)
@@ -365,6 +365,9 @@ void sme_associate(struct wpa_supplicant *wpa_s, enum wpas_mode mode,
                                        elems.wpa_ie_len + 2);
        else
                wpa_sm_set_assoc_wpa_ie(wpa_s->wpa, NULL, 0);
+       if (elems.p2p &&
+           (wpa_s->drv_flags & WPA_DRIVER_FLAGS_P2P_CAPABLE))
+               params.p2p = 1;
 
        if (wpa_drv_associate(wpa_s, &params) < 0) {
                wpa_msg(wpa_s, MSG_INFO, "Association request to the driver "
index b69197e9a55bec8befbaeeaa7b47f732cd118b7f..b23e485f1dc84e357d017f9fc023f96c63fcc32f 100644 (file)
@@ -1244,6 +1244,12 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
        }
 #endif /* CONFIG_IEEE80211W */
 
+#ifdef CONFIG_P2P
+       if (wpa_s->global->p2p &&
+           (wpa_s->drv_flags & WPA_DRIVER_FLAGS_P2P_CAPABLE))
+               params.p2p = 1;
+#endif /* CONFIG_P2P */
+
        if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_USER_SPACE_MLME)
                ret = ieee80211_sta_associate(wpa_s, &params);
        else