aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Kholaif <akholaif@qca.qualcomm.com>2015-08-10 00:44:12 +0000
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2016-04-01 16:48:22 +0530
commitba8401dcf1fa5e6397fd551bc6b9e4a4798d9a40 (patch)
treedbc1f0b659cb2f5321a1799545d474a4023320ec
parente71f6421063579aa56e3d04efaaec820538df88b (diff)
downloadandroid_external_wpa_supplicant_8-ba8401dcf1fa5e6397fd551bc6b9e4a4798d9a40.tar.gz
android_external_wpa_supplicant_8-ba8401dcf1fa5e6397fd551bc6b9e4a4798d9a40.tar.bz2
android_external_wpa_supplicant_8-ba8401dcf1fa5e6397fd551bc6b9e4a4798d9a40.zip
P2P: Support driver preferred freq list for Autonomous GO case
When starting an autonomous GO without specifying the operating channel, query the driver for the preferred frequency list, and use it to select the operating channel of the GO (if supported). Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Git-commit: 8e84921efe652233703588852bc43c36ccb241df Git-repo: git://w1.fi/srv/git/hostap.git Change-Id: If62620b7d903dad077811b619940e349104d1412 CRs-fixed: 887890
-rw-r--r--wpa_supplicant/p2p_supplicant.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 6d8b63c2..51e1324d 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -5162,6 +5162,38 @@ static int wpas_p2p_select_go_freq(struct wpa_supplicant *wpa_s, int freq)
{
unsigned int r;
+ if (!wpa_s->conf->num_p2p_pref_chan && !freq) {
+ unsigned int i, size = P2P_MAX_PREF_CHANNELS;
+ unsigned int pref_freq_list[P2P_MAX_PREF_CHANNELS];
+ int res;
+
+ res = wpa_drv_get_pref_freq_list(wpa_s, WPA_IF_P2P_GO,
+ &size, pref_freq_list);
+ if (!res && size > 0) {
+ i = 0;
+ while (wpas_p2p_disallowed_freq(wpa_s->global,
+ pref_freq_list[i]) &&
+ i < size) {
+ wpa_printf(MSG_DEBUG,
+ "P2P: preferred_freq_list[%d]=%d is disallowed",
+ i, pref_freq_list[i]);
+ i++;
+ }
+ if (i != size) {
+ freq = pref_freq_list[i];
+ wpa_printf(MSG_DEBUG,
+ "P2P: Using preferred_freq_list[%d]=%d",
+ i, freq);
+ } else {
+ wpa_printf(MSG_DEBUG,
+ "P2P: All driver preferred frequencies are disallowed for P2P use");
+ }
+ } else {
+ wpa_printf(MSG_DEBUG,
+ "P2P: No preferred frequency list available");
+ }
+ }
+
if (freq == 2) {
wpa_printf(MSG_DEBUG, "P2P: Request to start GO on 2.4 GHz "
"band");