P2P: Add Dev Info attribute to Probe Request frames in 60 GHz
When building P2P IE for Probe Request frames in P2P scan, add the device information attribute if the 60 GHz band is included in the scan, since this is required by the P2P specification. Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
This commit is contained in:
parent
2b6e9f91df
commit
c58eed6dc7
3 changed files with 19 additions and 5 deletions
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "eloop.h"
|
#include "eloop.h"
|
||||||
|
#include "common/defs.h"
|
||||||
#include "common/ieee802_11_defs.h"
|
#include "common/ieee802_11_defs.h"
|
||||||
#include "common/ieee802_11_common.h"
|
#include "common/ieee802_11_common.h"
|
||||||
#include "common/wpa_ctrl.h"
|
#include "common/wpa_ctrl.h"
|
||||||
|
@ -3494,7 +3495,8 @@ void p2p_scan_res_handled(struct p2p_data *p2p)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void p2p_scan_ie(struct p2p_data *p2p, struct wpabuf *ies, const u8 *dev_id)
|
void p2p_scan_ie(struct p2p_data *p2p, struct wpabuf *ies, const u8 *dev_id,
|
||||||
|
unsigned int bands)
|
||||||
{
|
{
|
||||||
u8 dev_capab;
|
u8 dev_capab;
|
||||||
u8 *len;
|
u8 *len;
|
||||||
|
@ -3528,6 +3530,9 @@ void p2p_scan_ie(struct p2p_data *p2p, struct wpabuf *ies, const u8 *dev_id)
|
||||||
p2p_buf_add_ext_listen_timing(ies, p2p->ext_listen_period,
|
p2p_buf_add_ext_listen_timing(ies, p2p->ext_listen_period,
|
||||||
p2p->ext_listen_interval);
|
p2p->ext_listen_interval);
|
||||||
|
|
||||||
|
if (bands & BAND_60_GHZ)
|
||||||
|
p2p_buf_add_device_info(ies, p2p, NULL);
|
||||||
|
|
||||||
if (p2p->p2ps_seek && p2p->p2ps_seek_count)
|
if (p2p->p2ps_seek && p2p->p2ps_seek_count)
|
||||||
p2p_buf_add_service_hash(ies, p2p);
|
p2p_buf_add_service_hash(ies, p2p);
|
||||||
|
|
||||||
|
|
|
@ -1902,8 +1902,10 @@ int p2p_assoc_req_ie(struct p2p_data *p2p, const u8 *bssid, u8 *buf,
|
||||||
* @p2p: P2P module context from p2p_init()
|
* @p2p: P2P module context from p2p_init()
|
||||||
* @ies: Buffer for writing P2P IE
|
* @ies: Buffer for writing P2P IE
|
||||||
* @dev_id: Device ID to search for or %NULL for any
|
* @dev_id: Device ID to search for or %NULL for any
|
||||||
|
* @bands: Frequency bands used in the scan (enum wpa_radio_work_band bitmap)
|
||||||
*/
|
*/
|
||||||
void p2p_scan_ie(struct p2p_data *p2p, struct wpabuf *ies, const u8 *dev_id);
|
void p2p_scan_ie(struct p2p_data *p2p, struct wpabuf *ies, const u8 *dev_id,
|
||||||
|
unsigned int bands);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* p2p_scan_ie_buf_len - Get maximum buffer length needed for p2p_scan_ie
|
* p2p_scan_ie_buf_len - Get maximum buffer length needed for p2p_scan_ie
|
||||||
|
|
|
@ -351,6 +351,7 @@ static int wpas_p2p_scan(void *ctx, enum p2p_scan_type type, int freq,
|
||||||
int social_channels_freq[] = { 2412, 2437, 2462, 60480 };
|
int social_channels_freq[] = { 2412, 2437, 2462, 60480 };
|
||||||
size_t ielen;
|
size_t ielen;
|
||||||
u8 *n, i;
|
u8 *n, i;
|
||||||
|
unsigned int bands;
|
||||||
|
|
||||||
if (wpa_s->global->p2p_disabled || wpa_s->global->p2p == NULL)
|
if (wpa_s->global->p2p_disabled || wpa_s->global->p2p == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -429,7 +430,8 @@ static int wpas_p2p_scan(void *ctx, enum p2p_scan_type type, int freq,
|
||||||
wpabuf_put_buf(ies, wps_ie);
|
wpabuf_put_buf(ies, wps_ie);
|
||||||
wpabuf_free(wps_ie);
|
wpabuf_free(wps_ie);
|
||||||
|
|
||||||
p2p_scan_ie(wpa_s->global->p2p, ies, dev_id);
|
bands = wpas_get_bands(wpa_s, params->freqs);
|
||||||
|
p2p_scan_ie(wpa_s->global->p2p, ies, dev_id, bands);
|
||||||
|
|
||||||
params->p2p_probe = 1;
|
params->p2p_probe = 1;
|
||||||
n = os_malloc(wpabuf_len(ies));
|
n = os_malloc(wpabuf_len(ies));
|
||||||
|
@ -4930,6 +4932,7 @@ static void wpas_p2p_join_scan_req(struct wpa_supplicant *wpa_s, int freq,
|
||||||
struct wpabuf *wps_ie, *ies;
|
struct wpabuf *wps_ie, *ies;
|
||||||
size_t ielen;
|
size_t ielen;
|
||||||
int freqs[2] = { 0, 0 };
|
int freqs[2] = { 0, 0 };
|
||||||
|
unsigned int bands;
|
||||||
|
|
||||||
os_memset(¶ms, 0, sizeof(params));
|
os_memset(¶ms, 0, sizeof(params));
|
||||||
|
|
||||||
|
@ -4981,7 +4984,8 @@ static void wpas_p2p_join_scan_req(struct wpa_supplicant *wpa_s, int freq,
|
||||||
wpabuf_put_buf(ies, wps_ie);
|
wpabuf_put_buf(ies, wps_ie);
|
||||||
wpabuf_free(wps_ie);
|
wpabuf_free(wps_ie);
|
||||||
|
|
||||||
p2p_scan_ie(wpa_s->global->p2p, ies, NULL);
|
bands = wpas_get_bands(wpa_s, freqs);
|
||||||
|
p2p_scan_ie(wpa_s->global->p2p, ies, NULL, bands);
|
||||||
|
|
||||||
params.p2p_probe = 1;
|
params.p2p_probe = 1;
|
||||||
params.extra_ies = wpabuf_head(ies);
|
params.extra_ies = wpabuf_head(ies);
|
||||||
|
@ -6713,12 +6717,15 @@ void wpas_p2p_rx_action(struct wpa_supplicant *wpa_s, const u8 *da,
|
||||||
|
|
||||||
void wpas_p2p_scan_ie(struct wpa_supplicant *wpa_s, struct wpabuf *ies)
|
void wpas_p2p_scan_ie(struct wpa_supplicant *wpa_s, struct wpabuf *ies)
|
||||||
{
|
{
|
||||||
|
unsigned int bands;
|
||||||
|
|
||||||
if (wpa_s->global->p2p_disabled)
|
if (wpa_s->global->p2p_disabled)
|
||||||
return;
|
return;
|
||||||
if (wpa_s->global->p2p == NULL)
|
if (wpa_s->global->p2p == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p2p_scan_ie(wpa_s->global->p2p, ies, NULL);
|
bands = wpas_get_bands(wpa_s, NULL);
|
||||||
|
p2p_scan_ie(wpa_s->global->p2p, ies, NULL, bands);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue