Accumulative patch from commit 77e4e85321a0a1255901914d5de916aba050f9e1

P2P: Mark peer authorized for persistent group invitation
P2P: Indicate frequency for upper layer invitation processing
Allow wpa_supplicant AP mode to configure Beacon interval
P2P: Use peer's channel list to limit GO freq on invitation
P2P: Allow P2P client to specify preferred group channel
P2P: Use shared function for setting up frequencies
P2P: Allow all channels in case of multi channel concurrency
hostapd: Make VHT IE struct more expressive

Change-Id: I6d86d98a10a1a699bb464c5b916ebf21f626558b
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index ea6395e..dec002f 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -3988,7 +3988,7 @@
 	int id;
 	struct wpa_ssid *ssid;
 	u8 *_peer = NULL, peer[ETH_ALEN];
-	int freq = 0;
+	int freq = 0, pref_freq = 0;
 	int ht40;
 
 	id = atoi(cmd);
@@ -4015,9 +4015,17 @@
 			return -1;
 	}
 
+	pos = os_strstr(cmd, " pref=");
+	if (pos) {
+		pos += 6;
+		pref_freq = atoi(pos);
+		if (pref_freq <= 0)
+			return -1;
+	}
+
 	ht40 = (os_strstr(cmd, " ht40") != NULL) || wpa_s->conf->p2p_go_ht40;
 
-	return wpas_p2p_invite(wpa_s, _peer, ssid, NULL, freq, ht40);
+	return wpas_p2p_invite(wpa_s, _peer, ssid, NULL, freq, ht40, pref_freq);
 }
 
 
@@ -4078,7 +4086,7 @@
 		return -1;
 	}
 
-	return wpas_p2p_group_add_persistent(wpa_s, ssid, 0, freq, ht40);
+	return wpas_p2p_group_add_persistent(wpa_s, ssid, 0, freq, ht40, NULL);
 }