aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorRashmi Ramanna <c_ramanr@qti.qualcomm.com>2014-01-20 20:55:09 (GMT)
committerJouni Malinen <j@w1.fi>2014-01-20 20:55:09 (GMT)
commita2d63657603b8f0714274f34bea45cb5d0c0a7b9 (patch)
tree0df642c134a039a05901ac69b307ccab00828b27 /wpa_supplicant
parent99fa65bc2819f3f5b47a8c67b1a5a8ae23adbde7 (diff)
downloadhostap-a2d63657603b8f0714274f34bea45cb5d0c0a7b9.zip
hostap-a2d63657603b8f0714274f34bea45cb5d0c0a7b9.tar.gz
hostap-a2d63657603b8f0714274f34bea45cb5d0c0a7b9.tar.bz2
P2P: Extend the listen time based on the active concurrent session
A P2P Device while in the Listen state waiting to respond for the obtained group negotiation request shall give a fair chance for other concurrent sessions to use the shared radio by inducing an idle time between the successive listen states. However, if there are no concurrent operations, this idle time can be reduced. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/p2p_supplicant.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 91ed508..5ef7614 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -3571,6 +3571,21 @@ static int wpas_go_connected(void *ctx, const u8 *dev_addr)
}
+static int wpas_is_concurrent_session_active(void *ctx)
+{
+ struct wpa_supplicant *wpa_s = ctx;
+ struct wpa_supplicant *ifs;
+
+ for (ifs = wpa_s->global->ifaces; ifs; ifs = ifs->next) {
+ if (ifs == wpa_s)
+ continue;
+ if (ifs->wpa_state > WPA_ASSOCIATED)
+ return 1;
+ }
+ return 0;
+}
+
+
static void wpas_p2p_debug_print(void *ctx, int level, const char *msg)
{
struct wpa_supplicant *wpa_s = ctx;
@@ -3685,6 +3700,7 @@ int wpas_p2p_init(struct wpa_global *global, struct wpa_supplicant *wpa_s)
p2p.get_noa = wpas_get_noa;
p2p.go_connected = wpas_go_connected;
p2p.presence_resp = wpas_presence_resp;
+ p2p.is_concurrent_session_active = wpas_is_concurrent_session_active;
os_memcpy(wpa_s->global->p2p_dev_addr, wpa_s->own_addr, ETH_ALEN);
os_memcpy(p2p.dev_addr, wpa_s->global->p2p_dev_addr, ETH_ALEN);