P2P: Extend P2P manager functionality to work with driver MLME
[libeap.git] / src / ap / beacon.c
index 37cd96e..17cb541 100644 (file)
@@ -30,6 +30,7 @@
 #include "wmm.h"
 #include "ap_config.h"
 #include "sta_info.h"
+#include "p2p_hostapd.h"
 #include "beacon.h"
 
 
@@ -368,6 +369,11 @@ void handle_probe_req(struct hostapd_data *hapd,
                pos += wpabuf_len(hapd->p2p_probe_resp_ie);
        }
 #endif /* CONFIG_P2P */
+#ifdef CONFIG_P2P_MANAGER
+       if ((hapd->conf->p2p & (P2P_MANAGE | P2P_ENABLED | P2P_GROUP_OWNER)) ==
+           P2P_MANAGE)
+               pos = hostapd_eid_p2p_manage(hapd, pos);
+#endif /* CONFIG_P2P_MANAGER */
 
        if (hapd->drv.send_mgmt_frame(hapd, resp, pos - (u8 *) resp) < 0)
                perror("handle_probe_req: send");
@@ -487,6 +493,11 @@ void ieee802_11_set_beacon(struct hostapd_data *hapd)
                tailpos += wpabuf_len(hapd->p2p_beacon_ie);
        }
 #endif /* CONFIG_P2P */
+#ifdef CONFIG_P2P_MANAGER
+       if ((hapd->conf->p2p & (P2P_MANAGE | P2P_ENABLED | P2P_GROUP_OWNER)) ==
+           P2P_MANAGE)
+               tailpos = hostapd_eid_p2p_manage(hapd, tailpos);
+#endif /* CONFIG_P2P_MANAGER */
 
        tail_len = tailpos > tail ? tailpos - tail : 0;