/** * lim_update_assoc_sta_datas() - Updates station Descriptor * mac_ctx: Pointer to Global MAC structure * sta_ds: Station Descriptor in DPH * assoc_rsp: Pointer to Association Response Structure * session_entry : PE session Entry * * This function is called to Update the Station Descriptor (dph) Details from * Association / ReAssociation Response Frame * * Return: None */ void lim_update_assoc_sta_datas(tpAniSirGlobal mac_ctx, tpDphHashNode sta_ds, tpSirAssocRsp assoc_rsp, tpPESession session_entry) { uint32_t phy_mode; bool qos_mode; tDot11fIEVHTCaps *vht_caps = NULL; lim_get_phy_mode(mac_ctx, &phy_mode, session_entry); sta_ds->staType = STA_ENTRY_SELF; limGetQosMode(session_entry, &qos_mode); sta_ds->mlmStaContext.authType = session_entry->limCurrentAuthType; /* Add capabilities information, rates and AID */ sta_ds->mlmStaContext.capabilityInfo = assoc_rsp->capabilityInfo; sta_ds->shortPreambleEnabled = (uint8_t) assoc_rsp->capabilityInfo.shortPreamble; /* Update HT Capabilites only when the self mode supports HT */ if (IS_DOT11_MODE_HT(session_entry->dot11mode)) lim_update_stads_htcap(mac_ctx, sta_ds, assoc_rsp, session_entry); #ifdef WLAN_FEATURE_11AC if (assoc_rsp->VHTCaps.present) vht_caps = &assoc_rsp->VHTCaps; else if (assoc_rsp->vendor2_ie.VHTCaps.present) vht_caps = &assoc_rsp->vendor2_ie.VHTCaps; if (IS_DOT11_MODE_VHT(session_entry->dot11mode)) { if ((vht_caps != NULL) && vht_caps->present) { sta_ds->mlmStaContext.vhtCapability = vht_caps->present; /* * If 11ac is supported and if the peer is * sending VHT capabilities, * then htMaxRxAMpduFactor should be * overloaded with VHT maxAMPDULenExp */ sta_ds->htMaxRxAMpduFactor = vht_caps->maxAMPDULenExp; if (session_entry->htSupportedChannelWidthSet) { if (assoc_rsp->VHTOperation.present) sta_ds->vhtSupportedChannelWidthSet = assoc_rsp->VHTOperation.chanWidth; else sta_ds->vhtSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ; } } } if (lim_populate_peer_rate_set(mac_ctx, &sta_ds->supportedRates, assoc_rsp->HTCaps.supportedMCSSet, false, session_entry, vht_caps) != eSIR_SUCCESS) { lim_log(mac_ctx, LOGP, FL("could not get rateset and extended rate set")); return; } #else if (lim_populate_peer_rate_set(mac_ctx, &sta_ds->supportedRates, assoc_rsp->HTCaps.supportedMCSSet, false, session_entry) != eSIR_SUCCESS) { lim_log(mac_ctx, LOGP, FL("could not get rateset and extended rate set")); return; } #endif #ifdef WLAN_FEATURE_11AC sta_ds->vhtSupportedRxNss = ((sta_ds->supportedRates.vhtRxMCSMap & MCSMAPMASK2x2) == MCSMAPMASK2x2) ? 1 : 2; #endif /* If one of the rates is 11g rates, set the ERP mode. */ if ((phy_mode == WNI_CFG_PHY_MODE_11G) && sirIsArate(sta_ds->supportedRates.llaRates[0] & 0x7f)) sta_ds->erpEnabled = eHAL_SET; /* Could not get prop rateset from CFG. Log error. */ sta_ds->qosMode = 0; sta_ds->lleEnabled = 0; /* update TSID to UP mapping */ if (qos_mode) { if (assoc_rsp->edcaPresent) { tSirRetStatus status; status = sch_beacon_edca_process(mac_ctx, &assoc_rsp->edca, session_entry); lim_log(mac_ctx, LOG2, "Edca set update based on AssocRsp: status %d", status); if (status != eSIR_SUCCESS) { lim_log(mac_ctx, LOGE, FL("Edca error in AssocResp ")); } else { /* update default tidmap based on ACM */ sta_ds->qosMode = 1; sta_ds->lleEnabled = 1; } } } sta_ds->wmeEnabled = 0; sta_ds->wsmEnabled = 0; if (session_entry->limWmeEnabled && assoc_rsp->wmeEdcaPresent) { tSirRetStatus status; status = sch_beacon_edca_process(mac_ctx, &assoc_rsp->edca, session_entry); lim_log(mac_ctx, LOGW, "WME Edca set update based on AssocRsp: status %d", status); if (status != eSIR_SUCCESS) lim_log(mac_ctx, LOGE, FL("WME Edca error in AssocResp - ignoring")); else { /* update default tidmap based on HashACM */ sta_ds->qosMode = 1; sta_ds->wmeEnabled = 1; } } else { /* * We received assoc rsp from a legacy AP. * So fill in the default local EDCA params. * This is needed (refer to bug #14989) as we'll * be passing the gLimEdcaParams to HAL in * lim_process_sta_mlm_add_bss_rsp(). */ sch_set_default_edca_params(mac_ctx, session_entry); } if (qos_mode && (!sta_ds->qosMode) && sta_ds->mlmStaContext.htCapability) { /* * Enable QOS for all HT AP's even though WMM * or 802.11E IE is not present */ sta_ds->qosMode = 1; sta_ds->wmeEnabled = 1; } #ifdef WLAN_FEATURE_11W if (session_entry->limRmfEnabled) sta_ds->rmfEnabled = 1; #endif }
/** * @function : limUpdateAssocStaDatas * * @brief : This function is called to Update the Station Descriptor (dph) Details from * Association / ReAssociation Response Frame * *LOGIC: * *ASSUMPTIONS: * *NOTE: * * @param pMac - Pointer to Global MAC structure * @param pStaDs - Station Descriptor in DPH * @param pAssocRsp - Pointer to Association Response Structure * * @return None */ void limUpdateAssocStaDatas(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tpSirAssocRsp pAssocRsp,tpPESession psessionEntry) { tANI_U32 prop; tANI_U32 phyMode; tANI_U32 val; //tpSirBoardCapabilities pBoardCaps; tANI_BOOLEAN qosMode; tANI_U16 rxHighestRate = 0; limGetPhyMode(pMac, &phyMode, psessionEntry); pStaDs->staType= STA_ENTRY_SELF; limGetQosMode(psessionEntry, &qosMode); // set the ani peer bit, if self mode is one of the proprietary modes if(IS_DOT11_MODE_PROPRIETARY(psessionEntry->dot11mode)) { wlan_cfgGetInt(pMac, WNI_CFG_PROPRIETARY_ANI_FEATURES_ENABLED, &prop); if (prop) { pStaDs->aniPeer = eHAL_SET; pStaDs->propCapability = pAssocRsp->propIEinfo.capability; } } //pMac->lim.gLimMlmState = eLIM_MLM_LINK_ESTABLISHED_STATE; pStaDs->mlmStaContext.authType = psessionEntry->limCurrentAuthType; // Add capabilities information, rates and AID pStaDs->mlmStaContext.capabilityInfo = pAssocRsp->capabilityInfo; pStaDs->shortPreambleEnabled= (tANI_U8)pAssocRsp->capabilityInfo.shortPreamble; //Update HT Capabilites only when the self mode supports HT if(IS_DOT11_MODE_HT(psessionEntry->dot11mode)) { pStaDs->mlmStaContext.htCapability = pAssocRsp->HTCaps.present; if ( pAssocRsp->HTCaps.present ) { pStaDs->htGreenfield = ( tANI_U8 ) pAssocRsp->HTCaps.greenField; pStaDs->htSupportedChannelWidthSet = ( tANI_U8 ) (pAssocRsp->HTCaps.supportedChannelWidthSet ? pAssocRsp->HTInfo.recommendedTxWidthSet : pAssocRsp->HTCaps.supportedChannelWidthSet ); pStaDs->htLsigTXOPProtection = ( tANI_U8 ) pAssocRsp->HTCaps.lsigTXOPProtection; pStaDs->htMIMOPSState = (tSirMacHTMIMOPowerSaveState)pAssocRsp->HTCaps.mimoPowerSave; pStaDs->htMaxAmsduLength = ( tANI_U8 ) pAssocRsp->HTCaps.maximalAMSDUsize; pStaDs->htAMpduDensity = pAssocRsp->HTCaps.mpduDensity; pStaDs->htDsssCckRate40MHzSupport = (tANI_U8)pAssocRsp->HTCaps.dsssCckMode40MHz; pStaDs->htShortGI20Mhz = (tANI_U8)pAssocRsp->HTCaps.shortGI20MHz; pStaDs->htShortGI40Mhz = (tANI_U8)pAssocRsp->HTCaps.shortGI40MHz; pStaDs->htMaxRxAMpduFactor = pAssocRsp->HTCaps.maxRxAMPDUFactor; limFillRxHighestSupportedRate(pMac, &rxHighestRate, pAssocRsp->HTCaps.supportedMCSSet); pStaDs->supportedRates.rxHighestDataRate = rxHighestRate; /* This is for AP as peer STA and we are INFRA STA. We will put APs offset in dph node which is peer STA */ pStaDs->htSecondaryChannelOffset = (tANI_U8)pAssocRsp->HTInfo.secondaryChannelOffset; //FIXME_AMPDU // In the future, may need to check for "assoc.HTCaps.delayedBA" // For now, it is IMMEDIATE BA only on ALL TID's pStaDs->baPolicyFlag = 0xFF; } } #ifdef WLAN_FEATURE_11AC if(IS_DOT11_MODE_VHT(psessionEntry->dot11mode)) { pStaDs->mlmStaContext.vhtCapability = pAssocRsp->VHTCaps.present; } if (limPopulatePeerRateSet(pMac, &pStaDs->supportedRates, pAssocRsp->HTCaps.supportedMCSSet, false,psessionEntry , &pAssocRsp->VHTCaps) != eSIR_SUCCESS) #else if (limPopulatePeerRateSet(pMac, &pStaDs->supportedRates, pAssocRsp->HTCaps.supportedMCSSet, false,psessionEntry) != eSIR_SUCCESS) #endif { limLog(pMac, LOGP, FL("could not get rateset and extended rate set")); return; } //If one of the rates is 11g rates, set the ERP mode. if ((phyMode == WNI_CFG_PHY_MODE_11G) && sirIsArate(pStaDs->supportedRates.llaRates[0] & 0x7f)) pStaDs->erpEnabled = eHAL_SET; val = WNI_CFG_PROPRIETARY_OPERATIONAL_RATE_SET_LEN; if (wlan_cfgGetStr(pMac, WNI_CFG_PROPRIETARY_OPERATIONAL_RATE_SET, (tANI_U8 *) &pStaDs->mlmStaContext.propRateSet.propRate, &val) != eSIR_SUCCESS) { /// Could not get prop rateset from CFG. Log error. limLog(pMac, LOGP, FL("could not retrieve prop rateset")); return; } pStaDs->mlmStaContext.propRateSet.numPropRates = (tANI_U8) val; pStaDs->qosMode = 0; pStaDs->lleEnabled = 0; // update TSID to UP mapping //if (pMac->lim.gLimQosEnabled) if (qosMode) { if (pAssocRsp->edcaPresent) { tSirRetStatus status; status = schBeaconEdcaProcess(pMac,&pAssocRsp->edca, psessionEntry); PELOG2(limLog(pMac, LOG2, "Edca set update based on AssocRsp: status %d", status);) if (status != eSIR_SUCCESS) { PELOGE(limLog(pMac, LOGE, FL("Edca error in AssocResp "));) } else { // update default tidmap based on ACM
/** * @function : limUpdateAssocStaDatas * * @brief : This function is called to Update the Station Descriptor (dph) Details from * Association / ReAssociation Response Frame * *LOGIC: * *ASSUMPTIONS: * *NOTE: * * @param pMac - Pointer to Global MAC structure * @param pStaDs - Station Descriptor in DPH * @param pAssocRsp - Pointer to Association Response Structure * * @return None */ void limUpdateAssocStaDatas(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tpSirAssocRsp pAssocRsp,tpPESession psessionEntry) { tANI_U32 phyMode; tANI_BOOLEAN qosMode; tANI_U16 rxHighestRate = 0; uint32_t shortgi_20mhz_support; uint32_t shortgi_40mhz_support; limGetPhyMode(pMac, &phyMode, psessionEntry); pStaDs->staType= STA_ENTRY_SELF; limGetQosMode(psessionEntry, &qosMode); pStaDs->mlmStaContext.authType = psessionEntry->limCurrentAuthType; // Add capabilities information, rates and AID pStaDs->mlmStaContext.capabilityInfo = pAssocRsp->capabilityInfo; pStaDs->shortPreambleEnabled= (tANI_U8)pAssocRsp->capabilityInfo.shortPreamble; //Update HT Capabilites only when the self mode supports HT if(IS_DOT11_MODE_HT(psessionEntry->dot11mode)) { pStaDs->mlmStaContext.htCapability = pAssocRsp->HTCaps.present; if ( pAssocRsp->HTCaps.present ) { pStaDs->htGreenfield = ( tANI_U8 ) pAssocRsp->HTCaps.greenField; if (psessionEntry->htSupportedChannelWidthSet) { pStaDs->htSupportedChannelWidthSet = (tANI_U8)(pAssocRsp->HTCaps.supportedChannelWidthSet ? pAssocRsp->HTInfo.recommendedTxWidthSet : pAssocRsp->HTCaps.supportedChannelWidthSet); } else pStaDs->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_20MHZ; pStaDs->htLsigTXOPProtection = ( tANI_U8 ) pAssocRsp->HTCaps.lsigTXOPProtection; pStaDs->htMIMOPSState = (tSirMacHTMIMOPowerSaveState)pAssocRsp->HTCaps.mimoPowerSave; pStaDs->htMaxAmsduLength = ( tANI_U8 ) pAssocRsp->HTCaps.maximalAMSDUsize; pStaDs->htAMpduDensity = pAssocRsp->HTCaps.mpduDensity; pStaDs->htDsssCckRate40MHzSupport = (tANI_U8)pAssocRsp->HTCaps.dsssCckMode40MHz; pStaDs->htMaxRxAMpduFactor = pAssocRsp->HTCaps.maxRxAMPDUFactor; limFillRxHighestSupportedRate(pMac, &rxHighestRate, pAssocRsp->HTCaps.supportedMCSSet); pStaDs->supportedRates.rxHighestDataRate = rxHighestRate; /* This is for AP as peer STA and we are INFRA STA. We will put APs offset in dph node which is peer STA */ pStaDs->htSecondaryChannelOffset = (tANI_U8)pAssocRsp->HTInfo.secondaryChannelOffset; //FIXME_AMPDU // In the future, may need to check for "assoc.HTCaps.delayedBA" // For now, it is IMMEDIATE BA only on ALL TID's pStaDs->baPolicyFlag = 0xFF; /* * Check if we have support for gShortGI20Mhz and * gShortGI40Mhz from ini file. */ if (HAL_STATUS_SUCCESS(ccmCfgGetInt(pMac, WNI_CFG_SHORT_GI_20MHZ, &shortgi_20mhz_support))) { if (VOS_TRUE == shortgi_20mhz_support) pStaDs->htShortGI20Mhz = (tANI_U8)pAssocRsp->HTCaps.shortGI20MHz; else pStaDs->htShortGI20Mhz = VOS_FALSE; } else { limLog(pMac, LOGE, FL("could not retrieve shortGI 20Mhz CFG, setting value to default")); pStaDs->htShortGI20Mhz = WNI_CFG_SHORT_GI_20MHZ_STADEF; } if (HAL_STATUS_SUCCESS(ccmCfgGetInt(pMac, WNI_CFG_SHORT_GI_40MHZ, &shortgi_40mhz_support))) { if (VOS_TRUE == shortgi_40mhz_support) pStaDs->htShortGI40Mhz = (tANI_U8)pAssocRsp->HTCaps.shortGI40MHz; else pStaDs->htShortGI40Mhz = VOS_FALSE; } else { limLog(pMac, LOGE, FL("could not retrieve shortGI 40Mhz CFG,setting value to default")); pStaDs->htShortGI40Mhz = WNI_CFG_SHORT_GI_40MHZ_STADEF; } } } #ifdef WLAN_FEATURE_11AC if(IS_DOT11_MODE_VHT(psessionEntry->dot11mode)) { pStaDs->mlmStaContext.vhtCapability = pAssocRsp->VHTCaps.present; if (pAssocRsp->VHTCaps.present && psessionEntry->htSupportedChannelWidthSet) pStaDs->vhtSupportedChannelWidthSet = pAssocRsp->VHTOperation.chanWidth; } // If 11ac is supported and if the peer is sending VHT capabilities, // then htMaxRxAMpduFactor should be overloaded with VHT maxAMPDULenExp if (pAssocRsp->VHTCaps.present) { pStaDs->htMaxRxAMpduFactor = pAssocRsp->VHTCaps.maxAMPDULenExp; } if (limPopulatePeerRateSet(pMac, &pStaDs->supportedRates, pAssocRsp->HTCaps.supportedMCSSet, false,psessionEntry , &pAssocRsp->VHTCaps) != eSIR_SUCCESS) #else if (limPopulatePeerRateSet(pMac, &pStaDs->supportedRates, pAssocRsp->HTCaps.supportedMCSSet, false,psessionEntry) != eSIR_SUCCESS) #endif { limLog(pMac, LOGP, FL("could not get rateset and extended rate set")); return; } #ifdef WLAN_FEATURE_11AC pStaDs->vhtSupportedRxNss = ((pStaDs->supportedRates.vhtRxMCSMap & MCSMAPMASK2x2) == MCSMAPMASK2x2) ? 1 : 2; #endif //If one of the rates is 11g rates, set the ERP mode. if ((phyMode == WNI_CFG_PHY_MODE_11G) && sirIsArate(pStaDs->supportedRates.llaRates[0] & 0x7f)) pStaDs->erpEnabled = eHAL_SET; pStaDs->qosMode = 0; pStaDs->lleEnabled = 0; // update TSID to UP mapping if (qosMode) { if (pAssocRsp->edcaPresent) { tSirRetStatus status; status = schBeaconEdcaProcess(pMac,&pAssocRsp->edca, psessionEntry); PELOG2(limLog(pMac, LOG2, "Edca set update based on AssocRsp: status %d", status);) if (status != eSIR_SUCCESS) { PELOGE(limLog(pMac, LOGE, FL("Edca error in AssocResp "));) } else { // update default tidmap based on ACM