From 26f29ef46d3044cdf8b170ccf09a47f06d2e4e64 Mon Sep 17 00:00:00 2001 From: Aloka Dixit Date: Mon, 24 Jul 2023 16:16:25 -0700 Subject: [PATCH] FILS: Fix NSS calculation for HE mode Maximum NSS calculation for HE mode checks if both Tx and Rx support a given NSS. Modify it to instead check if either of these two support the given NSS. Signed-off-by: Aloka Dixit --- src/ap/beacon.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 1d00ab249..8bda7c323 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -1425,27 +1425,29 @@ static u16 hostapd_gen_fils_discovery_nss(struct hostapd_hw_modes *mode, u16 nss_mask = 0x3 << (i * 2); /* - * If NSS values supported by RX and TX are different - * then choose the smaller of the two as the maximum - * supported NSS as that is the value supported by - * both RX and TX. + * If Tx and/or Rx indicate support for a given NSS, + * count it towards the maximum NSS. */ if (he_mcs_nss_size == 4 && - (((mcs[0] & nss_mask) == nss_mask) || - ((mcs[1] & nss_mask) == nss_mask))) + (((mcs[0] & nss_mask) != nss_mask) || + ((mcs[1] & nss_mask) != nss_mask))) { + nss++; continue; + } if (he_mcs_nss_size == 8 && - (((mcs[2] & nss_mask) == nss_mask) || - ((mcs[3] & nss_mask) == nss_mask))) + (((mcs[2] & nss_mask) != nss_mask) || + ((mcs[3] & nss_mask) != nss_mask))) { + nss++; continue; + } if (he_mcs_nss_size == 12 && - (((mcs[4] & nss_mask) == nss_mask) || - ((mcs[5] & nss_mask) == nss_mask))) + (((mcs[4] & nss_mask) != nss_mask) || + ((mcs[5] & nss_mask) != nss_mask))) { + nss++; continue; - - nss++; + } } }