Lines Matching refs:hostInstance
55 static void USB_HostReleaseInstance(usb_host_instance_t *hostInstance);
125 usb_host_instance_t *hostInstance = (usb_host_instance_t *)deviceInstance->hostHandle; local
149 if (hostInstance->controllerTable == &s_EhciInterface)
151 …(void)hostInstance->controllerTable->controllerIoctl(hostInstance->controllerHandle, kUSB_HostTest…
155 if (hostInstance->controllerTable == &s_Ip3516HsInterface)
157 …(void)hostInstance->controllerTable->controllerIoctl(hostInstance->controllerHandle, kUSB_HostTest…
197 static void USB_HostReleaseInstance(usb_host_instance_t *hostInstance) in USB_HostReleaseInstance() argument
201 hostInstance->occupied = 0; in USB_HostReleaseInstance()
240 usb_host_instance_t *hostInstance = NULL; in USB_HostInit() local
244 hostInstance = USB_HostGetInstance(); /* get one host instance */ in USB_HostInit()
245 if (hostInstance == NULL) in USB_HostInit()
251 USB_HostGetControllerInterface(controllerId, &hostInstance->controllerTable); in USB_HostInit()
252 if (hostInstance->controllerTable == NULL) in USB_HostInit()
254 USB_HostReleaseInstance(hostInstance); in USB_HostInit()
259 if ((hostInstance->controllerTable->controllerCreate == NULL) || in USB_HostInit()
260 (hostInstance->controllerTable->controllerDestory == NULL) || in USB_HostInit()
261 (hostInstance->controllerTable->controllerOpenPipe == NULL) || in USB_HostInit()
262 (hostInstance->controllerTable->controllerClosePipe == NULL) || in USB_HostInit()
263 (hostInstance->controllerTable->controllerWritePipe == NULL) || in USB_HostInit()
264 (hostInstance->controllerTable->controllerReadPipe == NULL) || in USB_HostInit()
265 (hostInstance->controllerTable->controllerIoctl == NULL)) in USB_HostInit()
271 hostInstance->controllerId = controllerId; in USB_HostInit()
272 hostInstance->deviceCallback = callbackFn; in USB_HostInit()
273 hostInstance->deviceList = NULL; in USB_HostInit()
274 hostInstance->hostMutex = (osa_mutex_handle_t)(&hostInstance->mutexBuffer[0]); in USB_HostInit()
275 if (KOSA_StatusSuccess != OSA_MutexCreate(hostInstance->hostMutex)) in USB_HostInit()
277 USB_HostReleaseInstance(hostInstance); in USB_HostInit()
286 hostInstance->transferHead = &hostInstance->transferList[0]; in USB_HostInit()
287 transferPrev = hostInstance->transferHead; in USB_HostInit()
290 transferPrev->next = &hostInstance->transferList[i]; in USB_HostInit()
296 …hostInstance->controllerTable->controllerCreate(controllerId, hostInstance, &(hostInstance->contro… in USB_HostInit()
297 if ((status != kStatus_USB_Success) || (hostInstance->controllerHandle == NULL)) in USB_HostInit()
299 (void)OSA_MutexDestroy(hostInstance->hostMutex); in USB_HostInit()
300 USB_HostReleaseInstance(hostInstance); in USB_HostInit()
307 *hostHandle = hostInstance; in USB_HostInit()
314 usb_host_instance_t *hostInstance = (usb_host_instance_t *)hostHandle; in USB_HostDeinit() local
323 deviceInstance = (usb_host_device_instance_t *)hostInstance->deviceList; in USB_HostDeinit()
326 deviceInstance = (usb_host_device_instance_t *)hostInstance->deviceList; in USB_HostDeinit()
331 …status = hostInstance->controllerTable->controllerDestory(hostInstance->co… in USB_HostDeinit()
332 hostInstance->controllerHandle = NULL; in USB_HostDeinit()
341 if (NULL != hostInstance->hostMutex) in USB_HostDeinit()
343 (void)OSA_MutexDestroy(hostInstance->hostMutex); in USB_HostDeinit()
344 hostInstance->hostMutex = NULL; in USB_HostDeinit()
346 USB_HostReleaseInstance(hostInstance); in USB_HostDeinit()
356 usb_host_instance_t *hostInstance = (usb_host_instance_t *)hostHandle; in USB_HostOpenPipe() local
364 …status = hostInstance->controllerTable->controllerOpenPipe(hostInstance->controllerHandle, pipeHan… in USB_HostOpenPipe()
372 usb_host_instance_t *hostInstance = (usb_host_instance_t *)hostHandle; in USB_HostClosePipe() local
380 …status = hostInstance->controllerTable->controllerClosePipe(hostInstance->controllerHandle, pipeHa… in USB_HostClosePipe()
388 usb_host_instance_t *hostInstance = (usb_host_instance_t *)hostHandle; in USB_HostSend() local
417 …status = hostInstance->controllerTable->controllerWritePipe(hostInstance->controllerHandle, pipeHa… in USB_HostSend()
428 usb_host_instance_t *hostInstance = (usb_host_instance_t *)hostHandle; in USB_HostSendSetup() local
467 …status = hostInstance->controllerTable->controllerWritePipe(hostInstance->controllerHandle, pipeHa… in USB_HostSendSetup()
476 usb_host_instance_t *hostInstance = (usb_host_instance_t *)hostHandle; in USB_HostRecv() local
505 …status = hostInstance->controllerTable->controllerReadPipe(hostInstance->controllerHandle, pipeHan… in USB_HostRecv()
516 usb_host_instance_t *hostInstance = (usb_host_instance_t *)hostHandle; in USB_HostCancelTransfer() local
530 …status = hostInstance->controllerTable->controllerIoctl(hostInstance->controllerHandle, kUSB_HostC… in USB_HostCancelTransfer()
539 usb_host_instance_t *hostInstance = (usb_host_instance_t *)hostHandle; in USB_HostMallocTransfer() local
548 if (hostInstance->transferHead != NULL) in USB_HostMallocTransfer()
550 *transfer = hostInstance->transferHead; in USB_HostMallocTransfer()
551 hostInstance->transferHead = hostInstance->transferHead->next; in USB_HostMallocTransfer()
565 usb_host_instance_t *hostInstance = (usb_host_instance_t *)hostHandle; in USB_HostFreeTransfer() local
578 transfer->next = hostInstance->transferHead; in USB_HostFreeTransfer()
579 hostInstance->transferHead = transfer; in USB_HostFreeTransfer()
822 usb_host_instance_t *hostInstance; in USB_HostSuspendDeviceResquest() local
831 hostInstance = (usb_host_instance_t *)hostHandle; in USB_HostSuspendDeviceResquest()
833 hostInstance->suspendedDevice = (void *)deviceHandle; in USB_HostSuspendDeviceResquest()
838 status = USB_HostHubSuspendDevice(hostInstance); in USB_HostSuspendDeviceResquest()
842 …hostInstance->controllerTable->controllerIoctl(hostInstance->controllerHandle, kUSB_HostBusControl… in USB_HostSuspendDeviceResquest()
852 if (hostInstance->deviceList == deviceHandle) in USB_HostSuspendDeviceResquest()
855 … status = hostInstance->controllerTable->controllerIoctl(hostInstance->controllerHandle, in USB_HostSuspendDeviceResquest()
862 if (kStatus_USB_Success == USB_HostValidateDevice(hostInstance, deviceHandle)) in USB_HostSuspendDeviceResquest()
864 status = USB_HostHubSuspendDevice(hostInstance); in USB_HostSuspendDeviceResquest()
871 hostInstance->suspendedDevice = NULL; in USB_HostSuspendDeviceResquest()
879 usb_host_instance_t *hostInstance; in USB_HostResumeDeviceResquest() local
888 hostInstance = (usb_host_instance_t *)hostHandle; in USB_HostResumeDeviceResquest()
890 if (hostInstance->suspendedDevice != deviceHandle) in USB_HostResumeDeviceResquest()
894 hostInstance->suspendedDevice = (void *)deviceHandle; in USB_HostResumeDeviceResquest()
900 …hostInstance->controllerTable->controllerIoctl(hostInstance->controllerHandle, kUSB_HostBusControl… in USB_HostResumeDeviceResquest()
909 if (hostInstance->deviceList == deviceHandle) in USB_HostResumeDeviceResquest()
912 … status = hostInstance->controllerTable->controllerIoctl(hostInstance->controllerHandle, in USB_HostResumeDeviceResquest()
919 if (kStatus_USB_Success == USB_HostValidateDevice(hostInstance, deviceHandle)) in USB_HostResumeDeviceResquest()
921 status = USB_HostHubResumeDevice(hostInstance); in USB_HostResumeDeviceResquest()
935 usb_host_instance_t *hostInstance; in USB_HostL1SleepDeviceResquest() local
943 hostInstance = (usb_host_instance_t *)hostHandle; in USB_HostL1SleepDeviceResquest()
945 hostInstance->suspendedDevice = (void *)deviceHandle; in USB_HostL1SleepDeviceResquest()
954 …hostInstance->controllerTable->controllerIoctl(hostInstance->controllerHandle, kUSB_HostBusControl… in USB_HostL1SleepDeviceResquest()
962 if (hostInstance->deviceList == deviceHandle) in USB_HostL1SleepDeviceResquest()
965 …status = hostInstance->controllerTable->controllerIoctl(hostInstance->controllerHandle, kUSB_HostB… in USB_HostL1SleepDeviceResquest()
971 hostInstance->suspendedDevice = NULL; in USB_HostL1SleepDeviceResquest()
978 usb_host_instance_t *hostInstance; in USB_HostL1SleepDeviceResquestConfig() local
985 hostInstance = (usb_host_instance_t *)hostHandle; in USB_HostL1SleepDeviceResquestConfig()
988 …hostInstance->controllerTable->controllerIoctl(hostInstance->controllerHandle, kUSB_HostL1Config, … in USB_HostL1SleepDeviceResquestConfig()
998 usb_host_instance_t *hostInstance; in USB_HostL1ResumeDeviceResquest() local
1007 hostInstance = (usb_host_instance_t *)hostHandle; in USB_HostL1ResumeDeviceResquest()
1013 …hostInstance->controllerTable->controllerIoctl(hostInstance->controllerHandle, kUSB_HostBusControl… in USB_HostL1ResumeDeviceResquest()
1021 if (hostInstance->deviceList == deviceHandle) in USB_HostL1ResumeDeviceResquest()
1024 …status = hostInstance->controllerTable->controllerIoctl(hostInstance->controllerHandle, kUSB_HostB… in USB_HostL1ResumeDeviceResquest()
1035 usb_host_instance_t *hostInstance; in USB_HostUpdateHwTick() local
1042 hostInstance = (usb_host_instance_t *)hostHandle; in USB_HostUpdateHwTick()
1044 hostInstance->hwTick = tick; in USB_HostUpdateHwTick()
1053 usb_host_instance_t *hostInstance; in USB_HostSetChargerType() local
1059 hostInstance = (usb_host_instance_t *)hostHandle; in USB_HostSetChargerType()
1060 …return hostInstance->controllerTable->controllerIoctl(hostInstance->controllerHandle, kUSB_HostSet… in USB_HostSetChargerType()