Parcourir la source

P2P: Let the driver wrapper know if association is for P2P group

Jouni Malinen il y a 14 ans
Parent
commit
6e3f4b89ea
3 fichiers modifiés avec 15 ajouts et 0 suppressions
  1. 6 0
      wpa_supplicant/ap.c
  2. 3 0
      wpa_supplicant/sme.c
  3. 6 0
      wpa_supplicant/wpa_supplicant.c

+ 6 - 0
wpa_supplicant/ap.c

@@ -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;

+ 3 - 0
wpa_supplicant/sme.c

@@ -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 "

+ 6 - 0
wpa_supplicant/wpa_supplicant.c

@@ -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