aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/main.c
diff options
context:
space:
mode:
authorArend van Spriel <arend@broadcom.com>2013-06-30 07:17:47 (GMT)
committerJouni Malinen <j@w1.fi>2013-06-30 07:50:14 (GMT)
commitc68f6200a72f2b33304f583859b09e57757b9d2a (patch)
treebc33281faf4a1fcefe0c513b6d65c8b609c95d8b /wpa_supplicant/main.c
parent851b0c5581069de6db01ddca7c150b76cee415a2 (diff)
downloadhostap-c68f6200a72f2b33304f583859b09e57757b9d2a.zip
hostap-c68f6200a72f2b33304f583859b09e57757b9d2a.tar.gz
hostap-c68f6200a72f2b33304f583859b09e57757b9d2a.tar.bz2
P2P: Create P2P Device interface if supported
If the capability flag of the driver indicates a dedicated P2P Device is supported, a P2P Device interface is created. Create the P2P Device in main interface creation loop when the added interface flags support and P2P supplicant is not yet initialized avoiding recursion of add_interface. Do not register l2_packet for P2P Device interface (both for EAPOL and for TDLS). Signed-hostap: Arend van Spriel <arend@broadcom.com>
Diffstat (limited to 'wpa_supplicant/main.c')
-rw-r--r--wpa_supplicant/main.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/wpa_supplicant/main.c b/wpa_supplicant/main.c
index 1b3364c..d495ec1 100644
--- a/wpa_supplicant/main.c
+++ b/wpa_supplicant/main.c
@@ -14,6 +14,7 @@
#include "common.h"
#include "wpa_supplicant_i.h"
#include "driver_i.h"
+#include "p2p_supplicant.h"
extern struct wpa_driver_ops *wpa_drivers[];
@@ -289,6 +290,8 @@ int main(int argc, char *argv[])
}
for (i = 0; exitcode == 0 && i < iface_count; i++) {
+ struct wpa_supplicant *wpa_s;
+
if ((ifaces[i].confname == NULL &&
ifaces[i].ctrl_interface == NULL) ||
ifaces[i].ifname == NULL) {
@@ -299,7 +302,15 @@ int main(int argc, char *argv[])
exitcode = -1;
break;
}
- if (wpa_supplicant_add_iface(global, &ifaces[i]) == NULL)
+ wpa_s = wpa_supplicant_add_iface(global, &ifaces[i]);
+ if (wpa_s == NULL) {
+ exitcode = -1;
+ break;
+ }
+ if (wpa_s->global->p2p == NULL &&
+ (wpa_s->drv_flags &
+ WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE) &&
+ wpas_p2p_add_p2pdev_interface(wpa_s) < 0)
exitcode = -1;
}