3 This file contains the definination for host controller schedule routines.
5 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef _EFI_EHCI_SCHED_H_
11 #define _EFI_EHCI_SCHED_H_
14 Initialize the schedule data structure such as frame list.
16 @param Ehc The EHCI device to init schedule data for.
18 @retval EFI_OUT_OF_RESOURCES Failed to allocate resource to init schedule data.
19 @retval EFI_SUCCESS The schedule data is initialized.
28 Free the schedule data. It may be partially initialized.
30 @param Ehc The EHCI device.
39 Link the queue head to the asynchronous schedule list.
40 UEFI only supports one CTRL/BULK transfer at a time
41 due to its interfaces. This simplifies the AsynList
42 management: A reclamation header is always linked to
43 the AsyncListAddr, the only active QH is appended to it.
45 @param Ehc The EHCI device.
46 @param Qh The queue head to link.
56 Unlink a queue head from the asynchronous schedule list.
57 Need to synchronize with hardware.
59 @param Ehc The EHCI device.
60 @param Qh The queue head to unlink.
64 EhcUnlinkQhFromAsync (
70 Link a queue head for interrupt transfer to the periodic
71 schedule frame list. This code is very much the same as
74 @param Ehc The EHCI device.
75 @param Qh The queue head to link.
85 Unlink an interrupt queue head from the periodic
88 @param Ehc The EHCI device.
89 @param Qh The queue head to unlink.
93 EhcUnlinkQhFromPeriod (
99 Execute the transfer by polling the URB. This is a synchronous operation.
101 @param Ehc The EHCI device.
102 @param Urb The URB to execute.
103 @param TimeOut The time to wait before abort, in millisecond.
105 @retval EFI_DEVICE_ERROR The transfer failed due to transfer error.
106 @retval EFI_TIMEOUT The transfer failed due to time out.
107 @retval EFI_SUCCESS The transfer finished OK.
118 Delete a single asynchronous interrupt transfer for
119 the device and endpoint.
121 @param Ehc The EHCI device.
122 @param DevAddr The address of the target device.
123 @param EpNum The endpoint of the target.
124 @param DataToggle Return the next data toggle to use.
126 @retval EFI_SUCCESS An asynchronous transfer is removed.
127 @retval EFI_NOT_FOUND No transfer for the device is found.
131 EhciDelAsyncIntTransfer (
135 OUT UINT8
*DataToggle
139 Remove all the asynchronous interrutp transfers.
141 @param Ehc The EHCI device.
145 EhciDelAllAsyncIntTransfers (
150 Insert a single asynchronous interrupt transfer for
151 the device and endpoint.
153 @param Ehc The EHCI device.
154 @param DevAddr The device address.
155 @param EpAddr Endpoint addrress & its direction.
156 @param DevSpeed The device speed.
157 @param Toggle Initial data toggle to use.
158 @param MaxPacket The max packet length of the endpoint.
159 @param Hub The transaction translator to use.
160 @param DataLen The length of data buffer.
161 @param Callback The function to call when data is transferred.
162 @param Context The context to the callback.
163 @param Interval The interval for interrupt transfer.
165 @return Created URB or NULL.
169 EhciInsertAsyncIntTransfer (
176 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR
*Hub
,
178 IN EFI_ASYNC_USB_TRANSFER_CALLBACK Callback
,
184 Interrupt transfer periodic check handler.
186 @param Event Interrupt event.
187 @param Context Pointer to USB2_HC_DEV.
192 EhcMonitorAsyncRequests (