LOCAL BSP_S32 udiUartAdpOpen(UDI_OPEN_PARAM *param, UDI_HANDLE handle) { BSP_U8* pstrName; BSP_U32 u32Type; BSP_S32 s32Fd; UDI_UNUSED_PARAM(handle); u32Type = UDI_GET_DEV_TYPE(param->devid); if (u32Type > UDI_GET_UART_NUM()-1) { bsp_trace(BSP_LOG_LEVEL_ERROR, BSP_MODU_UDI, "Invalid UART Num:%d, line:%d\n", u32Type, __LINE__, 0,0,0,0); return ERROR; } pstrName = (BSP_U8*)sg_UartNameTbl[u32Type]; s32Fd = open((char*)pstrName, O_RDWR, 0);/* [false alarm]:Disable fortify false alarm */ /* coverity[off_by_one] */ if (s32Fd <= 0) { /* coverity[noescape] */ bsp_trace(BSP_LOG_LEVEL_ERROR, BSP_MODU_UDI, "open %s fail, ret:%d line:%d\n", pstrName, s32Fd, __LINE__, 0,0,0); return ERROR; } /* coverity[leaked_handle] */ (BSP_VOID)BSP_UDI_SetPrivate(param->devid, (VOID*)s32Fd);/* [false alarm]:Disable fortify false alarm */ return OK; }
static BSP_S32 udiNcmAdpCtrlOpen(UDI_OPEN_PARAM *param, UDI_HANDLE handle) { BSP_U32 u32NcmDevId; BSP_U32 u32Ret; /*modify bsp_ncm_open ,add by wangweichao*/ BSP_U32 u32ChanId; UDI_UNUSED_PARAM(handle); u32ChanId = UDI_GET_DEV_TYPE(param->devid); u32NcmDevId = UDI2NCM_ID(u32ChanId); u32Ret = bsp_ncm_open(NCM_DEV_CTRL_TYPE, u32NcmDevId); (BSP_VOID)BSP_UDI_SetPrivate(param->devid, (VOID*)u32NcmDevId); return (BSP_S32)u32Ret; }
static BSP_S32 udiNcmAdpOpen(UDI_OPEN_PARAM *param, UDI_HANDLE handle) { BSP_U32 u32NcmDevId = 0; BSP_U32 u32Ret; BSP_U32 u32ChanId; UDI_UNUSED_PARAM(handle); u32ChanId = UDI_GET_DEV_TYPE(param->devid); u32NcmDevId = UDI2NCM_ID(u32ChanId); u32Ret = bsp_ncm_open(NCM_DEV_DATA_TYPE, u32NcmDevId); (BSP_VOID)BSP_UDI_SetPrivate(param->devid, (VOID*)u32NcmDevId); sg_chnNcmDataHandleTbl[u32NcmDevId] = handle; /*lint !e732*/ return (BSP_S32)u32Ret; }
static BSP_S32 udiAcmAdpOpen(UDI_OPEN_PARAM *param, UDI_HANDLE handle) { //BSP_U8* pstrName; BSP_U32 u32Type; BSP_S32 s32Fd; UDI_UNUSED_PARAM(handle); u32Type = UDI_GET_DEV_TYPE(param->devid); s32Fd = bsp_acm_open(u32Type); if (IS_ERR((void*)s32Fd)) { return ERROR; } (BSP_VOID)BSP_UDI_SetPrivate(param->devid, (VOID*)s32Fd); return OK; }
static BSP_S32 udiAcmAdpOpen(UDI_OPEN_PARAM *param, UDI_HANDLE handle) { //BSP_U8* pstrName; BSP_U32 u32Type; BSP_PVOID filep; UDI_UNUSED_PARAM(handle); u32Type = UDI_GET_DEV_TYPE(param->devid); filep = bsp_acm_open(u32Type); if (filep == NULL) { return ERROR; } (BSP_VOID)BSP_UDI_SetPrivate(param->devid, filep); return OK; }
static BSP_S32 udiNcmAdpCtrlOpen(UDI_OPEN_PARAM *param, UDI_HANDLE handle) { BSP_U32 u32NcmDevId; BSP_U32 u32ChanId; void* pCtrl; UDI_UNUSED_PARAM(handle); u32ChanId = UDI_GET_DEV_TYPE(param->devid); u32NcmDevId = UDI2NCM_ID(u32ChanId); pCtrl = bsp_ncm_open(NCM_DEV_CTRL_TYPE, u32NcmDevId); if (!pCtrl) { (BSP_VOID)BSP_UDI_SetPrivate(param->devid, pCtrl); return 0; } return -EINVAL; }
static BSP_S32 udiNcmAdpOpen(UDI_OPEN_PARAM *param, UDI_HANDLE handle) { BSP_U32 u32NcmDevId = 0; BSP_U32 u32ChanId; void* pCtrl; UDI_UNUSED_PARAM(handle); u32ChanId = UDI_GET_DEV_TYPE(param->devid); u32NcmDevId = UDI2NCM_ID(u32ChanId); pCtrl = bsp_ncm_open(NCM_DEV_DATA_TYPE, u32NcmDevId); if (!pCtrl) { BSP_UDI_SetPrivate(param->devid, pCtrl); sg_chnNcmDataHandleTbl[u32NcmDevId] = handle; /*lint !e732*/ return 0; } return -EINVAL; }
static BSP_S32 udiNcmAdpWrite(VOID* pPrivate, VOID* pMemObj, BSP_S32 s32Size) { UDI_UNUSED_PARAM(s32Size); return (BSP_S32)bsp_ncm_write((BSP_U32)pPrivate, pMemObj, NULL); }