inline static tSirRetStatus limInitMeasResources(tpAniSirGlobal pMac) { tANI_U32 val; tANI_U32 beaconInterval; // Create Meas related timers only when // periodic measurements are enabled if (pMac->lim.gpLimMeasReq->measControl.periodicMeasEnabled) { val = SYS_MS_TO_TICKS(pMac->lim.gpLimMeasReq->measIndPeriod); if (tx_timer_create( &pMac->lim.gLimMeasParams.measurementIndTimer, "Meas Ind TIMEOUT", limTimerHandler, SIR_LIM_MEASUREMENT_IND_TIMEOUT, val, val, TX_NO_ACTIVATE) != TX_SUCCESS) { /// Could not create MeasInd timer. // Log error limLog(pMac, LOGP, FL("call to create MeasInd timer failed\n")); return eSIR_SYS_TX_TIMER_CREATE_FAILED; } pMac->lim.gLimMeasParams.isMeasIndTimerActive = 0; PELOG3(limLog(pMac, LOG3, FL("MeasurementIndication timer initialized, period = %d\n"), pMac->lim.gpLimMeasReq->measIndPeriod);)
int limProcessRemainOnChnlReq(tpAniSirGlobal pMac, tANI_U32 *pMsg) { /* CONC_OPER_AND_LISTEN_CHNL_SAME_OPTIMIZE - Currently removed the special optimization when a concurrent session * exists with operating channel same as P2P listen channel since it was causing issues in P2P search. The reason was * STA-AP link entering BMPS when returning to home channel causing P2P search to miss Probe Reqs and hence not * respond with Probe Rsp causing peer device to NOT find us. * If we need this optimization, we need to find a way to keep the STA-AP link awake (no BMPS) on home channel when in listen state */ #ifdef CONC_OPER_AND_LISTEN_CHNL_SAME_OPTIMIZE tANI_U8 i; tpPESession psessionEntry; #endif #ifdef WLAN_FEATURE_P2P_INTERNAL tpPESession pP2pSession; #endif tSirRemainOnChnReq *MsgBuff = (tSirRemainOnChnReq *)pMsg; pMac->lim.gpLimRemainOnChanReq = MsgBuff; #ifdef CONC_OPER_AND_LISTEN_CHNL_SAME_OPTIMIZE for (i =0; i < pMac->lim.maxBssId;i++) { psessionEntry = peFindSessionBySessionId(pMac,i); if ( (psessionEntry != NULL) ) { if (psessionEntry->currentOperChannel == MsgBuff->chnNum) { tANI_U32 val; tSirMacAddr nullBssid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; pMac->lim.p2pRemOnChanTimeStamp = vos_timer_get_system_time(); pMac->lim.gTotalScanDuration = MsgBuff->duration; /* get the duration from the request */ val = SYS_MS_TO_TICKS(MsgBuff->duration); limLog( pMac, LOG2, "Start listen duration = %d", val); if (tx_timer_change( &pMac->lim.limTimers.gLimRemainOnChannelTimer, val, 0) != TX_SUCCESS) { limLog(pMac, LOGP, FL("Unable to change remain on channel Timer val")); goto error; } else if(TX_SUCCESS != tx_timer_activate( &pMac->lim.limTimers.gLimRemainOnChannelTimer)) { limLog(pMac, LOGP, FL("Unable to activate remain on channel Timer")); limDeactivateAndChangeTimer(pMac, eLIM_REMAIN_CHN_TIMER); goto error; } #ifdef WLAN_FEATURE_P2P_INTERNAL //Session is needed to send probe rsp if(eSIR_SUCCESS != limCreateSessionForRemainOnChn(pMac, &pP2pSession)) { limLog( pMac, LOGE, "Unable to create session"); goto error; } #endif if ((limSetLinkState(pMac, eSIR_LINK_LISTEN_STATE, nullBssid, pMac->lim.gSelfMacAddr, limSetLinkStateP2PCallback, NULL)) != eSIR_SUCCESS) { limLog( pMac, LOGE, "Unable to change link state"); goto error; } return FALSE; } } } #endif pMac->lim.gLimPrevMlmState = pMac->lim.gLimMlmState; pMac->lim.gLimMlmState = eLIM_MLM_P2P_LISTEN_STATE; pMac->lim.gTotalScanDuration = MsgBuff->duration; /* 1st we need to suspend link with callback to initiate change channel */ limSuspendLink(pMac, eSIR_CHECK_LINK_TRAFFIC_BEFORE_SCAN, limRemainOnChnlSuspendLinkHdlr, NULL); return FALSE; #ifdef CONC_OPER_AND_LISTEN_CHNL_SAME_OPTIMIZE error: limRemainOnChnRsp(pMac,eHAL_STATUS_FAILURE, NULL); /* pMsg is freed by the caller */ return FALSE; #endif }