From 6e3f4b89ea43e5c1371191e645158e6a3f2de052 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 18 Jul 2010 14:30:25 -0700 Subject: [PATCH] P2P: Let the driver wrapper know if association is for P2P group --- wpa_supplicant/ap.c | 6 ++++++ wpa_supplicant/sme.c | 3 +++ wpa_supplicant/wpa_supplicant.c | 6 ++++++ 3 files changed, 15 insertions(+) diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c index 9e5d39071..30875423f 100644 --- a/wpa_supplicant/ap.c +++ b/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, ¶ms) < 0) { wpa_msg(wpa_s, MSG_INFO, "Failed to start AP functionality"); return -1; diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c index 5604e97cb..a11a896d0 100644 --- a/wpa_supplicant/sme.c +++ b/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, ¶ms) < 0) { wpa_msg(wpa_s, MSG_INFO, "Association request to the driver " diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index b69197e9a..b23e485f1 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/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, ¶ms); else