From: Dmitry Shmidt Date: Tue, 10 Sep 2013 17:52:57 +0000 (-0700) Subject: Android: P2P: Fix frequency choice if multichannel supported X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71c692ee0dec4d593ecb6bee36ceaef9b1dbbd05;p=thirdparty%2Fhostap.git Android: P2P: Fix frequency choice if multichannel supported Bug: 10513949 Change-Id: Id9e5b2560630049a6ca5f74e3785d4a2c2be3124 Signed-off-by: Dmitry Shmidt --- diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 71790805f..d7b31896d 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -4018,13 +4018,21 @@ static int wpas_p2p_setup_freqs(struct wpa_supplicant *wpa_s, int freq, if (!p2p_supported_freq(wpa_s->global->p2p, freqs[i])) continue; +#ifndef ANDROID_P2P wpa_printf(MSG_DEBUG, "P2P: Try to force us to use frequency (%u MHz) which is already in use", *force_freq); *force_freq = freqs[i]; +#endif if (*pref_freq == 0 && num < wpa_s->num_multichan_concurrent) { wpa_printf(MSG_DEBUG, "P2P: Try to prefer a frequency we are already using"); - *pref_freq = *force_freq; + *pref_freq = freqs[i]; +#ifdef ANDROID_P2P + } else { + wpa_printf(MSG_DEBUG, "P2P: Try to force us to use frequency (%u MHz) which is already in use", + *force_freq); + *force_freq = freqs[i]; +#endif } break; }