Пример #1
0
VOS_UINT32 diag_AgentMsgProcInit(enum VOS_INIT_PHASE_DEFINE ip)
{
    VOS_UINT32 ret = ERR_MSP_SUCCESS;
#if(FEATURE_SOCP_ON_DEMAND == FEATURE_ON)
    DIAG_MSG_SOCP_VOTE_REQ_STRU * voteReq;
#endif

    if (ip == VOS_IP_RESTART)
    {
        DIAG_DEBUG_SDM_FUN(EN_DIAG_DEBUG_AGENT_INIT,ret,0,0);

        /*DIAG SOCP BUF初始化*/
        ret = diag_BufCtrlGlobalInit();
        if(ret != ERR_MSP_SUCCESS)
        {
            DIAG_DEBUG_SDM_FUN(EN_DIAG_DEBUG_AGENT_INIT_ERROR,ret,0,0);
            return ret;
        }

        /*设置DIAG初始化bit*/
        ret = diag_CfgSetGlobalBitValue(&g_ulDiagCfgInfo,DIAG_CFG_INIT_BIT,DIAG_CFG_SWT_OPEN);
        if(ret != ERR_MSP_SUCCESS)
        {
            DIAG_DEBUG_SDM_FUN(EN_DIAG_DEBUG_AGENT_INIT_ERROR,ret,0,1);
            return ret;
        }

#if(FEATURE_SOCP_ON_DEMAND == FEATURE_ON)
#if 0
        if(ERR_MSP_SUCCESS != VOS_SmBCreate(NULL, 0, VOS_SEMA4_FIFO, &g_diagAgentSem))
        {
            diag_printf("[%s]:agent sem init err!\n",__FUNCTION__);
            return ERR_MSP_FAILURE;
        }
#endif
        voteReq = (DIAG_MSG_SOCP_VOTE_REQ_STRU *)VOS_AllocMsg(MSP_PID_DIAG_AGENT,(sizeof(DIAG_MSG_SOCP_VOTE_REQ_STRU) - 20));
        if(voteReq == NULL)
        {
            DIAG_DEBUG_SDM_FUN(EN_DIAG_DEBUG_AGENT_INIT_ERROR,ERR_MSP_FAILURE,2,2);
            return ERR_MSP_FAILURE;
        }

        voteReq->ulReceiverPid = MSP_PID_DIAG_APP_AGENT;
        voteReq->ulSenderPid   = MSP_PID_DIAG_AGENT;
        voteReq->ulLength      = sizeof(DIAG_MSG_SOCP_VOTE_REQ_STRU) - 20;
        voteReq->ulVoteId      = SOCP_VOTE_DIAG_COMM;
        voteReq->ulVoteType    = SOCP_VOTE_FOR_SLEEP;
        ret = VOS_SendMsg(MSP_PID_DIAG_AGENT, voteReq);
        if(ret != ERR_MSP_SUCCESS)
        {
            DIAG_DEBUG_SDM_FUN(EN_DIAG_DEBUG_AGENT_INIT_ERROR,ret,3,2);
            return ret;
        }
#endif
    }
    return ret;
}
Пример #2
0
/*****************************************************************************
 Function Name   : diag_AirCfgProc
 Description     : 该函数用于处理CfgProcEntry传进来的空口开关命令
 Input           : pstReq 待处理数据
 Output          : None
 Return          : VOS_UINT32

 History         :
    1.y00228784      2012-11-22  Draft Enact

*****************************************************************************/
VOS_UINT32 diag_AirCfgProc (VOS_UINT8* pstReq,VOS_UINT32 ulCmdId)
{
    DIAG_CMD_LOG_CAT_AIR_REQ_STRU* pstAirSwtReq = NULL;
    DIAG_CMD_LOG_CAT_AIR_CNF_STRU stAirSwtCnf = {0};
    VOS_UINT32 ret = ERR_MSP_SUCCESS;
    ENUM_DIAG_CFG_SWT_U8 enLSwitch = 0;
    ENUM_DIAG_CFG_SWT_U8 enGuSwitch = 0;
    VOS_UINT32 ulSetRet = 0;/*lint !e958 */

    pstAirSwtReq = (DIAG_CMD_LOG_CAT_AIR_REQ_STRU*)(DIAG_OFFSET_HEAD_GET_DATA(pstReq));/*lint !e958 */

    /*设置LT空口开关值*/
    enLSwitch = DIAG_GET_CFG_SWT(pstAirSwtReq->ulSwitch);
    enGuSwitch = DIAG_GET_CFG_SWT(pstAirSwtReq->ulGuSwitch);

    ulSetRet = diag_CfgSetGlobalBitValue(&g_ulDiagCfgInfo,DIAG_CFG_LT_AIR_BIT,enLSwitch);

    /*设置GU空口开关值*/
    ulSetRet |= diag_CfgSetGlobalBitValue(&g_ulDiagCfgInfo,DIAG_CFG_GU_AIR_BIT,enGuSwitch);

    DIAG_DEBUG_SDM_FUN(EN_DIAG_DEBUG_AIR_CFG, pstAirSwtReq->ulSwitch, ulSetRet, 0);

    if(ERR_MSP_SUCCESS == ulSetRet)
    {
        stAirSwtCnf.ulRc = ERR_MSP_SUCCESS;
    }
    else
    {
        stAirSwtCnf.ulRc = ERR_MSP_FAILURE;
    }

#if(VOS_OS_VER == VOS_LINUX)
    /*组包给FW回复*/
    ret = diag_AgentCnfFun((VOS_UINT8*)&stAirSwtCnf,ulCmdId,sizeof(DIAG_CMD_LOG_CAT_AIR_CNF_STRU));
#endif
    return ret;
}
Пример #3
0
/*****************************************************************************
 Function Name   : diag_EventCfgProc
 Description     : 该函数用于处理CfgProcEntry传进来的事件开关命令
 Input           : pstReq 待处理数据
 Output          : None
 Return          : VOS_UINT32

 History         :
    1.y00228784      2012-11-22  Draft Enact

*****************************************************************************/
VOS_UINT32 diag_EventCfgProc(VOS_UINT8* pstReq,VOS_UINT32 ulCmdId)
{
    DIAG_CMD_LOG_CAT_EVENT_REQ_STRU* pstEvtSwtReq = NULL;
    DIAG_CMD_LOG_CAT_EVENT_CNF_STRU stEvtSwtCnf = {0};
    VOS_UINT32 ret = ERR_MSP_SUCCESS;
    VOS_UINT32 ulSetRet;
    ENUM_DIAG_CFG_SWT_U8 enSwitch =0;

    pstEvtSwtReq = (DIAG_CMD_LOG_CAT_EVENT_REQ_STRU*)(DIAG_OFFSET_HEAD_GET_DATA(pstReq));

    /*设置事件开关值*/
    enSwitch = DIAG_GET_CFG_SWT(pstEvtSwtReq->ulSwitch);
    ulSetRet = diag_CfgSetGlobalBitValue(&g_ulDiagCfgInfo,DIAG_CFG_EVENT_BIT,enSwitch);
    DIAG_DEBUG_SDM_FUN(EN_DIAG_DEBUG_EVENT_CFG, pstEvtSwtReq->ulSwitch, ulSetRet, 0);

    stEvtSwtCnf.ulRc = ulSetRet;
    stEvtSwtCnf.ulSwitch = pstEvtSwtReq->ulSwitch;

#if(VOS_OS_VER == VOS_LINUX)
    /*组包给FW回复*/
    ret = diag_AgentCnfFun((VOS_UINT8*)&stEvtSwtCnf,ulCmdId,sizeof(DIAG_CMD_LOG_CAT_EVENT_CNF_STRU));
#endif
    return ret;
}
Пример #4
0
/*****************************************************************************
 Function Name   : diag_ConnProc
 Description     : 该函数用于处理ConnProcEntry传进来的HSO连接命令
 Input           : pstReq 待处理数据
 Output          : None
 Return          : VOS_UINT32

 History         :
    1.y00228784      2012-11-22  Draft Enact

*****************************************************************************/
VOS_UINT32 diag_ConnProc(VOS_UINT8* pstReq,VOS_UINT32 ulCmdId)
{
    VOS_UINT32 ret      = ERR_MSP_SUCCESS;
    VOS_UINT32 ulCnfRst = ERR_MSP_UNAVAILABLE;
#if (VOS_OS_VER == VOS_LINUX)
    DIAG_CMD_HOST_CONNECT_CNF_STRU stCnf = {0};
    NV_ITEM_PWC_SWITCH_STRU stPwrctrlSwitch = {0};
    VOS_UINT32 ulPwrFlag = 0;
    LPS_SWITCH_PARA_STRU stDrxControlFlag = {0};
    UE_SW_BUILD_VER_INFO_STRU *pstBuildVer =NULL;
    DIAG_CMD_REPLAY_SET_REQ_STRU stReplay= {0};
#endif

    /*重置所有开关状态为未打开*/
    diag_CfgResetAllSwt();

    /*设置连接状态开关值*/
    ulCnfRst = diag_CfgSetGlobalBitValue(&g_ulDiagCfgInfo,DIAG_CFG_CONN_BIT,DIAG_CFG_SWT_OPEN);

    DIAG_DEBUG_SDM_FUN(EN_DIAG_DEBUG_CONN_CFG, ulCnfRst, 0, 0);

#if (VOS_OS_VER == VOS_LINUX)
    VOS_MemSet(&(stCnf.stBuildVersion), 0, sizeof(DIAG_CMD_UE_BUILD_VER_STRU));

    /*获取版本信息*/
    pstBuildVer = BSP_GetBuildVersion();
    if(pstBuildVer!=NULL)
    {
        pstBuildVer->ulProductNo = BSP_HwGetVerMain();
        stCnf.stBuildVersion.usVVerNo        = pstBuildVer->ulVVerNo;
        stCnf.stBuildVersion.usRVerNo        = pstBuildVer->ulRVerNo;
        stCnf.stBuildVersion.usCVerNo        = pstBuildVer->ulCVerNo;
        stCnf.stBuildVersion.usBVerNo        = pstBuildVer->ulBVerNo;
        stCnf.stBuildVersion.usSpcNo         = pstBuildVer->ulSpcNo;
        stCnf.stBuildVersion.usHardwareVerNo = pstBuildVer->ulCustomVer;
        stCnf.stBuildVersion.ulProductNo     = pstBuildVer->ulProductNo;
    }

    /*获取IMEI号*/
    ret = diag_GetImei(stCnf.szImei);
    if(ret)
    {
    }

    /*获取软件版本号*/
    VOS_MemSet(&stCnf.stUeSoftVersion,0,sizeof(DIAG_CMD_UE_SOFT_VERSION_STRU));

    /*获取数采基地址*/
    stCnf.ulChipBaseAddr = (VOS_UINT32)BSP_OM_GetChipType();
    //stCnf.ulChipBaseAddr = (VOS_UINT32)V7R1_PILOT_CHIP;

    /*路测信息获取*/
    ret = NVM_Read(EN_NV_ID_AGENT_FLAG,&(stCnf.stAgentFlag),sizeof(NV_ITEM_AGENT_FLAG_STRU));
    if(ret)
    {
    }

    /*低功耗开关获取*/
    ret = NVM_Read(EN_NV_ID_PWC_SWITCH,&stPwrctrlSwitch,sizeof(NV_ITEM_PWC_SWITCH_STRU));
    if(ret)
    {
    }
    ulPwrFlag = stPwrctrlSwitch.drxLBbpPd;

    ret = NVM_Read(EN_NV_ID_SWITCH_PARA,&stDrxControlFlag,sizeof(stDrxControlFlag));
    if(ret)
    {
    }
    stCnf.ulDrxControlFlag = stDrxControlFlag.ulDrxControlFlag & ulPwrFlag;
    /*lint -save -e40*/

    ulCnfRst |= diag_SendMsg(diag_GetAgentPid(),PS_PID_MM,ID_MSG_DIAG_CMD_REPLAY_TO_PS,(VOS_UINT8*)&stReplay,\
                             sizeof(DIAG_CMD_REPLAY_SET_REQ_STRU));
    /*lint -restore  +e40*/
    /*获取当前存取模式*/
    stCnf.ulLpdMode = diag_GetLogSendType();

    /*处理结果*/
    stCnf.ulRc = ulCnfRst;

    /*组包给FW回复*/
    ret = diag_AgentCnfFun((VOS_UINT8*)&stCnf,ulCmdId,sizeof(DIAG_CMD_HOST_CONNECT_CNF_STRU));
#else
    /*lint -e18 -e718 -e628 -e830 -e746*/
    diag_EnableSocpChan();
    /*lint +e18 +e718 +e628 +e830 +e746*/
#endif
    return ret;
}