aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2019-02-17 14:53:03 (GMT)
committerJouni Malinen <j@w1.fi>2019-02-17 14:53:03 (GMT)
commit947b5a1532f95347d34f0dc79d602402975eca3d (patch)
tree384e74d2b071792085a83253bbae83c191222904 /wpa_supplicant
parentb3e8ca65a68394d0b06615b7bc54ffbe649d098c (diff)
downloadhostap-947b5a1532f95347d34f0dc79d602402975eca3d.zip
hostap-947b5a1532f95347d34f0dc79d602402975eca3d.tar.gz
hostap-947b5a1532f95347d34f0dc79d602402975eca3d.tar.bz2
P2P: Stop listen state if Action frame TX is needed on another channel
This speeds up P2P responses to frames received on an operating channel in case there is an ongoing P2P listen operation on another channel. This is applicable to drivers that support multiple channels in concurrently. This addresses an issue showing up in the p2ps_channel_active_go_and_station_different_mcc test case where the Provision Discovery Request frame can be received on the operating channel of a group instead of the Listen channel. The response was delayed until the listen operation timed out and this took too long time for the peer to receive the response. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/p2p_supplicant.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index e265128..18fd02c 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -1584,20 +1584,27 @@ static int wpas_send_action_work(struct wpa_supplicant *wpa_s,
static int wpas_send_action(void *ctx, unsigned int freq, const u8 *dst,
const u8 *src, const u8 *bssid, const u8 *buf,
- size_t len, unsigned int wait_time)
+ size_t len, unsigned int wait_time, int *scheduled)
{
struct wpa_supplicant *wpa_s = ctx;
int listen_freq = -1, send_freq = -1;
+ if (scheduled)
+ *scheduled = 0;
if (wpa_s->p2p_listen_work)
listen_freq = wpa_s->p2p_listen_work->freq;
if (wpa_s->p2p_send_action_work)
send_freq = wpa_s->p2p_send_action_work->freq;
if (listen_freq != (int) freq && send_freq != (int) freq) {
- wpa_printf(MSG_DEBUG, "P2P: Schedule new radio work for Action frame TX (listen_freq=%d send_freq=%d)",
- listen_freq, send_freq);
- return wpas_send_action_work(wpa_s, freq, dst, src, bssid, buf,
- len, wait_time);
+ int res;
+
+ wpa_printf(MSG_DEBUG, "P2P: Schedule new radio work for Action frame TX (listen_freq=%d send_freq=%d freq=%u)",
+ listen_freq, send_freq, freq);
+ res = wpas_send_action_work(wpa_s, freq, dst, src, bssid, buf,
+ len, wait_time);
+ if (res == 0 && scheduled)
+ *scheduled = 1;
+ return res;
}
wpa_printf(MSG_DEBUG, "P2P: Use ongoing radio work for Action frame TX");