Lines Matching refs:port

201 UsbdRequestSync *UsbdDispatcher::UsbdFindRequestSync(HostDevice *port, uint8_t interfaceId, uint8_t…  in UsbdFindRequestSync()  argument
203 if (port == nullptr) { in UsbdFindRequestSync()
211 OsalMutexLock(&port->reqSyncLock); in UsbdFindRequestSync()
212 HdfSListIteratorInit(&it, &port->reqSyncList); in UsbdFindRequestSync()
223 OsalMutexUnlock(&port->reqSyncLock); in UsbdFindRequestSync()
264 HostDevice *port, UsbInterfaceHandle *ifHandle, UsbPipeInfo *pipe, UsbdRequestSync *requestSync) in UsbdRequestSyncInit() argument
266 if (port == nullptr || requestSync == nullptr || ifHandle == nullptr || pipe == nullptr) { in UsbdRequestSyncInit()
284 requestSync->params.userData = port; in UsbdRequestSyncInit()
285 OsalMutexLock(&port->reqSyncLock); in UsbdRequestSyncInit()
286 HdfSListAdd(&port->reqSyncList, &requestSync->node); in UsbdRequestSyncInit()
287 OsalMutexUnlock(&port->reqSyncLock); in UsbdRequestSyncInit()
291 int32_t UsbdDispatcher::UsbdRequestSyncInitwithLength(HostDevice *port, UsbInterfaceHandle *ifHandl… in UsbdRequestSyncInitwithLength() argument
294 if (port == nullptr || requestSync == nullptr || ifHandle == nullptr || pipe == nullptr) { in UsbdRequestSyncInitwithLength()
312 requestSync->params.userData = port; in UsbdRequestSyncInitwithLength()
313 OsalMutexLock(&port->reqSyncLock); in UsbdRequestSyncInitwithLength()
314 HdfSListAdd(&port->reqSyncList, &requestSync->node); in UsbdRequestSyncInitwithLength()
315 OsalMutexUnlock(&port->reqSyncLock); in UsbdRequestSyncInitwithLength()
492 void UsbdDispatcher::RemoveDevFromService(UsbImpl *service, HostDevice *port) in RemoveDevFromService() argument
494 if (service == nullptr || port == nullptr) { in RemoveDevFromService()
508 if (tempPort->busNum == port->busNum && tempPort->devAddr == port->devAddr) { in RemoveDevFromService()
748 HostDevice *port, UsbInterfaceHandle *ifHandle, UsbPipeInfo *pipe, UsbdRequestASync *request) in UsbdRequestASyncInit() argument
750 if (port == nullptr || request == nullptr || ifHandle == nullptr || pipe == nullptr) { in UsbdRequestASyncInit()
768 OsalMutexLock(&port->reqASyncLock); in UsbdRequestASyncInit()
769 HdfSListAddTail(&port->reqASyncList, &request->node); in UsbdRequestASyncInit()
770 OsalMutexUnlock(&port->reqASyncLock); in UsbdRequestASyncInit()
775 HostDevice *port, uint8_t interfaceId, uint8_t pipeAddr) in UsbdRequestASyncCreatAndInsert() argument
783 int32_t ret = GetPipe(port, interfaceId, pipeAddr, &pipe); in UsbdRequestASyncCreatAndInsert()
790 UsbInterfaceHandle *ifHandle = UsbImpl::InterfaceIdToHandle(port, interfaceId); in UsbdRequestASyncCreatAndInsert()
801 ret = UsbdRequestASyncInit(port, ifHandle, &pipe, req); in UsbdRequestASyncCreatAndInsert()
811 int32_t UsbdDispatcher::HostDeviceInit(HostDevice *port) in HostDeviceInit() argument
813 if (port == nullptr) { in HostDeviceInit()
818 port->busNum = 0; in HostDeviceInit()
819 port->devAddr = 0; in HostDeviceInit()
820 port->initFlag = false; in HostDeviceInit()
821 port->interfaceCnt = 0; in HostDeviceInit()
822 if (OsalMutexInit(&port->lock) != HDF_SUCCESS) { in HostDeviceInit()
827 if (OsalMutexInit(&port->requestLock) != HDF_SUCCESS) { in HostDeviceInit()
832 if (OsalMutexInit(&port->writeLock) != HDF_SUCCESS) { in HostDeviceInit()
837 if (OsalMutexInit(&port->readLock) != HDF_SUCCESS) { in HostDeviceInit()
842 if (OsalMutexInit(&port->reqSyncLock) != HDF_SUCCESS) { in HostDeviceInit()
847 if (OsalMutexInit(&port->reqASyncLock) != HDF_SUCCESS) { in HostDeviceInit()
852 HdfSListInit(&port->requestQueue); in HostDeviceInit()
853 HdfSListInit(&port->reqSyncList); in HostDeviceInit()
854 HdfSListInit(&port->reqASyncList); in HostDeviceInit()
858 int32_t UsbdDispatcher::HostDeviceCreate(HostDevice **port) in HostDeviceCreate() argument
860 if (port == nullptr) { in HostDeviceCreate()
880 *port = tmp; in HostDeviceCreate()
884 int32_t UsbdDispatcher::FunAttachDevice(HostDevice *port, HdfSBuf *data, HdfSBuf *reply) in FunAttachDevice() argument
886 if (port == nullptr) { in FunAttachDevice()
890 if (port->initFlag) { in FunAttachDevice()
892 port->initFlag, port->busNum, port->devAddr); in FunAttachDevice()
898 ret = UsbdInit(port); in FunAttachDevice()
901 RemoveDevFromService(port->service, port); in FunAttachDevice()
902 UsbdRelease(port); in FunAttachDevice()
903 OsalMemFree(port); in FunAttachDevice()
906 ret = UsbdAllocFifo(&port->readFifo, READ_BUF_SIZE); in FunAttachDevice()
913 port->initFlag = true; in FunAttachDevice()
921 UsbdFreeFifo(&port->readFifo); in FunAttachDevice()
922 UsbdRelease(port); in FunAttachDevice()
923 RemoveDevFromService(port->service, port); in FunAttachDevice()
924 OsalMemFree(port); in FunAttachDevice()
930 HostDevice *port = service->FindDevFromService(busNum, devAddr); in UsbdDeviceCreateAndAttach() local
931 if (port != nullptr) { in UsbdDeviceCreateAndAttach()
935 int32_t ret = HostDeviceCreate(&port); in UsbdDeviceCreateAndAttach()
937 port->busNum = busNum; in UsbdDeviceCreateAndAttach()
938 port->devAddr = devAddr; in UsbdDeviceCreateAndAttach()
939 port->service = service; in UsbdDeviceCreateAndAttach()
941 HdfSListAdd(&service->devList_, &port->node); in UsbdDeviceCreateAndAttach()
943 ret = FunAttachDevice(port, nullptr, nullptr); in UsbdDeviceCreateAndAttach()
947 port = nullptr; in UsbdDeviceCreateAndAttach()
954 int32_t UsbdDispatcher::FunDetachDevice(HostDevice *port, HdfSBuf *data) in FunDetachDevice() argument
956 if (port == nullptr) { in FunDetachDevice()
961 RemoveDevFromService(port->service, port); in FunDetachDevice()
962 UsbdRelease(port); in FunDetachDevice()
963 UsbdFreeFifo(&port->readFifo); in FunDetachDevice()
964 OsalMemFree(port); in FunDetachDevice()
975 HostDevice *port = service->FindDevFromService(busNum, devAddr); in UsbdDeviceDettach() local
976 if (port == nullptr) { in UsbdDeviceDettach()
981 int32_t ret = FunDetachDevice(port, nullptr); in UsbdDeviceDettach()
1079 UsbdBulkASyncList *UsbdDispatcher::UsbdBulkASyncListAlloc(HostDevice *port, uint8_t ifId, uint8_t e… in UsbdBulkASyncListAlloc() argument
1087 int32_t ret = GetPipe(port, ifId, epId, &pipe); in UsbdBulkASyncListAlloc()
1093 UsbInterfaceHandle *ifHandle = UsbImpl::InterfaceIdToHandle(port, ifId); in UsbdBulkASyncListAlloc()
1106 bulkAsyncList->instance = port; in UsbdBulkASyncListAlloc()