/** * limProcessDisassocFrame * *FUNCTION: * This function is called by limProcessMessageQueue() upon * Disassociation frame reception. * *LOGIC: * *ASSUMPTIONS: * DPH drops packets for STA with 'valid' bit in pStaDs set to '0'. * *NOTE: * * @param pMac - Pointer to Global MAC structure * @param *pRxPacketInfo - A pointer to Rx packet info structure * @return None */ void limProcessDisassocFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry) { tANI_U8 *pBody; tANI_U16 aid, reasonCode; tpSirMacMgmtHdr pHdr; tpDphHashNode pStaDs; tLimMlmDisassocInd mlmDisassocInd; #ifdef WLAN_FEATURE_11W tANI_U32 frameLen; #endif int8_t frame_rssi; pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); frame_rssi = (int8_t)WDA_GET_RX_RSSI_NORMALIZED(pRxPacketInfo); if (limIsGroupAddr(pHdr->sa)) { // Received Disassoc frame from a BC/MC address // Log error and ignore it PELOGE(limLog(pMac, LOGE, FL("received Disassoc frame from a BC/MC address"));) return;
void limProcessProbeRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry) { tANI_U8 *pBody; tANI_U32 frameLen = 0; tSirMacAddr currentBssId; tpSirMacMgmtHdr pHdr; tSirProbeRespBeacon probeRsp; tANI_U8 qosEnabled = false; tANI_U8 wmeEnabled = false; probeRsp.ssId.length = 0; probeRsp.wpa.length = 0; probeRsp.propIEinfo.apName.length = 0; #if (WNI_POLARIS_FW_PACKAGE == ADVANCED) probeRsp.propIEinfo.aniIndicator = 0; probeRsp.propIEinfo.wdsLength = 0; #endif pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); PELOG2(limLog(pMac, LOG2, FL("Received Probe Response frame with length=%d from "), WDA_GET_RX_MPDU_LEN(pRxPacketInfo)); limPrintMacAddr(pMac, pHdr->sa, LOG2);) if (limDeactivateMinChannelTimerDuringScan(pMac) != eSIR_SUCCESS)
void limProcessProbeRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry) { tANI_U8 *pBody; tANI_U32 frameLen = 0; tSirMacAddr currentBssId; tpSirMacMgmtHdr pHdr; tSirProbeRespBeacon *pProbeRsp; tANI_U8 qosEnabled = false; tANI_U8 wmeEnabled = false; if(eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd, (void **)&pProbeRsp, sizeof(tSirProbeRespBeacon))) { limLog(pMac, LOGE, FL("Unable to PAL allocate memory in limProcessProbeRspFrame") ); return; } pProbeRsp->ssId.length = 0; pProbeRsp->wpa.length = 0; pProbeRsp->propIEinfo.apName.length = 0; pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); PELOG2(limLog(pMac, LOG2, FL("Received Probe Response frame with length=%d from "), WDA_GET_RX_MPDU_LEN(pRxPacketInfo)); limPrintMacAddr(pMac, pHdr->sa, LOG2);) if (limDeactivateMinChannelTimerDuringScan(pMac) != eSIR_SUCCESS)
/** * sysBbtProcessMessageCore * * FUNCTION: * Process BBT messages * * LOGIC: * * ASSUMPTIONS: * * NOTE: * * @param tpAniSirGlobal A pointer to MAC params instance * @param pMsg message pointer * @param tANI_U32 type * @param tANI_U32 sub type * @return None */ tSirRetStatus sysBbtProcessMessageCore(tpAniSirGlobal pMac, tpSirMsgQ pMsg, tANI_U32 type, tANI_U32 subType) { static tANI_U32 lastDeauthPacketTime = 0; tSirRetStatus ret; void* pBd; tMgmtFrmDropReason dropReason; vos_pkt_t *pVosPkt = (vos_pkt_t *)pMsg->bodyptr; VOS_STATUS vosStatus = WDA_DS_PeekRxPacketInfo( pVosPkt, (v_PVOID_t *)&pBd, VOS_FALSE ); #ifdef WLAN_FEATURE_11W tANI_U8 sessionId; tpPESession psessionEntry; tpSirMacMgmtHdr pMacHdr; #endif /* WLAN_FEATURE_11W */ pMac->sys.gSysBbtReceived++; if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) { goto fail; } PELOG3(sysLog(pMac, LOG3, FL("Rx Mgmt Frame Subtype: %d\n"), subType); sirDumpBuf(pMac, SIR_SYS_MODULE_ID, LOG3, (tANI_U8 *)WDA_GET_RX_MAC_HEADER(pBd), WDA_GET_RX_MPDU_LEN(pBd)); sirDumpBuf(pMac, SIR_SYS_MODULE_ID, LOG3, WDA_GET_RX_MPDU_DATA(pBd), WDA_GET_RX_PAYLOAD_LEN(pBd));)
void limProcessDeauthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry) { tANI_U8 *pBody; tANI_U16 aid, reasonCode; tpSirMacMgmtHdr pHdr; tLimMlmAssocCnf mlmAssocCnf; tLimMlmDeauthInd mlmDeauthInd; tpDphHashNode pStaDs; tpPESession pRoamSessionEntry=NULL; tANI_U8 roamSessionId; #ifdef WLAN_FEATURE_11W tANI_U32 frameLen; #endif pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); if ((eLIM_STA_ROLE == psessionEntry->limSystemRole) && (eLIM_SME_WT_DEAUTH_STATE == psessionEntry->limSmeState)) { /*Every 15th deauth frame will be logged in kmsg*/ if(!(pMac->lim.deauthMsgCnt & 0xF)) { PELOGE(limLog(pMac, LOGE, FL("received Deauth frame in DEAUTH_WT_STATE" "(already processing previously received DEAUTH frame).." "Dropping this.. Deauth Failed %d"),++pMac->lim.deauthMsgCnt);) } else {
static void __schBeaconProcessForSession( tpAniSirGlobal pMac, tpSchBeaconStruct pBeacon, tANI_U8* pRxPacketInfo, tpPESession psessionEntry) { tANI_U32 bi; tANI_U8 bssIdx = 0; //tpSirMacMgmtHdr pMh = SIR_MAC_BD_TO_MPDUHEADER(pRxPacketInfo); //tANI_U8 bssid[sizeof(tSirMacAddr)]; tUpdateBeaconParams beaconParams; tANI_U8 sendProbeReq = FALSE; tpDphHashNode pStaDs = NULL; tANI_U32 channelBondingMode; #ifdef WLAN_FEATURE_11AC tpSirMacMgmtHdr pMh = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); tANI_U16 aid; tANI_U8 operMode; tANI_U8 chWidth = 0; #endif #if defined FEATURE_WLAN_ESE || defined WLAN_FEATURE_VOWIFI tPowerdBm regMax = 0,maxTxPower = 0; #endif vos_mem_zero(&beaconParams, sizeof(tUpdateBeaconParams)); beaconParams.paramChangeBitmap = 0; if(eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole ) { if( limHandleIBSScoalescing(pMac, pBeacon, pRxPacketInfo, psessionEntry) != eSIR_SUCCESS ) return; } else if( (eLIM_STA_ROLE == psessionEntry->limSystemRole) || (eLIM_BT_AMP_STA_ROLE == psessionEntry->limSystemRole)) { /* * This handles two cases: * -- Infra STA receving beacons from AP * -- BTAMP_STA receving beacons from BTAMP_AP */ //Always save the beacon into LIM's cached scan results limCheckAndAddBssDescription(pMac, pBeacon, pRxPacketInfo, eANI_BOOLEAN_FALSE, eANI_BOOLEAN_FALSE); /** * This is the Beacon received from the AP we're currently associated with. Check * if there are any changes in AP's capabilities */ if((tANI_U8) pBeacon->channelNumber != psessionEntry->currentOperChannel) { PELOGE(schLog(pMac, LOGE, FL("Channel Change from %d --> %d - " "Ignoring beacon!"), psessionEntry->currentOperChannel, pBeacon->channelNumber);) goto fail;
void limProcessBeaconFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry) { tpSirMacMgmtHdr pHdr; tSchBeaconStruct *pBeacon; pMac->lim.gLimNumBeaconsRcvd++; /* here is it required to increment session specific heartBeat beacon counter */ pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); PELOG2(limLog(pMac, LOG2, FL("Received Beacon frame with length=%d from "), WDA_GET_RX_MPDU_LEN(pRxPacketInfo)); limPrintMacAddr(pMac, pHdr->sa, LOG2);) if (!pMac->fScanOffload)
/** * sysBbtProcessMessageCore * * FUNCTION: * Process BBT messages * * LOGIC: * * ASSUMPTIONS: * * NOTE: * * @param tpAniSirGlobal A pointer to MAC params instance * @param pMsg message pointer * @param tANI_U32 type * @param tANI_U32 sub type * @return None */ tSirRetStatus sysBbtProcessMessageCore(tpAniSirGlobal pMac, tpSirMsgQ pMsg, tANI_U32 type, tANI_U32 subType) { tSirRetStatus ret; void* pBd; tMgmtFrmDropReason dropReason; vos_pkt_t *pVosPkt = (vos_pkt_t *)pMsg->bodyptr; VOS_STATUS vosStatus = WDA_DS_PeekRxPacketInfo( pVosPkt, (v_PVOID_t *)&pBd, VOS_FALSE ); pMac->sys.gSysBbtReceived++; if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) { goto fail; } PELOGW(sysLog(pMac, LOGW, FL("Rx Mgmt Frame Subtype: %d\n"), subType); sirDumpBuf(pMac, SIR_SYS_MODULE_ID, LOGW, (tANI_U8 *)WDA_GET_RX_MAC_HEADER(pBd), WDA_GET_RX_MPDU_LEN(pBd)); sirDumpBuf(pMac, SIR_SYS_MODULE_ID, LOGW, WDA_GET_RX_MPDU_DATA(pBd), WDA_GET_RX_PAYLOAD_LEN(pBd));)
void limProcessProbeRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry) { tANI_U8 *pBody; tANI_U32 frameLen = 0; tSirMacAddr currentBssId; tpSirMacMgmtHdr pHdr; tSirProbeRespBeacon *pProbeRsp; tANI_U8 qosEnabled = false; tANI_U8 wmeEnabled = false; if (!psessionEntry) { limLog(pMac, LOGE, FL("psessionEntry is NULL") ); return; } limLog(pMac,LOG1,"SessionId:%d ProbeRsp Frame is received", psessionEntry->peSessionId); pProbeRsp = vos_mem_malloc(sizeof(tSirProbeRespBeacon)); if ( NULL == pProbeRsp ) { limLog(pMac, LOGE, FL("Unable to allocate memory in limProcessProbeRspFrame") ); return; } pProbeRsp->ssId.length = 0; pProbeRsp->wpa.length = 0; pProbeRsp->propIEinfo.apName.length = 0; pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); PELOG2(limLog(pMac, LOG2, FL("Received Probe Response frame with length=%d from "), WDA_GET_RX_MPDU_LEN(pRxPacketInfo)); limPrintMacAddr(pMac, pHdr->sa, LOG2);) if (!pMac->fScanOffload)
static void __schBeaconProcessForSession( tpAniSirGlobal pMac, tpSchBeaconStruct pBeacon, tANI_U8* pRxPacketInfo, tpPESession psessionEntry) { tANI_U32 bi; tANI_U8 bssIdx = 0; tUpdateBeaconParams beaconParams; tANI_U8 sendProbeReq = FALSE; tpDphHashNode pStaDs = NULL; #ifdef WLAN_FEATURE_11AC tpSirMacMgmtHdr pMh = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); tANI_U16 aid; tANI_U8 operMode; tANI_U8 chWidth = 0; #endif #if defined FEATURE_WLAN_CCX || defined FEATURE_WLAN_VOWIFI tPowerdBm regMax = 0,maxTxPower = 0; #endif vos_mem_zero(&beaconParams, sizeof(tUpdateBeaconParams)); beaconParams.paramChangeBitmap = 0; if(eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole ) { limHandleIBSScoalescing(pMac, pBeacon, pRxPacketInfo, psessionEntry); } else if( (eLIM_STA_ROLE == psessionEntry->limSystemRole) || (eLIM_BT_AMP_STA_ROLE == psessionEntry->limSystemRole)) { limCheckAndAddBssDescription(pMac, pBeacon, pRxPacketInfo, eANI_BOOLEAN_FALSE, eANI_BOOLEAN_FALSE); if((tANI_U8) pBeacon->channelNumber != psessionEntry->currentOperChannel) { PELOGE(schLog(pMac, LOGE, FL("Channel Change from %d --> %d - " "Ignoring beacon!"), psessionEntry->currentOperChannel, pBeacon->channelNumber);) goto fail;
/** * limProcessDisassocFrame * *FUNCTION: * This function is called by limProcessMessageQueue() upon * Disassociation frame reception. * *LOGIC: * *ASSUMPTIONS: * DPH drops packets for STA with 'valid' bit in pStaDs set to '0'. * *NOTE: * * @param pMac - Pointer to Global MAC structure * @param *pRxPacketInfo - A pointer to Rx packet info structure * @return None */ void limProcessDisassocFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry) { tANI_U8 *pBody; tANI_U16 aid, reasonCode; tpSirMacMgmtHdr pHdr; tpDphHashNode pStaDs; tLimMlmDisassocInd mlmDisassocInd; pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); if (limIsGroupAddr(pHdr->sa)) { // Received Disassoc frame from a BC/MC address // Log error and ignore it PELOG1(limLog(pMac, LOG1, FL("received Disassoc frame from a BC/MC address\n"));) return;
void limProcessDeauthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry) { tANI_U8 *pBody; tANI_U16 aid, reasonCode; tpSirMacMgmtHdr pHdr; tLimMlmAssocCnf mlmAssocCnf; tLimMlmDeauthInd mlmDeauthInd; tpDphHashNode pStaDs; tpPESession pRoamSessionEntry=NULL; tANI_U8 roamSessionId; pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); if ((eLIM_STA_ROLE == psessionEntry->limSystemRole) && (eLIM_SME_WT_DEAUTH_STATE == psessionEntry->limSmeState)) { PELOGE(limLog(pMac, LOGE, FL("received Deauth frame in DEAUTH_WT_STATE(already processing previously received DEAUTH frame).. Dropping this..\n "));) return;
/** * sysBbtProcessMessageCore * * FUNCTION: * Process BBT messages * * LOGIC: * * ASSUMPTIONS: * * NOTE: * * @param tpAniSirGlobal A pointer to MAC params instance * @param pMsg message pointer * @param tANI_U32 type * @param tANI_U32 sub type * @return None */ tSirRetStatus sysBbtProcessMessageCore(tpAniSirGlobal pMac, tpSirMsgQ pMsg, tANI_U32 type, tANI_U32 subType) { tANI_U32 framecount; tSirRetStatus ret; void* pBd; tMgmtFrmDropReason dropReason; vos_pkt_t *pVosPkt = (vos_pkt_t *)pMsg->bodyptr; VOS_STATUS vosStatus = WDA_DS_PeekRxPacketInfo( pVosPkt, (v_PVOID_t *)&pBd, VOS_FALSE ); pMac->sys.gSysBbtReceived++; if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) { goto fail; } sysLog(pMac, LOG3, FL("Rx Mgmt Frame Subtype: %d\n"), subType); sirDumpBuf(pMac, SIR_SYS_MODULE_ID, LOG3, (tANI_U8 *)WDA_GET_RX_MAC_HEADER(pBd), WDA_GET_RX_MPDU_LEN(pBd)); sirDumpBuf(pMac, SIR_SYS_MODULE_ID, LOG3, WDA_GET_RX_MPDU_DATA(pBd), WDA_GET_RX_PAYLOAD_LEN(pBd)); pMac->sys.gSysFrameCount[type][subType]++; framecount = pMac->sys.gSysFrameCount[type][subType]; if(type == SIR_MAC_MGMT_FRAME) { tpSirMacMgmtHdr mac_hdr; /* * Drop beacon frames in deferred state to avoid VOSS run out of * message wrappers. */ if ((subType == SIR_MAC_MGMT_BEACON) && (!limIsSystemInScanState(pMac)) && (true != GET_LIM_PROCESS_DEFD_MESGS(pMac)) && !pMac->lim.gLimSystemInScanLearnMode) { sysLog(pMac, LOG1, FL("dropping received beacon in deffered state")); goto fail; } dropReason = limIsPktCandidateForDrop(pMac, pBd, subType); if (dropReason != eMGMT_DROP_NO_DROP) { sysLog(pMac, LOG1, FL("Mgmt Frame %d being dropped, reason: %d\n"), subType, dropReason); MTRACE(macTrace(pMac, TRACE_CODE_RX_MGMT_DROP, NO_SESSION, dropReason)); goto fail; } mac_hdr = WDA_GET_RX_MAC_HEADER(pBd); if (subType == SIR_MAC_MGMT_ASSOC_REQ) { sysLog(pMac, LOG1, FL("ASSOC REQ frame allowed: da: " MAC_ADDRESS_STR ", sa: " MAC_ADDRESS_STR ", bssid: " MAC_ADDRESS_STR ", Assoc Req count so far: %d\n"), MAC_ADDR_ARRAY(mac_hdr->da), MAC_ADDR_ARRAY(mac_hdr->sa), MAC_ADDR_ARRAY(mac_hdr->bssId), pMac->sys.gSysFrameCount[type][subType]); } if (subType == SIR_MAC_MGMT_DEAUTH) { sysLog(pMac, LOG1, FL("DEAUTH frame allowed: da: " MAC_ADDRESS_STR ", sa: " MAC_ADDRESS_STR ", bssid: " MAC_ADDRESS_STR ", DEAUTH count so far: %d\n"), MAC_ADDR_ARRAY(mac_hdr->da), MAC_ADDR_ARRAY(mac_hdr->sa), MAC_ADDR_ARRAY(mac_hdr->bssId), pMac->sys.gSysFrameCount[type][subType]); } if (subType == SIR_MAC_MGMT_DISASSOC) { sysLog(pMac, LOG1, FL("DISASSOC frame allowed: da: " MAC_ADDRESS_STR ", sa: " MAC_ADDRESS_STR ", bssid: " MAC_ADDRESS_STR ", DISASSOC count so far: %d\n"), MAC_ADDR_ARRAY(mac_hdr->da), MAC_ADDR_ARRAY(mac_hdr->sa), MAC_ADDR_ARRAY(mac_hdr->bssId), pMac->sys.gSysFrameCount[type][subType]); } //Post the message to PE Queue ret = (tSirRetStatus) limPostMsgApi(pMac, pMsg); if (ret != eSIR_SUCCESS) { /* Print only one debug failure out of 512 failure messages */ if(pMac->sys.gSysBbtReceived & 0x0200) sysLog(pMac, LOGE, FL("posting to LIM2 failed, ret %d"), ret); goto fail; } pMac->sys.gSysBbtPostedToLim++; } else if (type == SIR_MAC_DATA_FRAME) { #ifdef FEATURE_WLAN_ESE sysLog(pMac, LOGW, FL("IAPP Frame...\n")); //Post the message to PE Queue ret = (tSirRetStatus) limPostMsgApi(pMac, pMsg); if (ret != eSIR_SUCCESS) { sysLog(pMac, LOGE, FL("posting to LIM2 failed, ret %d\n"), ret); goto fail; } pMac->sys.gSysBbtPostedToLim++; #endif } else { sysLog(pMac, LOG3, "BBT received Invalid type %d subType %d " "LIM state %X. BD dump is:\n", type, subType, limGetSmeState(pMac)); sirDumpBuf(pMac, SIR_SYS_MODULE_ID, LOG3, (tANI_U8 *) pBd, WLANHAL_RX_BD_HEADER_SIZE); goto fail; } return eSIR_SUCCESS; fail: pMac->sys.gSysBbtDropped++; return eSIR_FAILURE; }
eHalStatus limCollectBssDescription(tpAniSirGlobal pMac, tSirBssDescription *pBssDescr, tpSirProbeRespBeacon pBPR, tANI_U8 *pRxPacketInfo) #endif { tANI_U8 *pBody; tANI_U32 ieLen = 0; tpSirMacMgmtHdr pHdr; tANI_U8 channelNum; tANI_U8 rxChannel; tANI_U8 rfBand = 0; pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); if (SIR_MAC_B_PR_SSID_OFFSET > WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo)) { VOS_ASSERT(WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo) >= SIR_MAC_B_PR_SSID_OFFSET); return eHAL_STATUS_FAILURE; } ieLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo) - SIR_MAC_B_PR_SSID_OFFSET; rxChannel = WDA_GET_RX_CH(pRxPacketInfo); pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); rfBand = WDA_GET_RX_RFBAND(pRxPacketInfo); /** * Drop all the beacons and probe response without P2P IE during P2P search */ if ((NULL != pMac->lim.gpLimMlmScanReq && pMac->lim.gpLimMlmScanReq->p2pSearch) || (pMac->fScanOffload && pMac->lim.fOffloadScanPending && (pMac->lim.fOffloadScanP2PSearch || pMac->lim.fOffloadScanP2PListen))) { if (NULL == limGetP2pIEPtr(pMac, (pBody + SIR_MAC_B_PR_SSID_OFFSET), ieLen)) { limLog( pMac, LOG3, MAC_ADDRESS_STR, MAC_ADDR_ARRAY(pHdr->bssId)); return eHAL_STATUS_FAILURE; } } /** * Length of BSS desription is without length of * length itself and length of pointer * that holds the next BSS description */ pBssDescr->length = (tANI_U16)( sizeof(tSirBssDescription) - sizeof(tANI_U16) - sizeof(tANI_U32) + ieLen); // Copy BSS Id vos_mem_copy((tANI_U8 *) &pBssDescr->bssId, (tANI_U8 *) pHdr->bssId, sizeof(tSirMacAddr)); // Copy Timestamp, Beacon Interval and Capability Info pBssDescr->scanSysTimeMsec = vos_timer_get_system_time(); pBssDescr->timeStamp[0] = pBPR->timeStamp[0]; pBssDescr->timeStamp[1] = pBPR->timeStamp[1]; pBssDescr->beaconInterval = pBPR->beaconInterval; pBssDescr->capabilityInfo = limGetU16((tANI_U8 *) &pBPR->capabilityInfo); if(!pBssDescr->beaconInterval ) { limLog(pMac, LOGW, FL("Beacon Interval is ZERO, making it to default 100 " MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pHdr->bssId)); pBssDescr->beaconInterval= 100; } /* * There is a narrow window after Channel Switch msg is sent to HAL and before the AGC is shut * down and beacons/Probe Rsps can trickle in and we may report the incorrect channel in 5Ghz * band, so not relying on the 'last Scanned Channel' stored in LIM. * Instead use the value returned by RXP in BD. This the the same value which HAL programs into * RXP before every channel switch. * Right now there is a problem in 5Ghz, where we are receiving beacons from a channel different from * the currently scanned channel. so incorrect channel is reported to CSR and association does not happen. * So for now we keep on looking for the channel info in the beacon (DSParamSet IE OR HT Info IE), and only if it * is not present in the beacon, we go for the channel info present in RXP. * This fix will work for 5Ghz 11n devices, but for 11a devices, we have to rely on RXP routing flag to get the correct channel. * So The problem of incorrect channel reporting in 5Ghz will still remain for 11a devices. */ pBssDescr->channelId = limGetChannelFromBeacon(pMac, pBPR); if (pBssDescr->channelId == 0) { /* If the channel Id is not retrieved from Beacon, extract the channel from BD */ /* Unmapped the channel.This We have to do since we have done mapping in the hal to overcome the limitation of RXBD of not able to accomodate the bigger channel number.*/ if ((!rfBand) || IS_5G_BAND(rfBand)) { rxChannel = limUnmapChannel(rxChannel); } if (!rxChannel) { rxChannel = pMac->lim.gLimCurrentScanChannelId; } pBssDescr->channelId = rxChannel; } pBssDescr->channelIdSelf = pBssDescr->channelId; //set the network type in bss description channelNum = pBssDescr->channelId; pBssDescr->nwType = limGetNwType(pMac, channelNum, SIR_MAC_MGMT_FRAME, pBPR); // Copy RSSI & SINR from BD PELOG4(limLog(pMac, LOG4, "***********BSS Description for BSSID:*********** "); sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG4, pBssDescr->bssId, 6 ); sirDumpBuf( pMac, SIR_LIM_MODULE_ID, LOG4, (tANI_U8*)pRxPacketInfo, 36 );)
void limProcessBeaconFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry) { tpSirMacMgmtHdr pHdr; tSchBeaconStruct *pBeacon; pMac->lim.gLimNumBeaconsRcvd++; /* here is it required to increment session specific heartBeat beacon counter */ pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); limLog(pMac, LOG2, FL("Received Beacon frame with length=%d from "), WDA_GET_RX_MPDU_LEN(pRxPacketInfo)); limPrintMacAddr(pMac, pHdr->sa, LOG2); if (!pMac->fScanOffload) { if (limDeactivateMinChannelTimerDuringScan(pMac) != eSIR_SUCCESS) return; } /** * Expect Beacon only when * 1. STA is in Scan mode waiting for Beacon/Probe response or * 2. STA is waiting for Beacon/Probe Respose Frame * to announce join success. * 3. STA/AP is in Learn mode */ if ((pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE) || (pMac->lim.gLimMlmState == eLIM_MLM_PASSIVE_SCAN_STATE) || (pMac->lim.gLimMlmState == eLIM_MLM_LEARN_STATE) || (psessionEntry->limMlmState == eLIM_MLM_WT_JOIN_BEACON_STATE) || pMac->fScanOffload ) { pBeacon = vos_mem_malloc(sizeof(tSchBeaconStruct)); if ( NULL == pBeacon ) { limLog(pMac, LOGE, FL("Unable to allocate memory in limProcessBeaconFrame") ); return; } // Parse received Beacon if (sirConvertBeaconFrame2Struct(pMac, (tANI_U8 *) pRxPacketInfo, pBeacon) != eSIR_SUCCESS) { // Received wrongly formatted/invalid Beacon. // Ignore it and move on. limLog(pMac, LOGW, FL("Received invalid Beacon in state %d"), psessionEntry->limMlmState); limPrintMlmState(pMac, LOGW, psessionEntry->limMlmState); if ((!psessionEntry->currentBssBeaconCnt) && (sirCompareMacAddr( psessionEntry->bssId, pHdr->sa))) limParseBeaconForTim(pMac, (tANI_U8 *) pRxPacketInfo, psessionEntry); vos_mem_free(pBeacon); return; } /*during scanning, when any session is active, and beacon/Pr belongs to one of the session, fill up the following, TBD - HB couter */ if ((!psessionEntry->lastBeaconDtimPeriod) && (sirCompareMacAddr( psessionEntry->bssId, pBeacon->bssid))) { vos_mem_copy(( tANI_U8* )&psessionEntry->lastBeaconTimeStamp, ( tANI_U8* )pBeacon->timeStamp, sizeof(tANI_U64) ); psessionEntry->lastBeaconDtimCount = pBeacon->tim.dtimCount; psessionEntry->lastBeaconDtimPeriod= pBeacon->tim.dtimPeriod; psessionEntry->currentBssBeaconCnt++; } MTRACE(macTrace(pMac, TRACE_CODE_RX_MGMT_TSF, 0, pBeacon->timeStamp[0]);)
static void ap_beacon_process( tpAniSirGlobal pMac, tANI_U8* pRxPacketInfo, tpSchBeaconStruct pBcnStruct, tpUpdateBeaconParams pBeaconParams, tpPESession psessionEntry) { tpSirMacMgmtHdr pMh = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); tANI_U32 phyMode; tSirRFBand rfBand = SIR_BAND_UNKNOWN; //Get RF band from psessionEntry rfBand = psessionEntry->limRFBand; limGetPhyMode(pMac, &phyMode, psessionEntry); if(SIR_BAND_5_GHZ == rfBand) { if (psessionEntry->htCapability) { if (pBcnStruct->channelNumber == psessionEntry->currentOperChannel) { //11a (non HT) AP overlaps or //HT AP with HT op mode as mixed overlaps. //HT AP with HT op mode as overlap legacy overlaps. if ((!pBcnStruct->HTInfo.present) || (eSIR_HT_OP_MODE_MIXED == pBcnStruct->HTInfo.opMode) || (eSIR_HT_OP_MODE_OVERLAP_LEGACY == pBcnStruct->HTInfo.opMode)) { limUpdateOverlapStaParam(pMac, pMh->bssId, &(pMac->lim.gLimOverlap11aParams)); if (pMac->lim.gLimOverlap11aParams.numSta && !pMac->lim.gLimOverlap11aParams.protectionEnabled) { limEnable11aProtection(pMac, true, true, pBeaconParams,psessionEntry); } } //HT AP with HT20 op mode overlaps. else if(eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT == pBcnStruct->HTInfo.opMode) { limUpdateOverlapStaParam(pMac, pMh->bssId, &(pMac->lim.gLimOverlapHt20Params)); if (pMac->lim.gLimOverlapHt20Params.numSta && !pMac->lim.gLimOverlapHt20Params.protectionEnabled) { limEnableHT20Protection(pMac, true, true, pBeaconParams,psessionEntry); } } } } } else if(SIR_BAND_2_4_GHZ == rfBand) { //We are 11G AP. if ((phyMode == WNI_CFG_PHY_MODE_11G) && (false == psessionEntry->htCapability)) { if (pBcnStruct->channelNumber == psessionEntry->currentOperChannel) { if (((!(pBcnStruct->erpPresent)) && !(pBcnStruct->HTInfo.present))|| //if erp not present then 11B AP overlapping (pBcnStruct->erpPresent && (pBcnStruct->erpIEInfo.useProtection || pBcnStruct->erpIEInfo.nonErpPresent))) { #ifdef FEATURE_WLAN_ESE if( psessionEntry->isESEconnection ) { VOS_TRACE (VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, "%s: [INFOLOG]ESE 11g erpPresent=%d useProtection=%d nonErpPresent=%d", __func__, pBcnStruct->erpPresent, pBcnStruct->erpIEInfo.useProtection, pBcnStruct->erpIEInfo.nonErpPresent); } #endif limEnableOverlap11gProtection(pMac, pBeaconParams, pMh,psessionEntry); } } } // handling the case when HT AP has overlapping legacy BSS. else if(psessionEntry->htCapability) { if (pBcnStruct->channelNumber == psessionEntry->currentOperChannel) { if (((!(pBcnStruct->erpPresent)) && !(pBcnStruct->HTInfo.present))|| //if erp not present then 11B AP overlapping (pBcnStruct->erpPresent && (pBcnStruct->erpIEInfo.useProtection || pBcnStruct->erpIEInfo.nonErpPresent))) { #ifdef FEATURE_WLAN_ESE if( psessionEntry->isESEconnection ) { VOS_TRACE (VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, "%s: [INFOLOG]ESE 11g erpPresent=%d useProtection=%d nonErpPresent=%d", __func__, pBcnStruct->erpPresent, pBcnStruct->erpIEInfo.useProtection, pBcnStruct->erpIEInfo.nonErpPresent); } #endif limEnableOverlap11gProtection(pMac, pBeaconParams, pMh,psessionEntry); } //11g device overlaps if (pBcnStruct->erpPresent && !(pBcnStruct->erpIEInfo.useProtection || pBcnStruct->erpIEInfo.nonErpPresent) && !(pBcnStruct->HTInfo.present)) { limUpdateOverlapStaParam(pMac, pMh->bssId, &(psessionEntry->gLimOverlap11gParams)); if (psessionEntry->gLimOverlap11gParams.numSta && !psessionEntry->gLimOverlap11gParams.protectionEnabled) { limEnableHtProtectionFrom11g(pMac, true, true, pBeaconParams,psessionEntry); } } //ht device overlaps. //here we will check for HT related devices only which might need protection. //check for 11b and 11g is already done in the previous blocks. //so we will not check for HT operating mode as MIXED. if (pBcnStruct->HTInfo.present) { //if we are not already in mixed mode or legacy mode as HT operating mode //and received beacon has HT operating mode as legacy //then we need to enable protection from 11g station. //we don't need protection from 11b because if that's needed then our operating //mode would have already been set to legacy in the previous blocks. if(eSIR_HT_OP_MODE_OVERLAP_LEGACY == pBcnStruct->HTInfo.opMode) { if((eSIR_HT_OP_MODE_MIXED != pMac->lim.gHTOperMode) && (eSIR_HT_OP_MODE_OVERLAP_LEGACY != pMac->lim.gHTOperMode)) { limUpdateOverlapStaParam(pMac, pMh->bssId, &(psessionEntry->gLimOverlap11gParams)); if (psessionEntry->gLimOverlap11gParams.numSta && !psessionEntry->gLimOverlap11gParams.protectionEnabled) { limEnableHtProtectionFrom11g(pMac, true, true, pBeaconParams,psessionEntry); } } } else if(eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT == pBcnStruct->HTInfo.opMode) { limUpdateOverlapStaParam(pMac, pMh->bssId, &(psessionEntry->gLimOverlapHt20Params)); if (psessionEntry->gLimOverlapHt20Params.numSta && !psessionEntry->gLimOverlapHt20Params.protectionEnabled) { limEnableHT20Protection(pMac, true, true, pBeaconParams,psessionEntry); } } } } } } pMac->sch.gSchBcnIgnored++; }
static void ap_beacon_process( tpAniSirGlobal pMac, tANI_U8* pRxPacketInfo, tpSchBeaconStruct pBcnStruct, tpUpdateBeaconParams pBeaconParams, tpPESession psessionEntry) { tpSirMacMgmtHdr pMh = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); tANI_U32 phyMode; tSirRFBand rfBand = SIR_BAND_UNKNOWN; rfBand = psessionEntry->limRFBand; limGetPhyMode(pMac, &phyMode, psessionEntry); if(SIR_BAND_5_GHZ == rfBand) { if (psessionEntry->htCapability) { if (pBcnStruct->channelNumber == psessionEntry->currentOperChannel) { if ((!pBcnStruct->HTInfo.present) || (eSIR_HT_OP_MODE_MIXED == pBcnStruct->HTInfo.opMode) || (eSIR_HT_OP_MODE_OVERLAP_LEGACY == pBcnStruct->HTInfo.opMode)) { limUpdateOverlapStaParam(pMac, pMh->bssId, &(pMac->lim.gLimOverlap11aParams)); if (pMac->lim.gLimOverlap11aParams.numSta && !pMac->lim.gLimOverlap11aParams.protectionEnabled) { limEnable11aProtection(pMac, true, true, pBeaconParams,psessionEntry); } } else if(eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT == pBcnStruct->HTInfo.opMode) { limUpdateOverlapStaParam(pMac, pMh->bssId, &(pMac->lim.gLimOverlapHt20Params)); if (pMac->lim.gLimOverlapHt20Params.numSta && !pMac->lim.gLimOverlapHt20Params.protectionEnabled) { limEnableHT20Protection(pMac, true, true, pBeaconParams,psessionEntry); } } } } } else if(SIR_BAND_2_4_GHZ == rfBand) { if ((phyMode == WNI_CFG_PHY_MODE_11G) && (false == psessionEntry->htCapability)) { if (pBcnStruct->channelNumber == psessionEntry->currentOperChannel) { if (((!(pBcnStruct->erpPresent)) && !(pBcnStruct->HTInfo.present))|| (pBcnStruct->erpPresent && (pBcnStruct->erpIEInfo.useProtection || pBcnStruct->erpIEInfo.nonErpPresent))) { #ifdef FEATURE_WLAN_CCX if( psessionEntry->isCCXconnection ) { VOS_TRACE (VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, "%s: [INFOLOG]CCX 11g erpPresent=%d useProtection=%d nonErpPresent=%d", __func__, pBcnStruct->erpPresent, pBcnStruct->erpIEInfo.useProtection, pBcnStruct->erpIEInfo.nonErpPresent); } #endif limEnableOverlap11gProtection(pMac, pBeaconParams, pMh,psessionEntry); } } } else if(psessionEntry->htCapability) { if (pBcnStruct->channelNumber == psessionEntry->currentOperChannel) { if (((!(pBcnStruct->erpPresent)) && !(pBcnStruct->HTInfo.present))|| (pBcnStruct->erpPresent && (pBcnStruct->erpIEInfo.useProtection || pBcnStruct->erpIEInfo.nonErpPresent))) { #ifdef FEATURE_WLAN_CCX if( psessionEntry->isCCXconnection ) { VOS_TRACE (VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, "%s: [INFOLOG]CCX 11g erpPresent=%d useProtection=%d nonErpPresent=%d", __func__, pBcnStruct->erpPresent, pBcnStruct->erpIEInfo.useProtection, pBcnStruct->erpIEInfo.nonErpPresent); } #endif limEnableOverlap11gProtection(pMac, pBeaconParams, pMh,psessionEntry); } if (pBcnStruct->erpPresent && !(pBcnStruct->erpIEInfo.useProtection || pBcnStruct->erpIEInfo.nonErpPresent) && !(pBcnStruct->HTInfo.present)) { limUpdateOverlapStaParam(pMac, pMh->bssId, &(psessionEntry->gLimOverlap11gParams)); if (psessionEntry->gLimOverlap11gParams.numSta && !psessionEntry->gLimOverlap11gParams.protectionEnabled) { limEnableHtProtectionFrom11g(pMac, true, true, pBeaconParams,psessionEntry); } } if (pBcnStruct->HTInfo.present) { if(eSIR_HT_OP_MODE_OVERLAP_LEGACY == pBcnStruct->HTInfo.opMode) { if((eSIR_HT_OP_MODE_MIXED != pMac->lim.gHTOperMode) && (eSIR_HT_OP_MODE_OVERLAP_LEGACY != pMac->lim.gHTOperMode)) { limUpdateOverlapStaParam(pMac, pMh->bssId, &(psessionEntry->gLimOverlap11gParams)); if (psessionEntry->gLimOverlap11gParams.numSta && !psessionEntry->gLimOverlap11gParams.protectionEnabled) { limEnableHtProtectionFrom11g(pMac, true, true, pBeaconParams,psessionEntry); } } } else if(eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT == pBcnStruct->HTInfo.opMode) { limUpdateOverlapStaParam(pMac, pMh->bssId, &(psessionEntry->gLimOverlapHt20Params)); if (psessionEntry->gLimOverlapHt20Params.numSta && !psessionEntry->gLimOverlapHt20Params.protectionEnabled) { limEnableHT20Protection(pMac, true, true, pBeaconParams,psessionEntry); } } } } } } pMac->sch.gSchBcnIgnored++; }
void limCollectBssDescription(tpAniSirGlobal pMac, tSirBssDescription *pBssDescr, tpSirProbeRespBeacon pBPR, tANI_U8 *pRxPacketInfo) #endif { tANI_U8 *pBody; tANI_U32 ieLen = 0; tpSirMacMgmtHdr pHdr; tANI_U8 channelNum; tANI_U8 rxChannel; pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); ieLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo) - SIR_MAC_B_PR_SSID_OFFSET; rxChannel = WDA_GET_RX_CH(pRxPacketInfo); pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); /** * Length of BSS desription is without length of * length itself and length of pointer * that holds the next BSS description */ pBssDescr->length = (tANI_U16)( sizeof(tSirBssDescription) - sizeof(tANI_U16) - sizeof(tANI_U32) + ieLen); // Copy BSS Id palCopyMemory( pMac->hHdd, (tANI_U8 *) &pBssDescr->bssId, (tANI_U8 *) pHdr->bssId, sizeof(tSirMacAddr)); // Copy Timestamp, Beacon Interval and Capability Info pBssDescr->scanSysTimeMsec = vos_timer_get_system_time(); pBssDescr->timeStamp[0] = pBPR->timeStamp[0]; pBssDescr->timeStamp[1] = pBPR->timeStamp[1]; pBssDescr->beaconInterval = pBPR->beaconInterval; pBssDescr->capabilityInfo = limGetU16((tANI_U8 *) &pBPR->capabilityInfo); /* * There is a narrow window after Channel Switch msg is sent to HAL and before the AGC is shut * down and beacons/Probe Rsps can trickle in and we may report the incorrect channel in 5Ghz * band, so not relying on the 'last Scanned Channel' stored in LIM. * Instead use the value returned by RXP in BD. This the the same value which HAL programs into * RXP before every channel switch. * Right now there is a problem in 5Ghz, where we are receiving beacons from a channel different from * the currently scanned channel. so incorrect channel is reported to CSR and association does not happen. * So for now we keep on looking for the channel info in the beacon (DSParamSet IE OR HT Info IE), and only if it * is not present in the beacon, we go for the channel info present in RXP. * This fix will work for 5Ghz 11n devices, but for 11a devices, we have to rely on RXP routing flag to get the correct channel. * So The problem of incorrect channel reporting in 5Ghz will still remain for 11a devices. */ pBssDescr->channelId = limGetChannelFromBeacon(pMac, pBPR); if (pBssDescr->channelId == 0) { /* If the channel Id is not retrieved from Beacon, extract the channel from BD */ /* Unmapped the channel.This We have to do since we have done mapping in the hal to overcome the limitation of RXBD of not able to accomodate the bigger channel number.*/ if (!( rxChannel = limUnmapChannel(rxChannel))) { rxChannel = pMac->lim.gLimCurrentScanChannelId; } pBssDescr->channelId = rxChannel; } pBssDescr->channelIdSelf = rxChannel; //set the network type in bss description channelNum = pBssDescr->channelId; pBssDescr->nwType = limGetNwType(pMac, channelNum, SIR_MAC_MGMT_FRAME, pBPR); pBssDescr->aniIndicator = pBPR->propIEinfo.aniIndicator; // Copy RSSI & SINR from BD PELOG4(limLog(pMac, LOG4, "***********BSS Description for BSSID:*********** "); sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG4, pBssDescr->bssId, 6 ); sirDumpBuf( pMac, SIR_LIM_MODULE_ID, LOG4, (tANI_U8*)pRxPacketInfo, 36 );)