[PATCH 16/16] P2P: Don't switch channel during group formation

Ilan Peer ilan.peer
Wed Jun 17 06:25:02 PDT 2015


From: Avraham Stern <avraham.stern at intel.com>

On 40Mhz channels, primary and secondary channels are sometimes
switched to get secondary channel with no beacons from other BSSes.
However, when starting a P2P GO after GoN, this may fail the group
formation since the client will search the GO on the original primary
channel.

Fix this by not switching the primary and secondary channel during
P2P group formation. This also fixes failures seen with hwsim test
"go_neg_forced_freq_diff_than_bss_freq".

Signed-off-by: Avraham Stern <avraham.stern at intel.com>
---
 src/ap/hw_features.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
index 7c08e52..740cf3a 100644
--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
@@ -260,8 +260,13 @@ static int ieee80211n_check_40mhz_5g(struct hostapd_iface *iface,
 
 	res = check_40mhz_5g(iface->current_mode, scan_res, pri_chan, sec_chan);
 
-	if (res == 2)
-		ieee80211n_switch_pri_sec(iface);
+	if (res == 2) {
+		if (!(iface->conf->bss[0]->p2p & P2P_GROUP_OWNER))
+			ieee80211n_switch_pri_sec(iface);
+		else
+			wpa_printf(MSG_INFO,
+				   "Don't switch primary and secondary channel during P2P group formation");
+	}
 
 	return !!res;
 }
-- 
1.9.1




More information about the Hostap mailing list