diff options
author | Jeff Johnson <jjohnson@codeaurora.org> | 2012-10-07 19:34:24 -0700 |
---|---|---|
committer | Irfan Sheriff <isheriff@google.com> | 2012-10-17 13:51:03 -0700 |
commit | 12b1cd9e151d1e5c4d35aa38531f38b4ef5cc805 (patch) | |
tree | c7b05d643cc92c3d95324a02a256f28ab8c5c88c | |
parent | 81931b8bb302c38828763358f9e15af2b22c52c6 (diff) | |
download | external_wpa_supplicant_8-12b1cd9e151d1e5c4d35aa38531f38b4ef5cc805.zip external_wpa_supplicant_8-12b1cd9e151d1e5c4d35aa38531f38b4ef5cc805.tar.gz external_wpa_supplicant_8-12b1cd9e151d1e5c4d35aa38531f38b4ef5cc805.tar.bz2 |
Support conc_pref when use_p2p_group_interface=0
The original implementation of wpas_p2p_handle_frequency_conflicts()
only works correctly when P2P groups use a separate interface
(i.e. use_p2p_group_interface=1). Update the implementation so
that it also works when the device interfaces is used
(i.e. use_p2p_group_interface=0).
Bug: 7290509
Change-Id: Icbc489125c5b7bd6e174d6aecd53555cdc9ad99d
-rw-r--r-- | wpa_supplicant/p2p_supplicant.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index f97d2fa..e6b0128 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -5444,32 +5444,35 @@ int wpas_p2p_handle_frequency_conflicts(struct wpa_supplicant *wpa_s, int freq) struct p2p_data *p2p = wpa_s->global->p2p; for (iface = wpa_s->global->ifaces; iface; iface = iface->next) { - if((iface->p2p_group_interface) && (iface->current_ssid) && - (iface->current_ssid->frequency != freq)) { - - if (iface->p2p_group_interface == P2P_GROUP_INTERFACE_GO) { - /* Try to see whether we can move the GO. If it - * is not possible, remove the GO interface - */ - if(wpa_drv_switch_channel(iface, freq) == 0) { - wpa_printf(MSG_ERROR, "P2P: GO Moved to freq(%d)", freq); - iface->current_ssid->frequency = freq; - continue; - } + if ((iface->current_ssid) && + (iface->current_ssid->frequency != freq) && + ((iface->p2p_group_interface) || + (iface->current_ssid->p2p_group))) { + + if ((iface->p2p_group_interface == P2P_GROUP_INTERFACE_GO) || + (iface->current_ssid->mode == WPAS_MODE_P2P_GO)) { + /* Try to see whether we can move the GO. If it + * is not possible, remove the GO interface + */ + if (wpa_drv_switch_channel(iface, freq) == 0) { + wpa_printf(MSG_ERROR, "P2P: GO Moved to freq(%d)", freq); + iface->current_ssid->frequency = freq; + continue; + } } /* If GO cannot be moved or if the conflicting interface is a * P2P Client, remove the interface depending up on the connection * priority */ - if(!wpas_is_p2p_prioritized(wpa_s)) { + if (!wpas_is_p2p_prioritized(wpa_s)) { /* STA connection has priority over existing * P2P connection. So remove the interface */ - wpa_printf(MSG_DEBUG, "P2P: Removing P2P connection due to Single channel" + wpa_printf(MSG_DEBUG, "P2P: Removing P2P connection due to Single channel " "concurrent mode frequency conflict"); wpas_p2p_group_delete(iface, P2P_GROUP_REMOVAL_FREQ_CONFLICT); } else { /* Existing connection has the priority. Disable the newly - * selected network and let the application know about it. + * selected network and let the application know about it. */ return -1; } |