diff options
| author | Ahmad Kholaif <akholaif@qca.qualcomm.com> | 2015-08-11 01:09:27 +0000 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-04-01 16:48:57 +0530 |
| commit | 2aaf6774d997af2d013eada59024305b7c3d1288 (patch) | |
| tree | ad92a6066f22a23c92a0b26af201aff91c7575d6 | |
| parent | ba8401dcf1fa5e6397fd551bc6b9e4a4798d9a40 (diff) | |
| download | android_external_wpa_supplicant_8-2aaf6774d997af2d013eada59024305b7c3d1288.tar.gz android_external_wpa_supplicant_8-2aaf6774d997af2d013eada59024305b7c3d1288.tar.bz2 android_external_wpa_supplicant_8-2aaf6774d997af2d013eada59024305b7c3d1288.zip | |
P2P: Support driver preferred freq list for invitation case
When using P2P invitation to re-invoke a persistent P2P group without
specifying the operating channel, query the driver for the preferred
frequency list, and use it to select the operating channel of the group.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Git-commit: fbcddaed9aa62587e7b74cd22df4b4cdaca6b101
Git-repo: git://w1.fi/srv/git/hostap.git
Change-Id: I2fcf33980771e57e11539ee580cf4fe783b6719f
CRs-fixed: 887890
| -rw-r--r-- | src/p2p/p2p_go_neg.c | 6 | ||||
| -rw-r--r-- | src/p2p/p2p_i.h | 2 | ||||
| -rw-r--r-- | src/p2p/p2p_invitation.c | 15 | ||||
| -rw-r--r-- | wpa_supplicant/p2p_supplicant.c | 1 |
4 files changed, 21 insertions, 3 deletions
diff --git a/src/p2p/p2p_go_neg.c b/src/p2p/p2p_go_neg.c index ab225111..4b8cd753 100644 --- a/src/p2p/p2p_go_neg.c +++ b/src/p2p/p2p_go_neg.c @@ -673,8 +673,8 @@ static void p2p_check_pref_chan_recv(struct p2p_data *p2p, int go, } -static void p2p_check_pref_chan(struct p2p_data *p2p, int go, - struct p2p_device *dev, struct p2p_message *msg) +void p2p_check_pref_chan(struct p2p_data *p2p, int go, + struct p2p_device *dev, struct p2p_message *msg) { unsigned int freq_list[P2P_MAX_PREF_CHANNELS], size; unsigned int i; @@ -725,7 +725,7 @@ static void p2p_check_pref_chan(struct p2p_data *p2p, int go, /* Check if peer's preferred channel list is - * _not_ included in the GO Negotiation Request. + * _not_ included in the GO Negotiation Request or Invitation Request. */ if (msg->pref_freq_list_len == 0) p2p_check_pref_chan_no_recv(p2p, go, dev, msg, freq_list, size); diff --git a/src/p2p/p2p_i.h b/src/p2p/p2p_i.h index d34d914b..4b01f86d 100644 --- a/src/p2p/p2p_i.h +++ b/src/p2p/p2p_i.h @@ -802,6 +802,8 @@ int p2p_connect_send(struct p2p_data *p2p, struct p2p_device *dev); u16 p2p_wps_method_pw_id(enum p2p_wps_method wps_method); void p2p_reselect_channel(struct p2p_data *p2p, struct p2p_channels *intersection); +void p2p_check_pref_chan(struct p2p_data *p2p, int go, + struct p2p_device *dev, struct p2p_message *msg); /* p2p_pd.c */ void p2p_process_prov_disc_req(struct p2p_data *p2p, const u8 *sa, diff --git a/src/p2p/p2p_invitation.c b/src/p2p/p2p_invitation.c index f5454f70..108e5b7f 100644 --- a/src/p2p/p2p_invitation.c +++ b/src/p2p/p2p_invitation.c @@ -85,6 +85,9 @@ static struct wpabuf * p2p_build_invitation_req(struct p2p_data *p2p, p2p_buf_add_device_info(buf, p2p, peer); p2p_buf_update_ie_hdr(buf, len); + p2p_buf_add_pref_channel_list(buf, p2p->pref_freq_list, + p2p->num_pref_freq); + #ifdef CONFIG_WIFI_DISPLAY if (wfd_ie) wpabuf_put_buf(buf, wfd_ie); @@ -343,6 +346,12 @@ void p2p_process_invitation_req(struct p2p_data *p2p, const u8 *sa, p2p_reselect_channel(p2p, &intersection); } + /* + * Use the driver preferred frequency list extension if + * supported. + */ + p2p_check_pref_chan(p2p, go, dev, &msg); + op_freq = p2p_channel_to_freq(p2p->op_reg_class, p2p->op_channel); if (op_freq < 0) { @@ -534,6 +543,12 @@ void p2p_process_invitation_resp(struct p2p_data *p2p, const u8 *sa, peer_oper_freq = 0; } + /* + * Use the driver preferred frequency list extension if + * supported. + */ + p2p_check_pref_chan(p2p, 0, dev, &msg); + p2p->cfg->invitation_result(p2p->cfg->cb_ctx, *msg.status, msg.group_bssid, channels, sa, freq, peer_oper_freq); diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 51e1324d..b2fd8db2 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -6261,6 +6261,7 @@ int wpas_p2p_invite(struct wpa_supplicant *wpa_s, const u8 *peer_addr, pref_freq_list, &size); if (res) return res; + p2p_set_own_pref_freq_list(wpa_s->global->p2p, pref_freq_list, size); if (wpa_s->global->p2p_disabled || wpa_s->global->p2p == NULL) return -1; |
