Ejemplo n.º 1
0
VOS_UINT32 CBTPPM_OamUsbCbtPortInit(VOS_VOID)
{
    /* CBT端口与PCVOICE复用,动态注册数据接收函数 */
    CBTCPM_PortRcvReg(CBTSCM_SoftDecodeDataRcv);

    /* 动态注册数据发送函数 */
    CBTCPM_PortSndReg(CBTPPM_OamUsbCbtSendData);

    /* USB承载的CBT端口,调用底软的异步接口发送数据,现在需要伪造成同步接口,申请信号量 */
    if(VOS_OK != VOS_SmCCreate("UCBT", 0, VOS_SEMA4_FIFO, &g_ulCbtUsbPseudoSyncSemId))
    {
        LogPrint("\r\n CBTPPM_OamUsbCbtPortInit: create g_ulCbtUsbPseudoSyncSemId failedd\r\n");

        return VOS_ERR;
    }

    /* USB承载的CBT端口初始化UDI设备句柄 */
    g_ulCbtPortUDIHandle = VOS_ERROR;

    /* CBT端口通过CBT的CPM管理,不注册物理发送函数 */
    DRV_USB_REGUDI_ENABLECB((USB_UDI_ENABLE_CB_T)CBTPPM_OamUsbCbtPortOpen);

    DRV_USB_REGUDI_DISABLECB((USB_UDI_DISABLE_CB_T)CBTPPM_OamUsbCbtPortClose);

    return VOS_OK;
}
Ejemplo n.º 2
0
VOS_VOID GU_OamAppPortInit(VOS_VOID)
{
    DRV_USB_REGUDI_ENABLECB((USB_UDI_ENABLE_CB_T)GU_OamAppPortOpen);

    DRV_USB_REGUDI_DISABLECB((USB_UDI_DISABLE_CB_T)GU_OamAppPortClose);

    CPM_PhySendReg(CPM_APP_PORT,  GU_OamAppSendData);

    return;
}
Ejemplo n.º 3
0
VOS_UINT32 diag_UsbInit(VOS_VOID)
{
    /*global info init*/
    diag_UsbInfo_Init();

	/* 注册USB通道打开与关闭回调*/
	DRV_USB_REGUDI_ENABLECB(diag_UsbOpen);
    DRV_USB_REGUDI_DISABLECB(diag_UsbClose);
    DIAG_PORT_INIT_STATE_SWITCH(EN_DIAG_USB_BEARER_DIAG_CTRL,EN_PORT_INIT_SUCC);
    DIAG_PORT_INIT_STATE_SWITCH(EN_DIAG_USB_BEARER_DIAG_APP,EN_PORT_INIT_SUCC);
    return ERR_MSP_SUCCESS;
}
Ejemplo n.º 4
0
VOS_VOID GU_OamCtrlPortInit(VOS_VOID)
{
    DRV_USB_REGUDI_ENABLECB((USB_UDI_ENABLE_CB_T)GU_OamCtrlPortOpen);

    DRV_USB_REGUDI_DISABLECB((USB_UDI_DISABLE_CB_T)GU_OamCtrlPortClose);

    GU_OamCtrlPortOpen();   /*当前切换的时候USB一定是连接的*/

    CPM_PhySendReg(CPM_CTRL_PORT,  GU_OamCtrlSendData);

    g_GUOmOnCtrlPort = VOS_TRUE;

    return;
}
Ejemplo n.º 5
0
VOS_UINT32 PPM_UsbIndPortInit(VOS_VOID)
{
    /* USB承载的OM IND端口,调用底软的异步接口发送数据,现在需要伪造成同步接口,申请信号量 */
    if(VOS_OK != VOS_SmCCreate("UIND", 0, VOS_SEMA4_FIFO, &g_stUsbIndPseudoSync.ulPseudoSyncSemId))
    {
        LogPrint("\r\nPPM_UsbIndPortInit: create g_stUsbIndPseudoSync.ulPseudoSyncSemId failedd\r\n");

        return VOS_ERR;
    }

    DRV_USB_REGUDI_ENABLECB((USB_UDI_ENABLE_CB_T)PPM_UsbIndPortOpen);

    DRV_USB_REGUDI_DISABLECB((USB_UDI_DISABLE_CB_T)PPM_UsbIndPortClose);

    CPM_PhySendReg(CPM_IND_PORT,  PPM_UsbIndSendData);

    return VOS_OK;
}
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;
}