/*****************************************************************************
 函 数 名  : OM_ComRx_ICC_Init
 功能描述  : 用于OM在CCPU初始化ICC通道
 输入参数  : 无
 输出参数  : 无
 返 回 值  : VOS_ERR/VOS_OK
 调用函数  :
 被调函数  :
 修改历史  :
   1.日    期  : 2011年3月10日
     作    者  : l46160
     修改内容  : Creat Function
*****************************************************************************/
VOS_UINT32 OM_ComRx_ICC_Init(VOS_VOID)
{
    OM_ICC_UDI_CTRL_STRU                astACPUICCCtrlTable;

    /*初始化 ICC通道*/
    VOS_MemSet((&astACPUICCCtrlTable), 0, sizeof(astACPUICCCtrlTable));

    astACPUICCCtrlTable.pstICCAttr = (ICC_CHAN_ATTR_S*)VOS_MemAlloc(ACPU_PID_OM,
                                                                       STATIC_MEM_PT,
                                                                       sizeof(ICC_CHAN_ATTR_S));
    if(VOS_NULL_PTR == astACPUICCCtrlTable.pstICCAttr)
    {
        return VOS_ERR;             /*分配内存失败单板会重启,因此不需要释放之前已经申请的内存*/
    }

    astACPUICCCtrlTable.enICCId                    = UDI_ICC_GUOM0;

    astACPUICCCtrlTable.pstICCAttr->u32Priority    = OM_ICC_CHANNEL_PRIORITY;
    astACPUICCCtrlTable.pstICCAttr->u32TimeOut     = OM_ICC_HANDSHAKE_TIME_MAX;
    astACPUICCCtrlTable.pstICCAttr->u32FIFOInSize  = OM_ICC_BUFFER_SIZE;
    astACPUICCCtrlTable.pstICCAttr->u32FIFOOutSize = OM_ICC_BUFFER_SIZE;
    astACPUICCCtrlTable.pstICCAttr->enChanMode     = ICC_CHAN_MODE_PACKET;
    astACPUICCCtrlTable.pstICCAttr->event_cb       = GU_OamAcpu_ICCError_CB;
    astACPUICCCtrlTable.pstICCAttr->write_cb       = VOS_NULL_PTR;

    if(VOS_ERROR == DRV_ICC_OPEN(astACPUICCCtrlTable.enICCId, astACPUICCCtrlTable.pstICCAttr))
    {
        /* 打开失败时记录当前ICC通道信息 */
        VOS_ProtectionReboot(OM_APP_ICC_INIT_ERROR, THIS_FILE_ID, __LINE__,VOS_NULL_PTR,0);

        return VOS_ERR;
    }

    return VOS_OK;
}
Пример #2
0
VOS_UINT32 VOS_ICC_Init(VOS_VOID)
{
   OM_ICC_UDI_CTRL_STRU                astCCPUICCCtrlTable;

    /*初始化 ICC通道*/
    /*lint -e534*/
    VOS_MemSet((&astCCPUICCCtrlTable), 0, sizeof(astCCPUICCCtrlTable));
    /*lint +e534*/

    astCCPUICCCtrlTable.pstICCAttr = (ICC_CHAN_ATTR_S*)VOS_MemAlloc(CCPU_PID_PAM_OM,
                                                              STATIC_MEM_PT,
                                                              sizeof(ICC_CHAN_ATTR_S));
    if(VOS_NULL_PTR == astCCPUICCCtrlTable.pstICCAttr)
    {
        return VOS_ERR;
    }

    astCCPUICCCtrlTable.enICCId               = UDI_ICC_GUOM4;
    astCCPUICCCtrlTable.pstICCAttr->read_cb   = V_ICC_OSAMsg_CB;

    astCCPUICCCtrlTable.pstICCAttr->u32Priority    = OM_ICC_CHANNEL_PRIORITY;  /* 统一使用最高优先级 */
    astCCPUICCCtrlTable.pstICCAttr->u32TimeOut     = OM_ICC_HANDSHAKE_TIME_MAX;
    astCCPUICCCtrlTable.pstICCAttr->u32FIFOInSize  = OSA_ICC_BUFFER_SIZE;
    astCCPUICCCtrlTable.pstICCAttr->u32FIFOOutSize = OSA_ICC_BUFFER_SIZE;
    astCCPUICCCtrlTable.pstICCAttr->enChanMode     = ICC_CHAN_MODE_PACKET;
    astCCPUICCCtrlTable.pstICCAttr->event_cb       = VOS_ICCError_CB;
    astCCPUICCCtrlTable.pstICCAttr->write_cb       = VOS_NULL_PTR;

    if (VOS_ERROR == DRV_ICC_OPEN(astCCPUICCCtrlTable.enICCId, astCCPUICCCtrlTable.pstICCAttr))
    {
        /* 打开失败时记录当前ICC通道信息 */
        VOS_ProtectionReboot(OM_APP_ICC_INIT_ERROR, THIS_FILE_ID, __LINE__, VOS_NULL_PTR,0);
        return VOS_ERR;
    }

    VOS_IccDebugInfoInit();

    return VOS_OK;
}