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