#include "common.h"
#include "common/ieee802_11_defs.h"
+#include "common/ieee802_11_common.h"
#include "common/qca-vendor.h"
#include "wps/wps_i.h"
#include "p2p_i.h"
void p2p_buf_add_channel_list(struct wpabuf *buf, const char *country,
- struct p2p_channels *chan)
+ struct p2p_channels *chan, bool is_6ghz_capab)
{
u8 *len;
size_t i;
for (i = 0; i < chan->reg_classes; i++) {
struct p2p_reg_class *c = &chan->reg_class[i];
+
+ if (is_6ghz_op_class(c->reg_class) && !is_6ghz_capab)
+ continue;
wpabuf_put_u8(buf, c->reg_class);
wpabuf_put_u8(buf, c->channels);
wpabuf_put_data(buf, c->channel, c->channels);
u8 group_capab;
size_t extra = 0;
u16 pw_id;
+ bool is_6ghz_capab;
#ifdef CONFIG_WIFI_DISPLAY
if (p2p->wfd_ie_go_neg)
p2p_buf_add_ext_listen_timing(buf, p2p->ext_listen_period,
p2p->ext_listen_interval);
p2p_buf_add_intended_addr(buf, p2p->intended_addr);
- p2p_buf_add_channel_list(buf, p2p->cfg->country, &p2p->channels);
+ is_6ghz_capab = is_p2p_6ghz_capable(p2p) &&
+ p2p_is_peer_6ghz_capab(p2p, peer->info.p2p_device_addr);
+ p2p_buf_add_channel_list(buf, p2p->cfg->country, &p2p->channels,
+ is_6ghz_capab);
p2p_buf_add_device_info(buf, p2p, peer);
p2p_buf_add_operating_channel(buf, p2p->cfg->country,
p2p->op_reg_class, p2p->op_channel);
u8 group_capab;
size_t extra = 0;
u16 pw_id;
+ bool is_6ghz_capab;
p2p_dbg(p2p, "Building GO Negotiation Response");
p2p_buf_add_intended_addr(buf, p2p->intended_addr);
if (status || peer == NULL) {
p2p_buf_add_channel_list(buf, p2p->cfg->country,
- &p2p->channels);
+ &p2p->channels, false);
} else if (peer->go_state == REMOTE_GO) {
+ is_6ghz_capab = is_p2p_6ghz_capable(p2p) &&
+ p2p_is_peer_6ghz_capab(p2p, peer->info.p2p_device_addr);
p2p_buf_add_channel_list(buf, p2p->cfg->country,
- &p2p->channels);
+ &p2p->channels, is_6ghz_capab);
} else {
struct p2p_channels res;
+
+ is_6ghz_capab = is_p2p_6ghz_capable(p2p) &&
+ p2p_is_peer_6ghz_capab(p2p, peer->info.p2p_device_addr);
p2p_channels_intersect(&p2p->channels, &peer->channels,
&res);
- p2p_buf_add_channel_list(buf, p2p->cfg->country, &res);
+ p2p_buf_add_channel_list(buf, p2p->cfg->country, &res,
+ is_6ghz_capab);
}
p2p_buf_add_device_info(buf, p2p, peer);
if (peer && peer->go_state == LOCAL_GO) {
struct p2p_channels res;
u8 group_capab;
size_t extra = 0;
+ bool is_6ghz_capab;
p2p_dbg(p2p, "Building GO Negotiation Confirm");
p2p_buf_add_operating_channel(buf, (const char *) resp_chan,
resp_chan[3], resp_chan[4]);
p2p_channels_intersect(&p2p->channels, &peer->channels, &res);
- p2p_buf_add_channel_list(buf, p2p->cfg->country, &res);
+ is_6ghz_capab = is_p2p_6ghz_capable(p2p) &&
+ p2p_is_peer_6ghz_capab(p2p, peer->info.p2p_device_addr);
+ p2p_buf_add_channel_list(buf, p2p->cfg->country, &res, is_6ghz_capab);
if (go) {
p2p_buf_add_group_id(buf, p2p->cfg->dev_addr, p2p->ssid,
p2p->ssid_len);
void p2p_buf_add_operating_channel(struct wpabuf *buf, const char *country,
u8 reg_class, u8 channel);
void p2p_buf_add_channel_list(struct wpabuf *buf, const char *country,
- struct p2p_channels *chan);
+ struct p2p_channels *chan, bool is_6ghz_capab);
void p2p_buf_add_config_timeout(struct wpabuf *buf, u8 go_timeout,
u8 client_timeout);
void p2p_buf_add_intended_addr(struct wpabuf *buf, const u8 *interface_addr);
u8 *len;
const u8 *dev_addr;
size_t extra = 0;
+ bool is_6ghz_capab;
#ifdef CONFIG_WIFI_DISPLAY
struct wpabuf *wfd_ie = p2p->wfd_ie_invitation;
p2p->op_channel);
if (p2p->inv_bssid_set)
p2p_buf_add_group_bssid(buf, p2p->inv_bssid);
- p2p_buf_add_channel_list(buf, p2p->cfg->country, &p2p->channels);
+ is_6ghz_capab = is_p2p_6ghz_capable(p2p) &&
+ p2p_is_peer_6ghz_capab(p2p, peer->info.p2p_device_addr);
+ p2p_buf_add_channel_list(buf, p2p->cfg->country, &p2p->channels,
+ is_6ghz_capab);
if (go_dev_addr)
dev_addr = go_dev_addr;
else if (p2p->inv_role == P2P_INVITE_ROLE_CLIENT)
reg_class, channel);
if (group_bssid)
p2p_buf_add_group_bssid(buf, group_bssid);
- if (channels)
- p2p_buf_add_channel_list(buf, p2p->cfg->country, channels);
+ if (channels) {
+ bool is_6ghz_capab;
+
+ is_6ghz_capab = is_p2p_6ghz_capable(p2p) &&
+ p2p_is_peer_6ghz_capab(p2p, peer->info.p2p_device_addr);
+ p2p_buf_add_channel_list(buf, p2p->cfg->country, channels,
+ is_6ghz_capab);
+ }
p2p_buf_update_ie_hdr(buf, len);
#ifdef CONFIG_WIFI_DISPLAY
}
if (shared_group ||
- (prov->conncap & (P2PS_SETUP_CLIENT | P2PS_SETUP_NEW)))
+ (prov->conncap & (P2PS_SETUP_CLIENT | P2PS_SETUP_NEW))) {
+ bool is_6ghz_capab;
+
+ is_6ghz_capab = is_p2p_6ghz_capable(p2p) &&
+ p2p_is_peer_6ghz_capab(
+ p2p, dev->info.p2p_device_addr);
p2p_buf_add_channel_list(buf, p2p->cfg->country,
- &p2p->channels);
+ &p2p->channels, is_6ghz_capab);
+ }
if ((shared_group && !is_zero_ether_addr(intended_addr)) ||
(prov->conncap & (P2PS_SETUP_GROUP_OWNER | P2PS_SETUP_NEW)))
}
if (persist ||
- (conncap & (P2PS_SETUP_CLIENT | P2PS_SETUP_GROUP_OWNER)))
+ (conncap & (P2PS_SETUP_CLIENT | P2PS_SETUP_GROUP_OWNER))) {
+ bool is_6ghz_capab;
+
+ is_6ghz_capab = is_p2p_6ghz_capable(p2p) &&
+ p2p_is_peer_6ghz_capab(
+ p2p, dev->info.p2p_device_addr);
p2p_buf_add_channel_list(buf, p2p->cfg->country,
- &p2p->channels);
+ &p2p->channels, is_6ghz_capab);
+ }
if (!persist && conncap)
p2p_buf_add_connection_capability(buf, conncap);