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_
15 Initialize the schedule data structure such as frame list.
17 @param Ehc The EHCI device to init schedule data for.
19 @retval EFI_OUT_OF_RESOURCES Failed to allocate resource to init schedule data.
20 @retval EFI_SUCCESS The schedule data is initialized.
30 Free the schedule data. It may be partially initialized.
32 @param Ehc The EHCI device.
42 Link the queue head to the asynchronous schedule list.
43 UEFI only supports one CTRL/BULK transfer at a time
44 due to its interfaces. This simplifies the AsynList
45 management: A reclamation header is always linked to
46 the AsyncListAddr, the only active QH is appended to it.
48 @param Ehc The EHCI device.
49 @param Qh The queue head to link.
60 Unlink a queue head from the asynchronous schedule list.
61 Need to synchronize with hardware.
63 @param Ehc The EHCI device.
64 @param Qh The queue head to unlink.
68 EhcUnlinkQhFromAsync (
75 Link a queue head for interrupt transfer to the periodic
76 schedule frame list. This code is very much the same as
79 @param Ehc The EHCI device.
80 @param Qh The queue head to link.
91 Unlink an interrupt queue head from the periodic
94 @param Ehc The EHCI device.
95 @param Qh The queue head to unlink.
99 EhcUnlinkQhFromPeriod (
107 Execute the transfer by polling the URB. This is a synchronous operation.
109 @param Ehc The EHCI device.
110 @param Urb The URB to execute.
111 @param TimeOut The time to wait before abort, in millisecond.
113 @retval EFI_DEVICE_ERROR The transfer failed due to transfer error.
114 @retval EFI_TIMEOUT The transfer failed due to time out.
115 @retval EFI_SUCCESS The transfer finished OK.
127 Delete a single asynchronous interrupt transfer for
128 the device and endpoint.
130 @param Ehc The EHCI device.
131 @param DevAddr The address of the target device.
132 @param EpNum The endpoint of the target.
133 @param DataToggle Return the next data toggle to use.
135 @retval EFI_SUCCESS An asynchronous transfer is removed.
136 @retval EFI_NOT_FOUND No transfer for the device is found.
140 EhciDelAsyncIntTransfer (
144 OUT UINT8
*DataToggle
149 Remove all the asynchronous interrutp transfers.
151 @param Ehc The EHCI device.
155 EhciDelAllAsyncIntTransfers (
160 Insert a single asynchronous interrupt transfer for
161 the device and endpoint.
163 @param Ehc The EHCI device.
164 @param DevAddr The device address.
165 @param EpAddr Endpoint addrress & its direction.
166 @param DevSpeed The device speed.
167 @param Toggle Initial data toggle to use.
168 @param MaxPacket The max packet length of the endpoint.
169 @param Hub The transaction translator to use.
170 @param DataLen The length of data buffer.
171 @param Callback The function to call when data is transferred.
172 @param Context The context to the callback.
173 @param Interval The interval for interrupt transfer.
175 @return Created URB or NULL.
179 EhciInsertAsyncIntTransfer (
186 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR
*Hub
,
188 IN EFI_ASYNC_USB_TRANSFER_CALLBACK Callback
,
194 Interrupt transfer periodic check handler.
196 @param Event Interrupt event.
197 @param Context Pointer to USB2_HC_DEV.
202 EhcMonitorAsyncRequests (