VOS_VOID DMS_Init(VOS_VOID)
{
    VOS_UINT32                          ulport;

    VOS_MemSet(g_astDmsSdmInfoTable, 0, sizeof(g_astDmsSdmInfoTable));

    g_stDmsMainInfo.pfnRdDataCallback  = NULL;
    g_stDmsMainInfo.pfnConnectCallBack = NULL;

    /*初始化所有端口的handle*/
    for (ulport = 0; ulport < DMS_PHY_BEAR_LAST; ulport++)
    {
        g_stDmsMainInfo.stPhyProperty[ulport].lPortHandle = UDI_INVALID_HANDLE;
    }

    /*物理通道默认属性,存在多个物理通道有能力对应一个逻辑通道*/
    g_stDmsMainInfo.stPhyProperty[DMS_PHY_BEAR_USB_PCUI].enLogicChan = DMS_CHANNEL_AT;
    g_stDmsMainInfo.stPhyProperty[DMS_PHY_BEAR_USB_CTRL].enLogicChan = DMS_CHANNEL_AT;



    /* 初始化AT通道使用的静态内存 */
    Dms_StaticBufInit();


    DMS_ReadPortDebugCfgNV();

    mdrv_usb_reg_enablecb(DMS_UsbEnableCB);
    mdrv_usb_reg_disablecb(DMS_UsbDisableCB);

    wake_lock_init(&g_stDmsMainInfo.stwakelock, WAKE_LOCK_SUSPEND, "dms_wakelock");

    return;
}
Exemple #2
0
VOS_VOID initDmsMainInfo(VOS_VOID)
{
    VOS_UINT32 ulport;

    VOS_MemSet(g_ast_dsm_debug_info_table, 0, sizeof(g_ast_dsm_debug_info_table));

    /*VOS_MemSet(&g_stDmsMainInfo, 0, sizeof(DMS_MAIN_INFO)); */

    g_stDmsMainInfo.ucDmsVcom1SleepFlag = TRUE;
    g_stDmsMainInfo.ucDmsVcomATSleepFlag = TRUE;
    g_stDmsMainInfo.ucDmsVcomUartSleepFlag = TRUE;
    g_stDmsMainInfo.pfnRdDtaCallback   = NULL;
    g_stDmsMainInfo.pfnConnectCallBack = NULL;

    /*初始化所有端口的handle*/
    for(ulport = 0; ulport < EN_DMS_BEARER_LAST; ulport++)
    {
        g_stDmsMainInfo.stPhyProperty[ulport].slPortHandle = UDI_INVALID_HANDLE;
    }


    /*最终逻辑通道使能的通道属性*/
#if (VOS_WIN32 == VOS_OS_VER)
    g_stDmsMainInfo.stLogicPhy[EN_DMS_CHANNEL_DIAG].aenPhyChan = EN_DMS_BEARER_TCP_20248;
#else
    g_stDmsMainInfo.stLogicPhy[EN_DMS_CHANNEL_DIAG].aenPhyChan =EN_DMS_BEARER_USB_COM1_DIAG_CTRL;
#endif

    /*物理通道默认属性,存在多个物理通道有能力对应一个逻辑通道*/
    g_stDmsMainInfo.stPhyProperty[EN_DMS_BEARER_TCP_20248].aenLogicChan = EN_DMS_CHANNEL_DIAG;
    g_stDmsMainInfo.stPhyProperty[EN_DMS_BEARER_USB_COM1_DIAG_CTRL].aenLogicChan = EN_DMS_CHANNEL_DIAG;
    g_stDmsMainInfo.stPhyProperty[EN_DMS_BEARER_USB_COM2_DIAG_APP].aenLogicChan  = EN_DMS_CHANNEL_DIAG;
    g_stDmsMainInfo.stPhyProperty[EN_DMS_BEARER_USB_COM4_AT].aenLogicChan  = EN_DMS_CHANNEL_AT;
    g_stDmsMainInfo.stPhyProperty[EN_DMS_BEARER_USB_COM_CTRL].aenLogicChan  = EN_DMS_CHANNEL_AT;

    g_stDmsMainInfo.bPortCfgFlg     = FALSE;
    g_stDmsMainInfo.bPortOpenFlg    = FALSE;
    g_stDmsMainInfo.ulPortCfgValue  = DMS_TEST_MODE;

    /*初始化物理通道与SOCP通道的对应关系*/
    initDmsHdlcInit();

    /*初始化AT通道使用的静态内存*/
    Dms_StaticBufInit();

    /* 创建文件 */
    DMS_InitPorCfgFile();
}
VOS_VOID DMS_Init(VOS_VOID)
{
    VOS_UINT32                          ulport;

    VOS_MemSet(g_astDmsSdmInfoTable, 0, sizeof(g_astDmsSdmInfoTable));

    g_stDmsMainInfo.pfnRdDataCallback  = NULL;
    g_stDmsMainInfo.pfnConnectCallBack = NULL;

    /*初始化所有端口的handle*/
    for (ulport = 0; ulport < DMS_PHY_BEAR_LAST; ulport++)
    {
        g_stDmsMainInfo.stPhyProperty[ulport].lPortHandle = UDI_INVALID_HANDLE;
    }

    /*物理通道默认属性,存在多个物理通道有能力对应一个逻辑通道*/
    g_stDmsMainInfo.stPhyProperty[DMS_PHY_BEAR_USB_PCUI].enLogicChan = DMS_CHANNEL_AT;
    g_stDmsMainInfo.stPhyProperty[DMS_PHY_BEAR_USB_CTRL].enLogicChan = DMS_CHANNEL_AT;

    g_stDmsMainInfo.bPortCfgFlg     = VOS_FALSE;
    g_stDmsMainInfo.bPortOpenFlg    = VOS_FALSE;
    g_stDmsMainInfo.ulPortCfgValue  = DMS_TEST_MODE;

    /* 初始化AT通道使用的静态内存 */
    Dms_StaticBufInit();

    /* 创建文件 */
    DMS_InitPorCfgFile();

    /* 创建文件 */
    DMS_InitGetSliceFile();

    DMS_ReadPortDebugCfgNV();

    DRV_USB_REGUDI_ENABLECB(DMS_UsbEnableCB);
    DRV_USB_REGUDI_DISABLECB(DMS_UsbDisableCB);

    wake_lock_init(&g_stDmsMainInfo.stwakelock, WAKE_LOCK_SUSPEND, "dms_wakelock");

    return;
}