diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index a5a04e377..3148aeb3d 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -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 */ +} diff --git a/src/p2p/p2p.h b/src/p2p/p2p.h index 0bc2e606f..24b0677e7 100644 --- a/src/p2p/p2p.h +++ b/src/p2p/p2p.h @@ -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 */