/*------------------------------------------------------------------ * * Below function is callback function, it is called when * WDA_SET_LINK_STATE_RSP is received from WDI. callback function for * P2P of limSetLinkState * *------------------------------------------------------------------*/ void limSetLinkStateP2PCallback(tpAniSirGlobal pMac, void *callbackArg) { tSirRemainOnChnReq *MsgRemainonChannel = pMac->lim.gpLimRemainOnChanReq; //Send Ready on channel indication to SME if(pMac->lim.gpLimRemainOnChanReq) { limSendSmeRsp(pMac, eWNI_SME_REMAIN_ON_CHN_RDY_IND, eHAL_STATUS_SUCCESS, pMac->lim.gpLimRemainOnChanReq->sessionId, 0); if(pMac->lim.gDebugP2pRemainOnChannel) { if( eHAL_STATUS_SUCCESS == limPrepareAndSendStartRemainOnChannelMsg( pMac, MsgRemainonChannel, REMAIN_ON_CHANNEL_SECOND_MARKER_FRAME) ) { limLog( pMac, LOGE, "%s: Successfully sent 2nd Marker frame " "seq num = %d on start ROC", __func__, pMac->lim.remOnChnSeqNum); } } } else { //This is possible in case remain on channel is aborted limLog( pMac, LOGE, FL(" NULL pointer of gpLimRemainOnChanReq") ); } }
/*------------------------------------------------------------------ * * Below function is callback function, it is called when * WDA_SET_LINK_STATE_RSP is received from WDI. callback function for * P2P of limSetLinkState * *------------------------------------------------------------------*/ void limSetLinkStateP2PCallback(tpAniSirGlobal pMac, void *callbackArg) { //Send Ready on channel indication to SME if(pMac->lim.gpLimRemainOnChanReq) { limSendSmeRsp(pMac, eWNI_SME_REMAIN_ON_CHN_RDY_IND, eHAL_STATUS_SUCCESS, pMac->lim.gpLimRemainOnChanReq->sessionId, 0); } else { //This is possible in case remain on channel is aborted limLog( pMac, LOGE, FL(" NULL pointer of gpLimRemainOnChanReq") ); } }
/*------------------------------------------------------------------ * * Remain on channel req handler. Initiate the INIT_SCAN, CHN_CHANGE * and SET_LINK Request from SME, chnNum and duration to remain on channel. * *------------------------------------------------------------------*/ 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 */ tSirRemainOnChnReq *MsgBuff = (tSirRemainOnChnReq *)pMsg; pMac->lim.gpLimRemainOnChanReq = MsgBuff; if (pMac->fP2pListenOffload) { eHalStatus status; status = limSendHalReqRemainOnChanOffload(pMac, MsgBuff); if (status != eHAL_STATUS_SUCCESS) { /* Post the meessage to Sme */ limSendSmeRsp(pMac, eWNI_SME_REMAIN_ON_CHN_RSP, status, MsgBuff->sessionId, 0); vos_mem_free(pMac->lim.gpLimRemainOnChanReq); pMac->lim.gpLimRemainOnChanReq = NULL; } return FALSE; } 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; }