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