@@ -2625,6 +2625,23 @@ struct wpa_driver_ops {
* avoid frequency conflict in single channel concurrency.
*/
int (*switch_channel)(void *priv, unsigned int freq);
+
+ /**
+ * init_p2p_dev - Initialize P2P device interface
+ * @priv: Private driver data of the already existing interface
+ * @ifname: interface name, e.g., p2p-wlan0, mainly for debugging
+ * Returns: Pointer to private data of P2P device, %NULL on failure
+ *
+ * NULL is returned also if P2P device interface is not supported by the
+ * HW.
+ */
+ void * (*init_p2p_dev)(void *priv, const char *ifname, u8 *addr);
+
+ /**
+ * deinit_p2p_dev - Deinitialize P2P device interface
+ * @priv: private data of the P2P device interface
+ */
+ void (*deinit_p2p_dev)(void *priv);
};
@@ -753,4 +753,18 @@ wpa_drv_p2p_cancel_remain_on_channel(struct wpa_supplicant *wpa_s)
return -1;
}
+static inline void *wpa_drv_init_p2p_dev(struct wpa_supplicant *wpa_s,
+ const char *ifname, u8 *addr)
+{
+ if (!wpa_s->driver->init_p2p_dev)
+ return NULL;
+ return wpa_s->driver->init_p2p_dev(wpa_s->drv_priv, ifname, addr);
+}
+
+static inline void wpa_drv_deinit_p2p_dev(struct wpa_supplicant *wpa_s)
+{
+ if (wpa_s->driver->deinit_p2p_dev)
+ wpa_s->driver->deinit_p2p_dev(wpa_s->p2p_drv_priv);
+}
+
#endif /* DRIVER_I_H */