]>
Commit | Line | Data |
---|---|---|
913cb9dc | 1 | /** @file\r |
2 | \r | |
78c2ffb5 | 3 | This file contains the definination for host controller schedule routines.\r |
4 | \r | |
cd5ebaa0 HT |
5 | Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.<BR>\r |
6 | This program and the accompanying materials\r | |
913cb9dc | 7 | are licensed and made available under the terms and conditions of the BSD License\r |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
78c2ffb5 | 14 | **/\r |
913cb9dc | 15 | \r |
78c2ffb5 | 16 | #ifndef _EFI_EHCI_SCHED_H_\r |
17 | #define _EFI_EHCI_SCHED_H_\r | |
913cb9dc | 18 | \r |
913cb9dc | 19 | \r |
78c2ffb5 | 20 | /**\r |
21 | Initialize the schedule data structure such as frame list.\r | |
913cb9dc | 22 | \r |
78c2ffb5 | 23 | @param Ehc The EHCI device to init schedule data for.\r |
913cb9dc | 24 | \r |
78c2ffb5 | 25 | @retval EFI_OUT_OF_RESOURCES Failed to allocate resource to init schedule data.\r |
26 | @retval EFI_SUCCESS The schedule data is initialized.\r | |
913cb9dc | 27 | \r |
78c2ffb5 | 28 | **/\r |
913cb9dc | 29 | EFI_STATUS\r |
30 | EhcInitSched (\r | |
31 | IN USB2_HC_DEV *Ehc\r | |
ed66e1bc | 32 | );\r |
913cb9dc | 33 | \r |
34 | \r | |
913cb9dc | 35 | /**\r |
36 | Free the schedule data. It may be partially initialized.\r | |
37 | \r | |
78c2ffb5 | 38 | @param Ehc The EHCI device.\r |
913cb9dc | 39 | \r |
913cb9dc | 40 | **/\r |
41 | VOID\r | |
42 | EhcFreeSched (\r | |
43 | IN USB2_HC_DEV *Ehc\r | |
ed66e1bc | 44 | );\r |
913cb9dc | 45 | \r |
46 | \r | |
913cb9dc | 47 | /**\r |
48 | Link the queue head to the asynchronous schedule list.\r | |
49 | UEFI only supports one CTRL/BULK transfer at a time\r | |
50 | due to its interfaces. This simplifies the AsynList\r | |
51 | management: A reclamation header is always linked to\r | |
52 | the AsyncListAddr, the only active QH is appended to it.\r | |
53 | \r | |
78c2ffb5 | 54 | @param Ehc The EHCI device.\r |
55 | @param Qh The queue head to link.\r | |
913cb9dc | 56 | \r |
913cb9dc | 57 | **/\r |
58 | VOID\r | |
59 | EhcLinkQhToAsync (\r | |
60 | IN USB2_HC_DEV *Ehc,\r | |
61 | IN EHC_QH *Qh\r | |
ed66e1bc | 62 | );\r |
913cb9dc | 63 | \r |
64 | \r | |
65 | /**\r | |
66 | Unlink a queue head from the asynchronous schedule list.\r | |
78c2ffb5 | 67 | Need to synchronize with hardware.\r |
913cb9dc | 68 | \r |
78c2ffb5 | 69 | @param Ehc The EHCI device.\r |
70 | @param Qh The queue head to unlink.\r | |
913cb9dc | 71 | \r |
913cb9dc | 72 | **/\r |
73 | VOID\r | |
74 | EhcUnlinkQhFromAsync (\r | |
75 | IN USB2_HC_DEV *Ehc,\r | |
76 | IN EHC_QH *Qh\r | |
ed66e1bc | 77 | );\r |
913cb9dc | 78 | \r |
79 | \r | |
80 | /**\r | |
81 | Link a queue head for interrupt transfer to the periodic\r | |
82 | schedule frame list. This code is very much the same as\r | |
83 | that in UHCI.\r | |
84 | \r | |
78c2ffb5 | 85 | @param Ehc The EHCI device.\r |
86 | @param Qh The queue head to link.\r | |
913cb9dc | 87 | \r |
913cb9dc | 88 | **/\r |
89 | VOID\r | |
90 | EhcLinkQhToPeriod (\r | |
91 | IN USB2_HC_DEV *Ehc,\r | |
92 | IN EHC_QH *Qh\r | |
ed66e1bc | 93 | );\r |
913cb9dc | 94 | \r |
95 | \r | |
96 | /**\r | |
97 | Unlink an interrupt queue head from the periodic\r | |
78c2ffb5 | 98 | schedule frame list.\r |
913cb9dc | 99 | \r |
78c2ffb5 | 100 | @param Ehc The EHCI device.\r |
101 | @param Qh The queue head to unlink.\r | |
913cb9dc | 102 | \r |
913cb9dc | 103 | **/\r |
104 | VOID\r | |
105 | EhcUnlinkQhFromPeriod (\r | |
106 | IN USB2_HC_DEV *Ehc,\r | |
107 | IN EHC_QH *Qh\r | |
ed66e1bc | 108 | );\r |
913cb9dc | 109 | \r |
110 | \r | |
111 | \r | |
112 | /**\r | |
113 | Execute the transfer by polling the URB. This is a synchronous operation.\r | |
114 | \r | |
78c2ffb5 | 115 | @param Ehc The EHCI device.\r |
116 | @param Urb The URB to execute.\r | |
117 | @param TimeOut The time to wait before abort, in millisecond.\r | |
913cb9dc | 118 | \r |
78c2ffb5 | 119 | @retval EFI_DEVICE_ERROR The transfer failed due to transfer error.\r |
120 | @retval EFI_TIMEOUT The transfer failed due to time out.\r | |
121 | @retval EFI_SUCCESS The transfer finished OK.\r | |
913cb9dc | 122 | \r |
123 | **/\r | |
124 | EFI_STATUS\r | |
125 | EhcExecTransfer (\r | |
126 | IN USB2_HC_DEV *Ehc,\r | |
127 | IN URB *Urb,\r | |
128 | IN UINTN TimeOut\r | |
ed66e1bc | 129 | );\r |
913cb9dc | 130 | \r |
131 | \r | |
132 | /**\r | |
133 | Delete a single asynchronous interrupt transfer for\r | |
78c2ffb5 | 134 | the device and endpoint.\r |
913cb9dc | 135 | \r |
78c2ffb5 | 136 | @param Ehc The EHCI device.\r |
137 | @param DevAddr The address of the target device.\r | |
138 | @param EpNum The endpoint of the target.\r | |
139 | @param DataToggle Return the next data toggle to use.\r | |
913cb9dc | 140 | \r |
78c2ffb5 | 141 | @retval EFI_SUCCESS An asynchronous transfer is removed.\r |
142 | @retval EFI_NOT_FOUND No transfer for the device is found.\r | |
913cb9dc | 143 | \r |
144 | **/\r | |
145 | EFI_STATUS\r | |
146 | EhciDelAsyncIntTransfer (\r | |
147 | IN USB2_HC_DEV *Ehc,\r | |
148 | IN UINT8 DevAddr,\r | |
149 | IN UINT8 EpNum,\r | |
150 | OUT UINT8 *DataToggle\r | |
ed66e1bc | 151 | );\r |
913cb9dc | 152 | \r |
153 | \r | |
154 | /**\r | |
78c2ffb5 | 155 | Remove all the asynchronous interrutp transfers.\r |
913cb9dc | 156 | \r |
78c2ffb5 | 157 | @param Ehc The EHCI device.\r |
913cb9dc | 158 | \r |
913cb9dc | 159 | **/\r |
160 | VOID\r | |
161 | EhciDelAllAsyncIntTransfers (\r | |
162 | IN USB2_HC_DEV *Ehc\r | |
ed66e1bc | 163 | );\r |
913cb9dc | 164 | \r |
165 | \r | |
913cb9dc | 166 | /**\r |
78c2ffb5 | 167 | Interrupt transfer periodic check handler.\r |
913cb9dc | 168 | \r |
78c2ffb5 | 169 | @param Event Interrupt event.\r |
170 | @param Context Pointer to USB2_HC_DEV.\r | |
913cb9dc | 171 | \r |
913cb9dc | 172 | **/\r |
173 | VOID\r | |
6d3ea23f | 174 | EFIAPI\r |
597f4ee2 | 175 | EhcMonitorAsyncRequests (\r |
913cb9dc | 176 | IN EFI_EVENT Event,\r |
177 | IN VOID *Context\r | |
ed66e1bc | 178 | );\r |
913cb9dc | 179 | \r |
180 | #endif\r |