aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2013-03-14 14:32:35 (GMT)
committerJouni Malinen <j@w1.fi>2013-03-14 14:32:35 (GMT)
commitb277a2bebc9365ec7db444d51e34aab6d1b48e63 (patch)
tree2f6a28db68377d9b781d732405b3652ea561f717 /wpa_supplicant
parent6cb27aa85f6f71720404154233587b83cec7c5fe (diff)
downloadhostap-b277a2bebc9365ec7db444d51e34aab6d1b48e63.zip
hostap-b277a2bebc9365ec7db444d51e34aab6d1b48e63.tar.gz
hostap-b277a2bebc9365ec7db444d51e34aab6d1b48e63.tar.bz2
P2P: Allow shared interface channel preference to be ignored
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>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/config.c1
-rw-r--r--wpa_supplicant/config.h1
-rw-r--r--wpa_supplicant/p2p_supplicant.c4
3 files changed, 6 insertions, 0 deletions
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index 6860765..1ffe05e 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -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 },
diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h
index 2e3e76b..03fe6fc 100644
--- a/wpa_supplicant/config.h
+++ b/wpa_supplicant/config.h
@@ -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;
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 3a06406..afc0dfb 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -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);
}