diff mbox

[17/24] P2P: Add all channels to GoN response

Message ID 1400483181-10284-18-git-send-email-ilan.peer@intel.com
State Changes Requested
Headers show

Commit Message

Peer, Ilan May 19, 2014, 7:06 a.m. UTC
The P2P specification states that in case the P2P Device
is to become a P2P Client it can set the channels in the
channel list attribute independently from the channel list
attribute in the GoN request.

Add all the P2P Device supported channels to the GoN response,
as this can be useful for cases that the allowed channels of the
peer P2P Device change, and the GO can now operate in additional
channels.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
---
 src/p2p/p2p_go_neg.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/src/p2p/p2p_go_neg.c b/src/p2p/p2p_go_neg.c
index ac93902..b756a86 100644
--- a/src/p2p/p2p_go_neg.c
+++ b/src/p2p/p2p_go_neg.c
@@ -306,8 +306,19 @@  static struct wpabuf * p2p_build_go_neg_resp(struct p2p_data *p2p,
 		p2p_buf_add_channel_list(buf, p2p->cfg->country,
 					 &p2p->channels);
 	} else if (peer->go_state == REMOTE_GO) {
+		struct p2p_channels res;
+
+		p2p_channels_union(&p2p->cfg->channels,
+				   &p2p->cfg->cli_channels,
+				   &res);
+
+		if (p2p_is_indoor_device(&peer->info))
+			p2p_channels_union(&res,
+					   &p2p->cfg->indoor_channels,
+					   &res);
+
 		p2p_buf_add_channel_list(buf, p2p->cfg->country,
-					 &p2p->channels);
+					 &res);
 	} else {
 		struct p2p_channels res;
 		p2p_channels_intersect(&p2p->channels, &peer->channels,