wiphy: Add wiphy_get_rsnxe

Returns a template RSNX element that can be further modified by callers
to set any additional capabilities if required.  wiphy will fill in
those capabilities that are driver / firmware dependent.
This commit is contained in:
Denis Kenzior 2021-07-13 14:43:52 -05:00
parent 3f42e4df25
commit 57a57646d8
2 changed files with 21 additions and 0 deletions

View File

@ -551,6 +551,26 @@ const uint8_t *wiphy_get_rm_enabled_capabilities(struct wiphy *wiphy)
return wiphy->rm_enabled_capabilities;
}
bool wiphy_get_rsnxe(const struct wiphy *wiphy, uint8_t *buf, size_t len)
{
if (len < 3)
return false;
buf[0] = IE_TYPE_RSNX;
buf[1] = 1;
/*
* Lower 4 bits of the first octet:
* The length of the Extended RSN Capabilities field, in octets,
* minus 1, i.e., n - 1.
*/
buf[2] = 0;
/* No other bits set for now */
return true;
}
static void wiphy_address_constrain(struct wiphy *wiphy, uint8_t addr[static 6])
{
switch (mac_randomize_bytes) {

View File

@ -101,6 +101,7 @@ const uint8_t *wiphy_get_permanent_address(struct wiphy *wiphy);
const uint8_t *wiphy_get_extended_capabilities(struct wiphy *wiphy,
uint32_t iftype);
const uint8_t *wiphy_get_rm_enabled_capabilities(struct wiphy *wiphy);
bool wiphy_get_rsnxe(const struct wiphy *wiphy, uint8_t *buf, size_t len);
void wiphy_get_reg_domain_country(struct wiphy *wiphy, char *out);
void wiphy_generate_random_address(struct wiphy *wiphy, uint8_t addr[static 6]);