VOS_VOID GU_OamPortCloseProc(OM_PROT_HANDLE_ENUM_UINT32 enHandle, CPM_PHY_PORT_ENUM_UINT32 enPhyPort) { g_stAcpuDebugInfo.astPortInfo[enHandle].ulUSBCloseNum++; g_stAcpuDebugInfo.astPortInfo[enHandle].ulUSBCloseSlice = OM_GetSlice(); if (enPhyPort == CPM_QueryPhyPort(CPM_OM_COMM)) { GU_OamDisconnectPorts(enPhyPort); g_stAcpuPcToUeSucRecord.stRlsInfo.ulRlsPortClose++; g_stAcpuPcToUeSucRecord.stRlsInfo.ulSlice = OM_GetSlice(); } if (VOS_ERROR != g_astOMPortUDIHandle[enHandle]) { DRV_UDI_CLOSE(g_astOMPortUDIHandle[enHandle]); g_astOMPortUDIHandle[enHandle] = VOS_ERROR; g_stAcpuDebugInfo.astPortInfo[enHandle].ulUSBCloseOkNum++; g_stAcpuDebugInfo.astPortInfo[enHandle].ulUSBCloseOkSlice = OM_GetSlice(); } return; }
VOS_UINT32 DMS_UsbPortClose(DMS_PHY_BEAR_ENUM enPhyBear) { DMS_PHY_BEAR_PROPERTY_STRU *pstPhyBearProp = NULL; VOS_INT32 lRet = ERR_MSP_SUCCESS; DMS_LOG_INFO("DMS_UsbPortClose[%d]: Enter.\n", enPhyBear); pstPhyBearProp = DMS_GetPhyBearProperty(enPhyBear); if (UDI_INVALID_HANDLE == pstPhyBearProp->lPortHandle) { DMS_LOG_WARNING("DMS_UsbPortClose[%d]: Already close.\n", enPhyBear); return ERR_MSP_SUCCESS; } DMS_DBG_SDM_FUN((DMS_SDM_MSG_ID_ENUM)(DMS_SDM_VCOM_CLOSE_BEGIN + (VOS_UINT32)enPhyBear),\ 0, 0, 0); lRet = DRV_UDI_CLOSE(pstPhyBearProp->lPortHandle); if (lRet == ERR_MSP_SUCCESS) { DMS_LOG_INFO("DMS_UsbPortClose[%d]: Close success.\n", enPhyBear); pstPhyBearProp->lPortHandle = UDI_INVALID_HANDLE; pstPhyBearProp->ucChanStat = ACM_EVT_DEV_SUSPEND; return (VOS_UINT32)lRet; } DMS_LOG_INFO("DMS_UsbPortClose[%d]: Close fail.\n", enPhyBear); DMS_DBG_SDM_FUN((DMS_SDM_MSG_ID_ENUM)(DMS_SDM_VCOM_CLOSE_ERR_BEGIN + (VOS_UINT32)enPhyBear),\ (VOS_UINT32)lRet, 0, 0); return ERR_MSP_FAILURE; }
VOS_VOID PPM_PortCloseProc(OM_PROT_HANDLE_ENUM_UINT32 enHandle, CPM_PHY_PORT_ENUM_UINT32 enPhyPort) { VOS_ULONG ulLockLevel; OM_LOGIC_CHANNEL_ENUM_UINT32 enChannel; VOS_BOOL ulSndMsg; g_stAcpuDebugInfo.astPortInfo[enHandle].ulUSBCloseNum++; g_stAcpuDebugInfo.astPortInfo[enHandle].ulUSBCloseSlice = OM_GetSlice(); if (VOS_ERROR == g_astOMPortUDIHandle[enHandle]) { return; } DRV_UDI_CLOSE(g_astOMPortUDIHandle[enHandle]); g_astOMPortUDIHandle[enHandle] = VOS_ERROR; g_stAcpuDebugInfo.astPortInfo[enHandle].ulUSBCloseOkNum++; g_stAcpuDebugInfo.astPortInfo[enHandle].ulUSBCloseOkSlice = OM_GetSlice(); VOS_SpinLockIntLock(&g_stPpmPortSwitchSpinLock, ulLockLevel); ulSndMsg = VOS_FALSE; enChannel = OM_LOGIC_CHANNEL_BUTT; /* CFG端口处理GU和TL的端口断开,发消息到GU和TL去处理,但不断开CPM的关联 */ if (OM_USB_CFG_PORT_HANDLE == enHandle) { if (enPhyPort == CPM_QueryPhyPort(CPM_OM_CFG_COMM)) { ulSndMsg = VOS_TRUE; enChannel = OM_LOGIC_CHANNEL_CNF; } } /* IND端口断开时发消息到GU和TL去处理,但不断开CPM的关联 */ else if (OM_USB_IND_PORT_HANDLE == enHandle) { if (enPhyPort == CPM_QueryPhyPort(CPM_OM_IND_COMM)) { ulSndMsg = VOS_TRUE; enChannel = OM_LOGIC_CHANNEL_IND; } } else { } VOS_SpinUnlockIntUnlock(&g_stPpmPortSwitchSpinLock, ulLockLevel); if (VOS_TRUE == ulSndMsg) { PPM_DisconnectAllPort(enChannel); } return; }
VOS_VOID CBTPPM_OamUsbCbtPortClose(VOS_VOID) { if (VOS_ERROR == g_ulCbtPortUDIHandle) { return; } DRV_UDI_CLOSE(g_ulCbtPortUDIHandle); g_ulCbtPortUDIHandle = VOS_ERROR; /* CBT端口从USB或VCOM切换到UART时接收函数指针为空,收到USB状态变更时不做断开处理 */ if (VOS_NULL_PTR == CBTCPM_GetRcvFunc()) { return; } PPM_DisconnectGUPort(OM_LOGIC_CHANNEL_CBT); return; }