VOS_VOID CMMCA_LogBuffFullInd(VOS_VOID) { CMMCA_MNTN_BUFF_FULL_IND_STRU *pstMsg = VOS_NULL_PTR; pstMsg = (CMMCA_MNTN_BUFF_FULL_IND_STRU*)PS_MEM_ALLOC(WUEPS_PID_CMMCA, sizeof(CMMCA_MNTN_BUFF_FULL_IND_STRU)); if (VOS_NULL_PTR == pstMsg) { CMMCA_ERROR_LOG("CMMCA_LogBuffFullInd:ERROR:Alloc Mem Fail."); return; } pstMsg->ulReceiverCpuId = VOS_LOCAL_CPUID; pstMsg->ulSenderCpuId = VOS_LOCAL_CPUID; pstMsg->ulSenderPid = WUEPS_PID_CMMCA; pstMsg->ulReceiverPid = WUEPS_PID_CMMCA; pstMsg->ulLength = sizeof(CMMCA_MNTN_BUFF_FULL_IND_STRU) - VOS_MSG_HEAD_LENGTH; pstMsg->enMsgId = CMMCA_MNTN_BUFF_FULL_IND; OM_TraceMsgHook(pstMsg); PS_MEM_FREE(WUEPS_PID_CMMCA, pstMsg); return; }
VOS_VOID CMMCA_DEBUG_TraceEvent(VOS_VOID *pMsg) { if (VOS_OK != OM_TraceMsgHook(pMsg)) { CMMCA_ERROR_LOG("CMMCA_DEBUG_TraceEvent: Trace MSG Fail!\r\n"); } return; }
VOS_VOID CMMCA_RcvCbpcaMsg(struct MsgCB *pstMsg) { /* 定义消息头指针*/ CBPCA_DATA_IND_MSG_STRU *pstDataInd = VOS_NULL_PTR; CMMCA_MMC_RAT_CMD_DATA_STRU *pstCmdData = VOS_NULL_PTR; CMMCA_CBPCA_MSG_PROC_FUNC pProcMsgFunc = VOS_NULL_PTR; VOS_UINT32 ulIndex; /* 获取消息头指针*/ pstDataInd = (CBPCA_DATA_IND_MSG_STRU *)pstMsg; if (CBPCA_CMMCA_DATA_IND != pstDataInd->enMsgType) { CMMCA_ERROR_LOG("CMMCA_RcvCbpcaMsg: not data ind"); return; } pstCmdData = (CMMCA_MMC_RAT_CMD_DATA_STRU *)(pstDataInd->aucData); /* 查表g_astCmmcaMsgProcCbpcaTab找pstCmdData->enCmdId对应的处理函数,参数类型为CMMCA_MMC_RAT_CMD_DATA_STRU */ for (ulIndex = 0; ulIndex < g_ulCmmcaMsgProcCbpcaTabSize; ulIndex++) { if (g_astCmmcaMsgProcCbpcaTab[ulIndex].ulCmdId == pstCmdData->enCmdId) { /* Cmd Id 匹配 */ pProcMsgFunc = g_astCmmcaMsgProcCbpcaTab[ulIndex].pProcMsgFunc; break; } } /* 如果处理函数存在则调用 */ if ( VOS_NULL_PTR != pProcMsgFunc ) { pProcMsgFunc(pstDataInd); } else { CMMCA_ERROR_LOG("CMMCA_RcvCbpcaMsg: proc msg func is null"); } return; }
VOS_VOID CMMCA_RcvErrcMsg(struct MsgCB *pstMsg) { LRRC_CMMCA_CDMA_MSG_IRAT_MEAS_REQ_STRU *pstIratMeasReq = VOS_NULL_PTR; CMMCA_MMC_RAT_CMD_ID_ENUM_UINT16 enCmdIdFromMsgId; CMMCA_MMC_RAT_CMD_ID_ENUM_UINT16 enCmdIdInData; VOS_UINT32 ulRslt; enCmdIdFromMsgId = ID_CMMCA_RAT_MMC_CMD_MAX; /* ERRC回复给CMMCA的消息pstMsg,其结构体为LRRC_CMMCA_CDMA_MSG_IRAT_MEAS_REQ_STRU */ pstIratMeasReq = (LRRC_CMMCA_CDMA_MSG_IRAT_MEAS_REQ_STRU *)pstMsg; ulRslt = CMMCA_GetCmdIdFromErrcMsgId(pstIratMeasReq->enMsgId, &enCmdIdFromMsgId); if (VOS_OK != ulRslt) { CMMCA_ERROR_LOG("CMMCA_RcvErrcMsg: Not find Cmd Id "); return; } enCmdIdInData = *((CMMCA_MMC_RAT_CMD_ID_ENUM_UINT16 *)(pstIratMeasReq->aucMsgData)); /* 检查根据MsgId计算出来的CmdId跟Errc实际传来的CmdId是否一致 */ if (enCmdIdFromMsgId != enCmdIdInData) { CMMCA_ERROR_LOG("CMMCA_RcvErrcMsg: MsgId and CmdId don't match "); return; } /* 调用CBPCA模块接口将数据发送到CBPCA */ ulRslt = CBPCA_SndDataToCbpca(WUEPS_PID_CMMCA, CMMCA_CBPCA_DATA_REQ, (VOS_UINT8 *)(pstIratMeasReq->aucMsgData), pstIratMeasReq->ulLen); if (VOS_OK != ulRslt) { CMMCA_ERROR_LOG("CMMCA_RcvErrcMsg: send Msg to Cbpca fail"); } return; }
VOS_VOID CMMCA_RcvTimerMsg(struct MsgCB *pstMsg) { /* 定义消息头指针*/ REL_TIMER_MSG *pstTiMsg = VOS_NULL_PTR; CMMCA_TIMER_MSG_PROC_FUNC pProcMsgFunc = VOS_NULL_PTR; VOS_UINT32 ulIndex; /* 获取消息头指针*/ pstTiMsg = (REL_TIMER_MSG *)pstMsg; /* 停止定时器 */ CMMCA_StopTimer(WUEPS_PID_CMMCA, pstTiMsg->ulName); /* 查表g_astCmmcaMsgProcTimerTab */ for (ulIndex = 0; ulIndex < g_ulCmmcaMsgProcTimerTabSize; ulIndex++) { if (g_astCmmcaMsgProcTimerTab[ulIndex].enTimerId == pstTiMsg->ulName) { /* Timer Id 匹配 */ pProcMsgFunc = g_astCmmcaMsgProcTimerTab[ulIndex].pProcMsgFunc; break; } } /* 如果处理函数存在则调用 */ if ( VOS_NULL_PTR != pProcMsgFunc ) { pProcMsgFunc(pstTiMsg); } else { CMMCA_ERROR_LOG("CMMCA_RcvTimerMsg: proc msg func is null"); } return; }
VOS_VOID CMMCA_StartTimer( VOS_UINT32 ulPid, CMMCA_TIMER_ID_ENUM_UINT32 enTimerId, VOS_UINT32 ulLen, VOS_UINT32 ulParam ) { VOS_UINT32 i; VOS_UINT32 ulRet; CMMCA_TIMER_CTX_STRU *pstTiCtx; VOS_TIMER_PRECISION_ENUM_UINT32 enTmrPrecision; /* 输入参数检查 */ if (0 == ulLen) { CMMCA_ERROR1_LOG("CMMCA_StartTimer:ulLen is", ulLen); return; } if (ulLen >= VOS_TIMER_MAX_LENGTH) { ulLen = VOS_TIMER_MAX_LENGTH - 1; } pstTiCtx = CMMCA_GetTiCtx(); /* 如果该定时器已经启动则直接返回 */ for (i = 0; i < CMMCA_MAX_TIMER_NUM; i++) { if ((CMMCA_TIMER_STATUS_RUNNING == pstTiCtx[i].enTimerStatus) && (enTimerId == pstTiCtx[i].enTimerId)) { return; } } /* 找到一个空闲位置 */ for (i = 0; i < CMMCA_MAX_TIMER_NUM; i++) { if (CMMCA_TIMER_STATUS_STOP == pstTiCtx[i].enTimerStatus ) { break; } } /* 未找到空闲位置,无法保存该定时器信息,直接返回 */ if (i >= CMMCA_MAX_TIMER_NUM) { CMMCA_ERROR1_LOG("CMMCA_StartTimer:i is",i); return; } enTmrPrecision = CMMCA_GetTimerPrecision(enTimerId); ulRet = VOS_StartRelTimer(&(pstTiCtx[i].hTimer), ulPid, ulLen, enTimerId, ulParam, VOS_RELTIMER_NOLOOP, enTmrPrecision); if (VOS_OK != ulRet) { CMMCA_ERROR_LOG("CMMCA_StartTimer:timer is fail start!"); return; } pstTiCtx[i].enTimerId = enTimerId; pstTiCtx[i].enTimerStatus = CMMCA_TIMER_STATUS_RUNNING; /* 勾包CMMCA_TIMER_INFO_STRU */ CMMCA_MNTN_TraceTimerOperation(ulPid, enTimerId, ulLen, CMMCA_TIMER_OPERATION_START); return; }