]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Helper functions to check for WFD capability of a P2P device
authorSreeramya Soratkal <ssramya@codeaurora.org>
Tue, 4 May 2021 07:14:20 +0000 (12:44 +0530)
committerJouni Malinen <j@w1.fi>
Mon, 14 Jun 2021 17:24:37 +0000 (20:24 +0300)
P2P operation on the 6 GHz band is supported in the WFD use case.
Introduce helper functions to check for Wi-Fi Display capability of
the local device and a peer device.

Signed-off-by: Sreeramya Soratkal <ssramya@codeaurora.org>
src/p2p/p2p.c
src/p2p/p2p.h

index a5a04e3773af06315df224f12479c79e4b4f4304..3148aeb3da1fbeff46fceea628db1731e466a62e 100644 (file)
@@ -5605,3 +5605,26 @@ bool is_p2p_6ghz_capable(struct p2p_data *p2p)
 {
        return p2p->p2p_6ghz_capable;
 }
+
+
+bool p2p_wfd_enabled(struct p2p_data *p2p)
+{
+#ifdef CONFIG_WIFI_DISPLAY
+       return p2p->wfd_ie_probe_req != NULL;
+#else /* CONFIG_WIFI_DISPLAY */
+       return false;
+#endif /* CONFIG_WIFI_DISPLAY */
+}
+
+
+bool p2p_peer_wfd_enabled(struct p2p_data *p2p, const u8 *peer_addr)
+{
+#ifdef CONFIG_WIFI_DISPLAY
+       struct p2p_device *dev;
+
+       dev = p2p_get_device(p2p, peer_addr);
+       return dev && dev->info.wfd_subelems != NULL;
+#else /* CONFIG_WIFI_DISPLAY */
+       return false;
+#endif /* CONFIG_WIFI_DISPLAY */
+}
index 0bc2e606fa341b8ebeac9a85f4f0b49592d62b7e..24b0677e70efe6caded8d527388e6799525dda07 100644 (file)
@@ -2414,5 +2414,7 @@ struct wpabuf * p2p_build_probe_resp_template(struct p2p_data *p2p,
 void p2p_set_6ghz_dev_capab(struct p2p_data *p2p, bool allow_6ghz);
 bool is_p2p_6ghz_capable(struct p2p_data *p2p);
 bool p2p_is_peer_6ghz_capab(struct p2p_data *p2p, const u8 *addr);
+bool p2p_peer_wfd_enabled(struct p2p_data *p2p, const u8 *peer_addr);
+bool p2p_wfd_enabled(struct p2p_data *p2p);
 
 #endif /* P2P_H */