qcacld-3.0: Fix mcs/nss calculations for HE

1) In function lim_populate_he_mcs_set in case 2x2 is disabled, mcs is
being set incorrectly. Fix this assignment by using correct macro to
disable 2 or higher MCS set.

2) Fix HE_GET_NSS macro to get NSS.

2) In function lim_populate_peer_rate_set, NSS was being calculated
on peer MCS, instead of intersected MCS. Fix this by using intersected
MCS for NSS calculation.

Change-Id: Id674a90b69771b83c75c7aa316ead0b63df93891
CRs-Fixed: 2135014
This commit is contained in:
Naveen Rawat 2017-10-30 17:55:03 -07:00 • committed by snandini
commit cbcc6545ba
3 changed files with 28 additions and 8 deletions

View file

@ -7668,7 +7668,7 @@ struct he_capability {
#define HE_GET_NSS(mcs, nss) \
do { \
(nss) = 0; \
while ((((mcs) >> ((nss)*2)) & 3) != 3 && nss <= 8) \
while ((((mcs) >> ((nss)*2)) & 3) != 3 && nss < 8) \
(nss)++; \
} while (0)

View file

@ -1638,6 +1638,26 @@ lim_populate_own_rate_set(tpAniSirGlobal mac_ctx,
return eSIR_SUCCESS;
}
#ifdef WLAN_FEATURE_11AX
/**
* lim_calculate_he_nss() - function to calculate new nss from he rates
* @rates: supported rtes struct object
* @session: pe session entry
* This function calculates nss from rx_he_mcs_map_lt_80 within rates struct
* object and assigns new value to nss within pe_session
*
* Return: None
*/
static void lim_calculate_he_nss(tpSirSupportedRates rates, tpPESession session)
{
HE_GET_NSS(rates->rx_he_mcs_map_lt_80, session->nss);
}
#else
static void lim_calculate_he_nss(tpSirSupportedRates rates, tpPESession session)
{
}
#endif
tSirRetStatus
lim_populate_peer_rate_set(tpAniSirGlobal pMac,
tpSirSupportedRates pRates, uint8_t *pSupportedMCSSet,
@ -1778,7 +1798,7 @@ lim_populate_peer_rate_set(tpAniSirGlobal pMac,
psessionEntry, psessionEntry->nss);
if (IS_DOT11_MODE_HE(psessionEntry->dot11mode) && he_caps) {
HE_GET_NSS(he_caps->rx_he_mcs_map_lt_80, psessionEntry->nss);
lim_calculate_he_nss(pRates, psessionEntry);
} else if (IS_DOT11_MODE_VHT(psessionEntry->dot11mode)) {
if ((pRates->vhtRxMCSMap & MCSMAPMASK2x2) == MCSMAPMASK2x2)
psessionEntry->nss = NSS_1x1_MODE;

View file

@ -7860,12 +7860,12 @@ QDF_STATUS lim_populate_he_mcs_set(tpAniSirGlobal mac_ctx,
WNI_CFG_HE_RX_MCS_MAP_80_80, WNI_CFG_HE_TX_MCS_MAP_80_80);
if (!support_2x2) {
/* disable 2 and higher NSS MCS sets */
rates->rx_he_mcs_map_lt_80 |= 0xFFFD;
rates->tx_he_mcs_map_lt_80 |= 0xFFFD;
rates->rx_he_mcs_map_160 |= 0xFFFD;
rates->tx_he_mcs_map_160 |= 0xFFFD;
rates->rx_he_mcs_map_80_80 |= 0xFFFD;
rates->tx_he_mcs_map_80_80 |= 0xFFFD;
rates->rx_he_mcs_map_lt_80 |= HE_MCS_INV_MSK_4_NSS(1);
rates->tx_he_mcs_map_lt_80 |= HE_MCS_INV_MSK_4_NSS(1);
rates->rx_he_mcs_map_160 |= HE_MCS_INV_MSK_4_NSS(1);
rates->tx_he_mcs_map_160 |= HE_MCS_INV_MSK_4_NSS(1);
rates->rx_he_mcs_map_80_80 |= HE_MCS_INV_MSK_4_NSS(1);
rates->tx_he_mcs_map_80_80 |= HE_MCS_INV_MSK_4_NSS(1);
}
pe_debug("enable2x2 - %d nss %d",