P2P: Introduce 6 GHz band capability bit in P2P Device Capability

Introduce P2P 6 GHz band capable information in Device Capability
Bitmap of P2P Capability sub-attribute.

Signed-off-by: Sreeramya Soratkal <ssramya@codeaurora.org>
This commit is contained in:
Sreeramya Soratkal 2021-05-04 12:29:44 +05:30 committed by Jouni Malinen
parent 9f901e65b4
commit 9b50746f50
4 changed files with 36 additions and 0 deletions

View file

@ -1657,6 +1657,7 @@ enum p2p_attr_id {
#define P2P_DEV_CAPAB_INFRA_MANAGED BIT(3)
#define P2P_DEV_CAPAB_DEVICE_LIMIT BIT(4)
#define P2P_DEV_CAPAB_INVITATION_PROCEDURE BIT(5)
#define P2P_DEV_CAPAB_6GHZ_BAND_CAPABLE BIT(6)
/* P2P Capability - Group Capability bitmap */
#define P2P_GROUP_CAPAB_GROUP_OWNER BIT(0)

View file

@ -5575,3 +5575,33 @@ struct wpabuf * p2p_build_probe_resp_template(struct p2p_data *p2p,
return buf;
}
bool p2p_is_peer_6ghz_capab(struct p2p_data *p2p, const u8 *addr)
{
struct p2p_device *dev;
dev = p2p_get_device(p2p, addr);
if (!dev)
return false;
return !!(dev->info.dev_capab & P2P_DEV_CAPAB_6GHZ_BAND_CAPABLE);
}
void p2p_set_6ghz_dev_capab(struct p2p_data *p2p, bool allow_6ghz)
{
p2p->p2p_6ghz_capable = allow_6ghz;
p2p_dbg(p2p, "Set 6 GHz capability to %d", allow_6ghz);
if (allow_6ghz)
p2p->dev_capab |= P2P_DEV_CAPAB_6GHZ_BAND_CAPABLE;
else
p2p->dev_capab &= ~P2P_DEV_CAPAB_6GHZ_BAND_CAPABLE;
}
bool is_p2p_6ghz_capable(struct p2p_data *p2p)
{
return p2p->p2p_6ghz_capable;
}

View file

@ -2411,4 +2411,8 @@ int p2p_group_get_common_freqs(struct p2p_group *group, int *common_freqs,
struct wpabuf * p2p_build_probe_resp_template(struct p2p_data *p2p,
unsigned int freq);
void p2p_set_6ghz_dev_capab(struct p2p_data *p2p, bool allow_6ghz);
bool is_p2p_6ghz_capable(struct p2p_data *p2p);
bool p2p_is_peer_6ghz_capab(struct p2p_data *p2p, const u8 *addr);
#endif /* P2P_H */

View file

@ -548,6 +548,7 @@ struct p2p_data {
/* Override option for preferred operating channel in GO Negotiation */
u8 override_pref_op_class;
u8 override_pref_channel;
bool p2p_6ghz_capable;
};
/**