]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
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 68607654b444d2d60fcf516432a301bb6b02dabb..1ffe05eb9b9435fee7a9f438611b507d986bf181 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 2e3e76bb6f682c790b80993db5f0c4b5a94aa494..03fe6fc70d69fbe6f57523587b753b9a406320aa 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 3a06406e9fd7de6320effc5572d1863ab18d9f51..afc0dfb5c28e3cb47980d199c52daed205691682 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);
 }