diff options
| author | Sunil Dutt <usdutt@qti.qualcomm.com> | 2014-05-06 22:04:37 +0530 |
|---|---|---|
| committer | Arne Coucheron <arco68@gmail.com> | 2014-09-09 22:18:07 +0000 |
| commit | e0a8146744cd0f4a55d0f95d961c8e2bd9dbaf09 (patch) | |
| tree | 5c9ca6722c43a1a74fe269fec95b72c2dcc2f303 | |
| parent | f03962eeeb507b0466706c7f0f60a8d397579359 (diff) | |
| download | android_external_wpa_supplicant_8-e0a8146744cd0f4a55d0f95d961c8e2bd9dbaf09.tar.gz android_external_wpa_supplicant_8-e0a8146744cd0f4a55d0f95d961c8e2bd9dbaf09.tar.bz2 android_external_wpa_supplicant_8-e0a8146744cd0f4a55d0f95d961c8e2bd9dbaf09.zip | |
P2P: Refrain from performing extended listen during P2P connection.
Do not perform extended listen period operations when either a P2P
connection is in progress. This makes the connection more robust should
an extended listen timer trigger during such an operation.
CRs-Fixed: 661586
Git-commit: 0f1034e3889e7b8f54ed59317f1234db8167d12e
Git-repo : git://w1.fi/srv/git/hostap.git
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Change-Id: I1f51d34e956fa2d6529c15c6b6dcb6cea1b3de41
| -rw-r--r-- | src/p2p/p2p.c | 7 | ||||
| -rw-r--r-- | src/p2p/p2p.h | 8 | ||||
| -rw-r--r-- | wpa_supplicant/p2p_supplicant.c | 8 |
3 files changed, 23 insertions, 0 deletions
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index 3e5dc8c2..b0da1d13 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -3875,6 +3875,13 @@ static void p2p_ext_listen_timeout(void *eloop_ctx, void *timeout_ctx) p2p_ext_listen_timeout, p2p, NULL); } + if (p2p->cfg->is_p2p_in_progress && + p2p->cfg->is_p2p_in_progress(p2p->cfg->cb_ctx)) { + p2p_dbg(p2p, "Operation in progress - skip Extended Listen timeout (%s)", + p2p_state_txt(p2p->state)); + return; + } + if (p2p->state == P2P_LISTEN_ONLY && p2p->ext_listen_only) { /* * This should not really happen, but it looks like the Listen diff --git a/src/p2p/p2p.h b/src/p2p/p2p.h index 5e729fbd..4461ed65 100644 --- a/src/p2p/p2p.h +++ b/src/p2p/p2p.h @@ -773,6 +773,14 @@ struct p2p_config { * or 0 if not. */ int (*is_concurrent_session_active)(void *ctx); + + /** + * is_p2p_in_progress - Check whether P2P operation is in progress + * @ctx: Callback context from cb_ctx + * Returns: 1 if P2P operation (e.g., group formation) is in progress + * or 0 if not. + */ + int (*is_p2p_in_progress)(void *ctx); }; diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 9a4e42f9..e339d0e6 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -3304,6 +3304,13 @@ int wpas_p2p_add_p2pdev_interface(struct wpa_supplicant *wpa_s) } +static int _wpas_p2p_in_progress(void *ctx) +{ + struct wpa_supplicant *wpa_s = ctx; + return wpas_p2p_in_progress(wpa_s); +} + + /** * wpas_p2p_init - Initialize P2P module for %wpa_supplicant * @global: Pointer to global data from wpa_supplicant_init() @@ -3369,6 +3376,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.is_concurrent_session_active = wpas_is_concurrent_session_active; + p2p.is_p2p_in_progress = _wpas_p2p_in_progress; 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); |
