tSirRetStatus limGetStaHashBssidx(tpAniSirGlobal pMac, tANI_U16 assocId, tANI_U8 *bssidx, tpPESession psessionEntry) { tpDphHashNode pSta = dphGetHashEntry(pMac, assocId, &psessionEntry->dph.dphHashTable); if (pSta == NULL) { PELOGE(limLog(pMac, LOGE, FL("invalid STA %d"), assocId);) return eSIR_LIM_INVALID_STA;
/** * pe_reset_protection_callback() - resets protection structs so that when an AP * causing use of protection goes away, corresponding protection bit can be * reset * @ptr: pointer to pSessionEntry * * This function resets protection structs so that when an AP causing use of * protection goes away, corresponding protection bit can be reset. This allowes * protection bits to be reset once legacy overlapping APs are gone. * * Return: void */ void pe_reset_protection_callback(void *ptr) { tpPESession pe_session_entry = (tpPESession)ptr; tpAniSirGlobal mac_ctx = (tpAniSirGlobal)pe_session_entry->mac_ctx; int8_t i = 0; tUpdateBeaconParams beacon_params; tANI_U16 current_protection_state = 0; tpDphHashNode station_hash_node = NULL; if (pe_session_entry->valid == false) { VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, FL("session already deleted. exiting timer callback")); return; } current_protection_state |= pe_session_entry->gLimOverlap11gParams.protectionEnabled | pe_session_entry->gLimOverlap11aParams.protectionEnabled << 1 | pe_session_entry->gLimOverlapHt20Params.protectionEnabled << 2 | pe_session_entry->gLimOverlapNonGfParams.protectionEnabled << 3 ; VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, FL("old protection state: 0x%04X, " "new protection state: 0x%04X\n"), pe_session_entry->old_protection_state, current_protection_state); vos_mem_zero(&pe_session_entry->gLimOverlap11gParams, sizeof(pe_session_entry->gLimOverlap11gParams)); vos_mem_zero(&pe_session_entry->gLimOverlap11aParams, sizeof(pe_session_entry->gLimOverlap11aParams)); vos_mem_zero(&pe_session_entry->gLimOverlapHt20Params, sizeof(pe_session_entry->gLimOverlapHt20Params)); vos_mem_zero(&pe_session_entry->gLimOverlapNonGfParams, sizeof(pe_session_entry->gLimOverlapNonGfParams)); vos_mem_zero(&pe_session_entry->beaconParams, sizeof(pe_session_entry->beaconParams)); /* index 0, is self node, peers start from 1 */ for(i = 1 ; i < mac_ctx->lim.gLimAssocStaLimit ; i++) { station_hash_node = dphGetHashEntry(mac_ctx, i, &pe_session_entry->dph.dphHashTable); if (NULL == station_hash_node) continue; limDecideApProtection(mac_ctx, station_hash_node->staAddr, &beacon_params, pe_session_entry); } if ((current_protection_state != pe_session_entry->old_protection_state) && (VOS_FALSE == mac_ctx->sap.SapDfsInfo.is_dfs_cac_timer_running)) { VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, FL("protection changed, update beacon template\n")); /* update beacon fix params and send update to FW */ vos_mem_zero(&beacon_params, sizeof(tUpdateBeaconParams)); beacon_params.bssIdx = pe_session_entry->bssIdx; beacon_params.fShortPreamble = pe_session_entry->beaconParams.fShortPreamble; beacon_params.beaconInterval = pe_session_entry->beaconParams.beaconInterval; beacon_params.llaCoexist = pe_session_entry->beaconParams.llaCoexist; beacon_params.llbCoexist = pe_session_entry->beaconParams.llbCoexist; beacon_params.llgCoexist = pe_session_entry->beaconParams.llgCoexist; beacon_params.ht20MhzCoexist = pe_session_entry->beaconParams.ht20Coexist; beacon_params.llnNonGFCoexist = pe_session_entry->beaconParams.llnNonGFCoexist; beacon_params.fLsigTXOPProtectionFullSupport = pe_session_entry->beaconParams.fLsigTXOPProtectionFullSupport; beacon_params.fRIFSMode = pe_session_entry->beaconParams.fRIFSMode; beacon_params.smeSessionId = pe_session_entry->smeSessionId; schSetFixedBeaconFields(mac_ctx, pe_session_entry); limSendBeaconParams(mac_ctx, &beacon_params, pe_session_entry); } pe_session_entry->old_protection_state = current_protection_state; if (VOS_STATUS_SUCCESS != vos_timer_start( &pe_session_entry->protection_fields_reset_timer, SCH_PROTECTION_RESET_TIME)) { VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, FL("cannot create or start protectionFieldsResetTimer\n")); } }