Browse Source

P2P: Make group operating channel available

Provide local GO channel to the P2P module so that it can be used in
messages that indicate the current operating channel.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Jouni Malinen 12 years ago
parent
commit
ea43ad960b
4 changed files with 13 additions and 0 deletions
  1. 5 0
      src/p2p/p2p.h
  2. 6 0
      src/p2p/p2p_group.c
  3. 1 0
      src/p2p/p2p_i.h
  4. 1 0
      wpa_supplicant/p2p_supplicant.c

+ 5 - 0
src/p2p/p2p.h

@@ -1371,6 +1371,11 @@ struct p2p_group_config {
 	 */
 	size_t ssid_len;
 
+	/**
+	 * freq - Operating channel of the group
+	 */
+	int freq;
+
 	/**
 	 * cb_ctx - Context to use with callback functions
 	 */

+ 6 - 0
src/p2p/p2p_group.c

@@ -999,3 +999,9 @@ void p2p_group_force_beacon_update_ies(struct p2p_group *group)
 	group->beacon_update = 1;
 	p2p_group_update_ies(group);
 }
+
+
+int p2p_group_get_freq(struct p2p_group *group)
+{
+	return group->cfg->freq;
+}

+ 1 - 0
src/p2p/p2p_i.h

@@ -604,6 +604,7 @@ void p2p_group_force_beacon_update_ies(struct p2p_group *group);
 struct wpabuf * p2p_group_get_wfd_ie(struct p2p_group *g);
 void p2p_buf_add_group_info(struct p2p_group *group, struct wpabuf *buf,
 			    int max_clients);
+int p2p_group_get_freq(struct p2p_group *group);
 
 
 void p2p_buf_add_action_hdr(struct wpabuf *buf, u8 subtype, u8 dialog_token);

+ 1 - 0
wpa_supplicant/p2p_supplicant.c

@@ -5235,6 +5235,7 @@ struct p2p_group * wpas_p2p_group_init(struct wpa_supplicant *wpa_s,
 		cfg->max_clients = wpa_s->conf->max_num_sta;
 	os_memcpy(cfg->ssid, ssid->ssid, ssid->ssid_len);
 	cfg->ssid_len = ssid->ssid_len;
+	cfg->freq = ssid->frequency;
 	cfg->cb_ctx = wpa_s;
 	cfg->ie_update = wpas_p2p_ie_update;
 	cfg->idle_update = wpas_p2p_idle_update;