diff options
author | Eyal Shapira <eyal@wizery.com> | 2012-09-25 10:54:09 +0200 |
---|---|---|
committer | Eyal Shapira <eyal@wizery.com> | 2012-09-30 12:03:48 +0200 |
commit | a9c73cbf768e920f4adc9573577efbcbe39ed721 (patch) | |
tree | 64c307f2e80b92a2adc3fef1a07ea46ea0a44742 | |
parent | 67bd4fc9ab47f1300edd8696c36b9773c91e6b30 (diff) | |
download | external_wpa_supplicant_8_ti-a9c73cbf768e920f4adc9573577efbcbe39ed721.zip external_wpa_supplicant_8_ti-a9c73cbf768e920f4adc9573577efbcbe39ed721.tar.gz external_wpa_supplicant_8_ti-a9c73cbf768e920f4adc9573577efbcbe39ed721.tar.bz2 |
P2P: block find if P2P GO or CLI are active (INTERNAL)
The roc on a channel for 100+ ms which is part of the find
disturbs the P2P GO/CLI as these scenarios are unsupported
in non multi channel driver.
Therefore block the find in this case.
Signed-off-by: Eyal Shapira <eyal@wizery.com>
-rw-r--r-- | wpa_supplicant/p2p_supplicant.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 6603091..3c650c3 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -3969,6 +3969,18 @@ static void wpas_p2p_clear_pending_action_tx(struct wpa_supplicant *wpa_s) wpa_s->pending_action_tx = NULL; } +static int wpas_p2p_connected(struct wpa_supplicant *wpa_s) +{ + struct wpa_supplicant *iface; + + for (iface = wpa_s->global->ifaces; iface; iface = iface->next) { + if (iface->p2p_group_interface == P2P_GROUP_INTERFACE_GO || + iface->p2p_group_interface == P2P_GROUP_INTERFACE_CLIENT) + return 1; + } + + return 0; +} int wpas_p2p_find(struct wpa_supplicant *wpa_s, unsigned int timeout, enum p2p_discovery_type type, @@ -3985,6 +3997,14 @@ int wpas_p2p_find(struct wpa_supplicant *wpa_s, unsigned int timeout, wpa_s->p2p_in_provisioning) return -1; + + if (!(wpa_s->drv_flags & + WPA_DRIVER_FLAGS_MULTI_CHANNEL_CONCURRENT) && + wpas_p2p_connected(wpa_s)) { + wpa_printf(MSG_DEBUG, "P2P: find blocked due to active GO/CLI"); + return -1; + } + wpa_supplicant_cancel_sched_scan(wpa_s); return p2p_find(wpa_s->global->p2p, timeout, type, |