aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/offchannel.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2012-12-22 09:22:12 (GMT)
committerJouni Malinen <j@w1.fi>2012-12-22 09:22:12 (GMT)
commit2f3101d8df9a6044d7af428b1bc2936cbec3195e (patch)
tree51c8c246b6bf2f5f0cd3d3b8decf6553cc327c4d /wpa_supplicant/offchannel.c
parentb4419c62ad267c813a7d81389417bb75113d5bbf (diff)
downloadhostap-2f3101d8df9a6044d7af428b1bc2936cbec3195e.zip
hostap-2f3101d8df9a6044d7af428b1bc2936cbec3195e.tar.gz
hostap-2f3101d8df9a6044d7af428b1bc2936cbec3195e.tar.bz2
Move some P2P offchannel operations to offchannel.c
There is no need for p2p_supplicant.c to access wpa_s->pending_action_tx so move these references to offchannel.c to get a bit cleaner interface between the components. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/offchannel.c')
-rw-r--r--wpa_supplicant/offchannel.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/wpa_supplicant/offchannel.c b/wpa_supplicant/offchannel.c
index 7ec7656..856eca7 100644
--- a/wpa_supplicant/offchannel.c
+++ b/wpa_supplicant/offchannel.c
@@ -357,6 +357,33 @@ void offchannel_cancel_remain_on_channel_cb(struct wpa_supplicant *wpa_s,
/**
+ * offchannel_pending_action_tx - Check whether there is a pending Action TX
+ * @wpa_s: Pointer to wpa_supplicant data
+ * Returns: Pointer to pending frame or %NULL if no pending operation
+ *
+ * This function can be used to check whether there is a pending Action frame TX
+ * operation. The returned pointer should be used only for checking whether it
+ * is %NULL (no pending frame) or to print the pointer value in debug
+ * information (i.e., the pointer should not be dereferenced).
+ */
+const void * offchannel_pending_action_tx(struct wpa_supplicant *wpa_s)
+{
+ return wpa_s->pending_action_tx;
+}
+
+
+/**
+ * offchannel_clear_pending_action_tx - Clear pending Action frame TX
+ * @wpa_s: Pointer to wpa_supplicant data
+ */
+void offchannel_clear_pending_action_tx(struct wpa_supplicant *wpa_s)
+{
+ wpabuf_free(wpa_s->pending_action_tx);
+ wpa_s->pending_action_tx = NULL;
+}
+
+
+/**
* offchannel_deinit - Deinit off-channel operations
* @wpa_s: Pointer to wpa_supplicant data
*
@@ -365,7 +392,6 @@ void offchannel_cancel_remain_on_channel_cb(struct wpa_supplicant *wpa_s,
*/
void offchannel_deinit(struct wpa_supplicant *wpa_s)
{
- wpabuf_free(wpa_s->pending_action_tx);
- wpa_s->pending_action_tx = NULL;
+ offchannel_clear_pending_action_tx(wpa_s);
eloop_cancel_timeout(wpas_send_action_cb, wpa_s, NULL);
}