[PATCH v2 02/10] wpa_supplicant: add P2P device driver priv
David Spinadel
dvdspndl
Sun Mar 17 13:57:12 PDT 2013
From: David Spinadel <david.spinadel at intel.com>
Add driver priv for P2P device in wpa_supplicant structure.
Add P2P dedicated wrappers for the driver API, and use p2p_drv_priv
instead of drv_priv.
Signed-off-by: David Spinadel <david.spinadel at intel.com>
---
wpa_supplicant/driver_i.h | 64 +++++++++++++++++++++++++++++++++++++
wpa_supplicant/wpa_supplicant_i.h | 1 +
2 files changed, 65 insertions(+)
diff --git a/wpa_supplicant/driver_i.h b/wpa_supplicant/driver_i.h
index 847600d..29113ff 100644
--- a/wpa_supplicant/driver_i.h
+++ b/wpa_supplicant/driver_i.h
@@ -689,4 +689,68 @@ static inline int wpa_drv_wnm_oper(struct wpa_supplicant *wpa_s,
buf_len);
}
+static inline void *wpa_p2p_get_priv(struct wpa_supplicant *wpa_s)
+{
+ return wpa_s->p2p_drv_priv ? wpa_s->p2p_drv_priv : wpa_s->drv_priv;
+}
+
+static inline int wpa_drv_p2p_scan(struct wpa_supplicant *wpa_s,
+ struct wpa_driver_scan_params *params)
+{
+ if (wpa_s->driver->scan2)
+ return wpa_s->driver->scan2(wpa_p2p_get_priv(wpa_s), params);
+ return -1;
+}
+
+static inline int wpa_drv_p2p_send_mlme(struct wpa_supplicant *wpa_s,
+ const u8 *data, size_t data_len,
+ int noack)
+{
+ if (wpa_s->driver->send_mlme)
+ return wpa_s->driver->send_mlme(wpa_p2p_get_priv(wpa_s), data,
+ data_len, noack);
+ return -1;
+}
+
+static inline int wpa_drv_p2p_send_action(struct wpa_supplicant *wpa_s,
+ unsigned int freq,
+ unsigned int wait,
+ const u8 *dst, const u8 *src,
+ const u8 *bssid,
+ const u8 *data, size_t data_len,
+ int no_cck)
+{
+ if (wpa_s->driver->send_action)
+ return wpa_s->driver->send_action(wpa_p2p_get_priv(wpa_s), freq,
+ wait, dst, src, bssid,
+ data, data_len, no_cck);
+ return -1;
+}
+
+static inline void
+wpa_drv_p2p_send_action_cancel_wait(struct wpa_supplicant *wpa_s)
+{
+ if (wpa_s->driver->send_action_cancel_wait)
+ wpa_s->driver->send_action_cancel_wait(wpa_p2p_get_priv(wpa_s));
+}
+
+static inline int wpa_drv_p2p_remain_on_channel(struct wpa_supplicant *wpa_s,
+ unsigned int freq,
+ unsigned int duration)
+{
+ if (wpa_s->driver->remain_on_channel)
+ return wpa_s->driver->remain_on_channel(wpa_p2p_get_priv(wpa_s),
+ freq, duration);
+ return -1;
+}
+
+static inline int
+wpa_drv_p2p_cancel_remain_on_channel(struct wpa_supplicant *wpa_s)
+{
+ if (wpa_s->driver->cancel_remain_on_channel)
+ return wpa_s->driver->cancel_remain_on_channel(
+ wpa_p2p_get_priv(wpa_s));
+ return -1;
+}
+
#endif /* DRIVER_I_H */
diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h
index 5465c4f..4fb6bb2 100644
--- a/wpa_supplicant/wpa_supplicant_i.h
+++ b/wpa_supplicant/wpa_supplicant_i.h
@@ -330,6 +330,7 @@ struct wpa_supplicant {
void *drv_priv; /* private data used by driver_ops */
void *global_drv_priv;
+ void *p2p_drv_priv; /* private data used by driver_ops for p2p device */
u8 *bssid_filter;
size_t bssid_filter_count;
--
1.7.10.msysgit.1
More information about the Hostap
mailing list