P2P: Allow shared interface channel preference to be ignored
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 14 Mar 2013 14:32:35 +0000 (16:32 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 14 Mar 2013 14:32:35 +0000 (16:32 +0200)
p2p_ignore_shared_freq=1 in the configuration file (or "SET
p2p_ignore_shared_freq 1" on control interface) can now be used to
configure wpa_supplicant to ignore the preference on shared operating
channel when the driver support multi-channel concurrency. The default
behavior is to try to start any new P2P group on an operating channel
that is already in use on another virtual interface to avoid extra cost
from hopping between multiple channels. If this new parameter is set to
1, such preference is not used and instead, the channel for the new P2P
group is selected based on other preferences while ignoring operating
channels of any concurrent connection.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

wpa_supplicant/config.c
wpa_supplicant/config.h
wpa_supplicant/p2p_supplicant.c

index 6860765..1ffe05e 100644 (file)
@@ -3019,6 +3019,7 @@ static const struct global_parse_data global_fields[] = {
        { INT(p2p_go_ht40), 0 },
        { INT(p2p_disabled), 0 },
        { INT(p2p_no_group_iface), 0 },
+       { INT_RANGE(p2p_ignore_shared_freq, 0, 1), 0 },
 #endif /* CONFIG_P2P */
        { FUNC(country), CFG_CHANGED_COUNTRY },
        { INT(bss_max_count), 0 },
index 2e3e76b..03fe6fc 100644 (file)
@@ -571,6 +571,7 @@ struct wpa_config {
        int p2p_intra_bss;
        unsigned int num_p2p_pref_chan;
        struct p2p_channel *p2p_pref_chan;
+       int p2p_ignore_shared_freq;
 
        struct wpabuf *wps_vendor_ext_m1;
 
index 3a06406..afc0dfb 100644 (file)
@@ -98,6 +98,10 @@ static void wpas_p2p_set_own_freq_preference(struct wpa_supplicant *wpa_s,
 {
        if (wpa_s->global->p2p_disabled || wpa_s->global->p2p == NULL)
                return;
+       if (freq > 0 &&
+           (wpa_s->drv_flags & WPA_DRIVER_FLAGS_MULTI_CHANNEL_CONCURRENT) &&
+           wpa_s->parent->conf->p2p_ignore_shared_freq)
+               freq = 0;
        p2p_set_own_freq_preference(wpa_s->global->p2p, freq);
 }