mbssid: Set extended capabilities

Set extended capabilities as described in IEEE Std 802.11ax-2021,
9.4.2.26. Reset the capability bits to 0 explicitly if MBSSID and/or EMA
is not enabled because otherwise some client devices fail to associate.

Bit 80 (complete list of non-tx profiles) is set for all Probe Response
frames, but for Beacon frames it is set only if EMA is disabled or if
EMA profile periodicity is 1.

Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
Co-developed-by: John Crispin <john@phrozen.org>
Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
Aloka Dixit 2022-11-30 19:18:39 -08:00 committed by Jouni Malinen
parent a004bf2cd0
commit fc2e4bac5a
5 changed files with 40 additions and 15 deletions

View file

@ -340,7 +340,8 @@ void ieee802_11_sa_query_action(struct hostapd_data *hapd,
}
static void hostapd_ext_capab_byte(struct hostapd_data *hapd, u8 *pos, int idx)
static void hostapd_ext_capab_byte(struct hostapd_data *hapd, u8 *pos, int idx,
bool mbssid_complete)
{
*pos = 0x00;
@ -364,6 +365,8 @@ static void hostapd_ext_capab_byte(struct hostapd_data *hapd, u8 *pos, int idx)
*pos |= 0x02; /* Bit 17 - WNM-Sleep Mode */
if (hapd->conf->bss_transition)
*pos |= 0x08; /* Bit 19 - BSS Transition */
if (hapd->iconf->mbssid)
*pos |= 0x40; /* Bit 22 - Multiple BSSID */
break;
case 3: /* Bits 24-31 */
#ifdef CONFIG_WNM_AP
@ -435,6 +438,11 @@ static void hostapd_ext_capab_byte(struct hostapd_data *hapd, u8 *pos, int idx)
(hapd->iface->drv_flags &
WPA_DRIVER_FLAGS_BEACON_PROTECTION))
*pos |= 0x10; /* Bit 84 - Beacon Protection Enabled */
if (hapd->iconf->mbssid == ENHANCED_MBSSID_ENABLED)
*pos |= 0x08; /* Bit 83 - Enhanced multiple BSSID */
if (mbssid_complete)
*pos |= 0x01; /* Bit 80 - Complete List of NonTxBSSID
* Profiles */
break;
case 11: /* Bits 88-95 */
#ifdef CONFIG_SAE_PK
@ -448,7 +456,8 @@ static void hostapd_ext_capab_byte(struct hostapd_data *hapd, u8 *pos, int idx)
}
u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid)
u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid,
bool mbssid_complete)
{
u8 *pos = eid;
u8 len = EXT_CAPA_MAX_LEN, i;
@ -459,7 +468,7 @@ u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid)
*pos++ = WLAN_EID_EXT_CAPAB;
*pos++ = len;
for (i = 0; i < len; i++, pos++) {
hostapd_ext_capab_byte(hapd, pos, i);
hostapd_ext_capab_byte(hapd, pos, i, mbssid_complete);
if (i < hapd->iface->extended_capa_len) {
*pos &= ~hapd->iface->extended_capa_mask[i];
@ -470,6 +479,13 @@ u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid)
*pos &= ~hapd->conf->ext_capa_mask[i];
*pos |= hapd->conf->ext_capa[i];
}
/* Clear bits 83 and 22 if EMA and MBSSID are not enabled
* otherwise association fails with some clients */
if (i == 10 && hapd->iconf->mbssid < ENHANCED_MBSSID_ENABLED)
*pos &= ~0x08;
if (i == 2 && !hapd->iconf->mbssid)
*pos &= ~0x40;
}
while (len > 0 && eid[1 + len] == 0) {