eHalStatus csrMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf ) { eHalStatus status = eHAL_STATUS_SUCCESS; tSirSmeRsp *pSmeRsp = (tSirSmeRsp *)pMsgBuf; #ifdef FEATURE_WLAN_SCAN_PNO tSirMbMsg *pMsg = (tSirMbMsg *)pMsgBuf; tCsrRoamSession *pSession; #endif smsLog(pMac, LOG2, FL("Message %d[0x%04X] received in curState %s" " and substate %s sessionId (%d)"), pSmeRsp->messageType, pSmeRsp->messageType, macTraceGetcsrRoamState(pMac->roam.curState[pSmeRsp->sessionId]), macTraceGetcsrRoamSubState( pMac->roam.curSubState[pSmeRsp->sessionId]), pSmeRsp->sessionId); #ifdef FEATURE_WLAN_SCAN_PNO /* * PNO scan responses have to be handled irrespective of CSR roam state. * Check if PNO has been started and only then process the PNO scan results. * Also note that normal scan is not allowed when PNO scan is in progress * and so the scan responses reaching here when PNO is started must be * PNO responses. For normal scan, the PNO started flag will be FALSE and * it will be processed as usual based on the current CSR roam state. */ pSession = CSR_GET_SESSION(pMac, pSmeRsp->sessionId); if(!pSession) { smsLog(pMac, LOGE, FL(" session %d not found, msgType : %d"), pSmeRsp->sessionId, pMsg->type); return eHAL_STATUS_FAILURE; } if((eWNI_SME_SCAN_RSP == pMsg->type) && (TRUE == pSession->pnoStarted)) { status = csrScanningStateMsgProcessor(pMac, pMsgBuf); if (eHAL_STATUS_SUCCESS != status) { smsLog(pMac, LOGE, FL(" handling PNO scan resp msg 0x%X CSR state is %d"), pSmeRsp->messageType, pMac->roam.curState[pSmeRsp->sessionId]); } return (status); } #endif // Process the message based on the state of the roaming states... #if defined( ANI_RTT_DEBUG ) if(!pAdapter->fRttModeEnabled) { #endif//RTT switch (pMac->roam.curState[pSmeRsp->sessionId]) { case eCSR_ROAMING_STATE_SCANNING: { //Are we in scan state #if defined( ANI_EMUL_ASSOC ) emulScanningStateMsgProcessor( pAdapter, pMBBufHdr ); #else status = csrScanningStateMsgProcessor(pMac, pMsgBuf); #endif break; } case eCSR_ROAMING_STATE_JOINED: { //are we in joined state csrRoamJoinedStateMsgProcessor( pMac, pMsgBuf ); break; } case eCSR_ROAMING_STATE_JOINING: { //are we in roaming states #if defined( ANI_EMUL_ASSOC ) emulRoamingStateMsgProcessor( pAdapter, pMBBufHdr ); #endif csrRoamingStateMsgProcessor( pMac, pMsgBuf ); break; } //For all other messages, we ignore it default: { /*To work-around an issue where checking for set/remove key base on connection state is no longer * workable due to failure or finding the condition meets both SAP and infra/IBSS requirement. */ if( (eWNI_SME_SETCONTEXT_RSP == pSmeRsp->messageType) || (eWNI_SME_REMOVEKEY_RSP == pSmeRsp->messageType) ) { smsLog(pMac, LOGW, FL(" handling msg 0x%X CSR state is %d"), pSmeRsp->messageType, pMac->roam.curState[pSmeRsp->sessionId]); csrRoamCheckForLinkStatusChange(pMac, pSmeRsp); } else if(eWNI_SME_GET_RSSI_REQ == pSmeRsp->messageType) { tAniGetRssiReq *pGetRssiReq = (tAniGetRssiReq*)pMsgBuf; if(NULL != pGetRssiReq->rssiCallback) { smsLog(pMac, LOGW, FL("Message eWNI_SME_GET_RSSI_REQ is not handled" " by CSR in state %d. calling RSSI callback"), pMac->roam.curState[pSmeRsp->sessionId]); ((tCsrRssiCallback)(pGetRssiReq->rssiCallback))(pGetRssiReq->lastRSSI, pGetRssiReq->staId, pGetRssiReq->pDevContext); } else { smsLog(pMac, LOGE, FL("pGetRssiReq->rssiCallback is NULL")); } } else { smsLog(pMac, LOGE, "Message 0x%04X is not handled by CSR " " CSR state is %d session Id %d", pSmeRsp->messageType, pMac->roam.curState[pSmeRsp->sessionId], pSmeRsp->sessionId); if (eWNI_SME_FT_PRE_AUTH_RSP == pSmeRsp->messageType) { smsLog(pMac, LOGE, "Dequeue eSmeCommandRoam command" " with reason eCsrPerformPreauth"); csrDequeueRoamCommand(pMac, eCsrPerformPreauth); } else if (eWNI_SME_REASSOC_RSP == pSmeRsp->messageType) { smsLog(pMac, LOGE, "Dequeue eSmeCommandRoam command" " with reason eCsrSmeIssuedFTReassoc"); csrDequeueRoamCommand(pMac, eCsrSmeIssuedFTReassoc); } } break; } }//switch #if defined( ANI_RTT_DEBUG ) } #endif//RTT return (status); }
eHalStatus csrMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf ) { eHalStatus status = eHAL_STATUS_SUCCESS; tSirSmeRsp *pSmeRsp = (tSirSmeRsp *)pMsgBuf; smsLog( pMac, LOG2, " Message %d[0x%04X] received in curState %d and substate %d", pSmeRsp->messageType, pSmeRsp->messageType, pMac->roam.curState[pSmeRsp->sessionId], pMac->roam.curSubState[pSmeRsp->sessionId] ); // #if defined( ANI_RTT_DEBUG ) if(!pAdapter->fRttModeEnabled) { #endif// switch (pMac->roam.curState[pSmeRsp->sessionId]) { case eCSR_ROAMING_STATE_SCANNING: { // #if defined( ANI_EMUL_ASSOC ) emulScanningStateMsgProcessor( pAdapter, pMBBufHdr ); #else status = csrScanningStateMsgProcessor(pMac, pMsgBuf); #endif break; } case eCSR_ROAMING_STATE_JOINED: { // csrRoamJoinedStateMsgProcessor( pMac, pMsgBuf ); break; } case eCSR_ROAMING_STATE_JOINING: { // #if defined( ANI_EMUL_ASSOC ) emulRoamingStateMsgProcessor( pAdapter, pMBBufHdr ); #endif csrRoamingStateMsgProcessor( pMac, pMsgBuf ); break; } // default: { /* */ if( (eWNI_SME_SETCONTEXT_RSP == pSmeRsp->messageType) || (eWNI_SME_REMOVEKEY_RSP == pSmeRsp->messageType) ) { smsLog(pMac, LOGW, FL(" handling msg 0x%X CSR state is %d"), pSmeRsp->messageType, pMac->roam.curState[pSmeRsp->sessionId]); csrRoamCheckForLinkStatusChange(pMac, pSmeRsp); } else { smsLog(pMac, LOGW, " Message 0x%04X is not handled by CSR. CSR state is %d ", pSmeRsp->messageType, pMac->roam.curState[pSmeRsp->sessionId]); } break; } }// #if defined( ANI_RTT_DEBUG ) } #endif// return (status); }
eHalStatus csrMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf ) { eHalStatus status = eHAL_STATUS_SUCCESS; tSirSmeRsp *pSmeRsp = (tSirSmeRsp *)pMsgBuf; #ifdef TRACE_RECORD smsLog(pMac, LOG2, FL("Message %d[0x%04X] received in curState %s" "and substate %s"), pSmeRsp->messageType, pSmeRsp->messageType, macTraceGetcsrRoamState(pMac->roam.curState[pSmeRsp->sessionId]), macTraceGetcsrRoamSubState( pMac->roam.curSubState[pSmeRsp->sessionId])); #endif // Process the message based on the state of the roaming states... #if defined( ANI_RTT_DEBUG ) if(!pAdapter->fRttModeEnabled) { #endif//RTT switch (pMac->roam.curState[pSmeRsp->sessionId]) { case eCSR_ROAMING_STATE_SCANNING: { //Are we in scan state #if defined( ANI_EMUL_ASSOC ) emulScanningStateMsgProcessor( pAdapter, pMBBufHdr ); #else status = csrScanningStateMsgProcessor(pMac, pMsgBuf); #endif break; } case eCSR_ROAMING_STATE_JOINED: { //are we in joined state csrRoamJoinedStateMsgProcessor( pMac, pMsgBuf ); break; } case eCSR_ROAMING_STATE_JOINING: { //are we in roaming states #if defined( ANI_EMUL_ASSOC ) emulRoamingStateMsgProcessor( pAdapter, pMBBufHdr ); #endif csrRoamingStateMsgProcessor( pMac, pMsgBuf ); break; } //For all other messages, we ignore it default: { /*To work-around an issue where checking for set/remove key base on connection state is no longer * workable due to failure or finding the condition meets both SAP and infra/IBSS requirement. */ if( (eWNI_SME_SETCONTEXT_RSP == pSmeRsp->messageType) || (eWNI_SME_REMOVEKEY_RSP == pSmeRsp->messageType) ) { smsLog(pMac, LOGW, FL(" handling msg 0x%X CSR state is %d"), pSmeRsp->messageType, pMac->roam.curState[pSmeRsp->sessionId]); csrRoamCheckForLinkStatusChange(pMac, pSmeRsp); } else { smsLog(pMac, LOGW, " Message 0x%04X is not handled by CSR. CSR state is %d ", pSmeRsp->messageType, pMac->roam.curState[pSmeRsp->sessionId]); } break; } }//switch #if defined( ANI_RTT_DEBUG ) } #endif//RTT return (status); }