aboutsummaryrefslogtreecommitdiffstats
path: root/src/p2p
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2014-03-25 10:42:57 -0700
committerDmitry Shmidt <dimitrysh@google.com>2014-03-25 10:42:57 -0700
commit15907098d1f67c24bb000e593e279af173cf57d7 (patch)
treede52739eef3309a57db6782c16fa470769c3dd98 /src/p2p
parentd11f019d62a42a8fc4c4d1f2ec17cf35b0763153 (diff)
downloadandroid_external_wpa_supplicant_8-15907098d1f67c24bb000e593e279af173cf57d7.tar.gz
android_external_wpa_supplicant_8-15907098d1f67c24bb000e593e279af173cf57d7.tar.bz2
android_external_wpa_supplicant_8-15907098d1f67c24bb000e593e279af173cf57d7.zip
Cumulative patch from commit cf28c66bcb8883e6be921d6406a534e4a5b45b96
cf28c66 HS 2.0: Extend ANQP_GET to accept Hotspot 2.0 subtypes 163f801 nl80211: Indicate HS 2.0 OSEN AKM in connect/associate command c201f93 WPS: Enable WSC 2.0 support unconditionally 91364b7 P2P: Set a timeout for a persistent reinvoke on a P2P Client 41d5ce9 P2P: Optimize scan for GO during persistent group invocation 4d1e38b ACS: Fix number of error path issues Change-Id: I31a51d3dba055d1a906516bb08894effec327da9 Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'src/p2p')
-rw-r--r--src/p2p/p2p.c2
-rw-r--r--src/p2p/p2p.h4
-rw-r--r--src/p2p/p2p_invitation.c18
3 files changed, 19 insertions, 5 deletions
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index a1325d36..ea167617 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -3310,7 +3310,7 @@ static void p2p_timeout_invite_listen(struct p2p_data *p2p)
p2p->cfg->invitation_result(
p2p->cfg->cb_ctx, -1, NULL, NULL,
p2p->invite_peer->info.p2p_device_addr,
- 0);
+ 0, 0);
}
p2p_set_state(p2p, P2P_IDLE);
}
diff --git a/src/p2p/p2p.h b/src/p2p/p2p.h
index 08e7176c..abbb1114 100644
--- a/src/p2p/p2p.h
+++ b/src/p2p/p2p.h
@@ -764,6 +764,8 @@ struct p2p_config {
* @channels: Available operating channels for the group
* @addr: Peer address
* @freq: Frequency (in MHz) indicated during invitation or 0
+ * @peer_oper_freq: Operating frequency (in MHz) advertized by the peer
+ * during invitation or 0
*
* This callback is used to indicate result of an Invitation procedure
* started with a call to p2p_invite(). The indicated status code is
@@ -773,7 +775,7 @@ struct p2p_config {
*/
void (*invitation_result)(void *ctx, int status, const u8 *bssid,
const struct p2p_channels *channels,
- const u8 *addr, int freq);
+ const u8 *addr, int freq, int peer_oper_freq);
/**
* go_connected - Check whether we are connected to a GO
diff --git a/src/p2p/p2p_invitation.c b/src/p2p/p2p_invitation.c
index a45fe198..cb77aee3 100644
--- a/src/p2p/p2p_invitation.c
+++ b/src/p2p/p2p_invitation.c
@@ -288,7 +288,9 @@ void p2p_process_invitation_req(struct p2p_data *p2p, const u8 *sa,
}
}
- if (!p2p_channels_includes(&intersection, p2p->op_reg_class,
+ /* Reselect the channel only for the case of the GO */
+ if (go &&
+ !p2p_channels_includes(&intersection, p2p->op_reg_class,
p2p->op_channel)) {
p2p_dbg(p2p, "Initially selected channel (op_class %d channel %d) not in channel intersection - try to reselect",
p2p->op_reg_class, p2p->op_channel);
@@ -303,7 +305,7 @@ void p2p_process_invitation_req(struct p2p_data *p2p, const u8 *sa,
status = P2P_SC_FAIL_NO_COMMON_CHANNELS;
goto fail;
}
- } else if (!(dev->flags & P2P_DEV_FORCE_FREQ) &&
+ } else if (go && !(dev->flags & P2P_DEV_FORCE_FREQ) &&
!p2p->cfg->cfg_op_channel) {
p2p_dbg(p2p, "Try to reselect channel selection with peer information received; previously selected op_class %u channel %u",
p2p->op_reg_class, p2p->op_channel);
@@ -444,13 +446,23 @@ void p2p_process_invitation_resp(struct p2p_data *p2p, const u8 *sa,
}
if (p2p->cfg->invitation_result) {
+ int peer_oper_freq = 0;
int freq = p2p_channel_to_freq(p2p->op_reg_class,
p2p->op_channel);
if (freq < 0)
freq = 0;
+
+ if (msg.operating_channel) {
+ peer_oper_freq = p2p_channel_to_freq(
+ msg.operating_channel[3],
+ msg.operating_channel[4]);
+ if (peer_oper_freq < 0)
+ peer_oper_freq = 0;
+ }
+
p2p->cfg->invitation_result(p2p->cfg->cb_ctx, *msg.status,
msg.group_bssid, channels, sa,
- freq);
+ freq, peer_oper_freq);
}
p2p_parse_free(&msg);