]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | EFI_USB2_HC_PROTOCOL as defined in UEFI 2.0.\r | |
3 | \r | |
4 | Copyright (c) 2006, Intel Corporation\r | |
5 | All rights reserved. This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef _USB2_HOSTCONTROLLER_H_\r | |
16 | #define _USB2_HOSTCONTROLLER_H_\r | |
17 | \r | |
18 | #include <IndustryStandard/Usb.h>\r | |
19 | #include <Protocol/UsbIo.h>\r | |
20 | \r | |
21 | #define EFI_USB2_HC_PROTOCOL_GUID \\r | |
22 | { \\r | |
23 | 0x3e745226, 0x9818, 0x45b6, {0xa2, 0xac, 0xd7, 0xcd, 0xe, 0x8b, 0xa2, 0xbc } \\r | |
24 | }\r | |
25 | \r | |
26 | //\r | |
27 | // Forward reference for pure ANSI compatability\r | |
28 | //\r | |
29 | typedef struct _EFI_USB2_HC_PROTOCOL EFI_USB2_HC_PROTOCOL;\r | |
30 | \r | |
31 | \r | |
32 | typedef struct {\r | |
33 | UINT16 PortStatus;\r | |
34 | UINT16 PortChangeStatus;\r | |
35 | } EFI_USB_PORT_STATUS;\r | |
36 | \r | |
37 | //\r | |
38 | // Constant value for Port Status & Port Change Status\r | |
39 | //\r | |
40 | #define USB_PORT_STAT_CONNECTION 0x0001\r | |
41 | #define USB_PORT_STAT_ENABLE 0x0002\r | |
42 | #define USB_PORT_STAT_SUSPEND 0x0004\r | |
43 | #define USB_PORT_STAT_OVERCURRENT 0x0008\r | |
44 | #define USB_PORT_STAT_RESET 0x0010\r | |
45 | #define USB_PORT_STAT_POWER 0x0100\r | |
46 | #define USB_PORT_STAT_LOW_SPEED 0x0200\r | |
47 | #define USB_PORT_STAT_HIGH_SPEED 0x0400\r | |
48 | #define USB_PORT_STAT_OWNER 0x0800\r | |
49 | \r | |
50 | #define USB_PORT_STAT_C_CONNECTION 0x0001\r | |
51 | #define USB_PORT_STAT_C_ENABLE 0x0002\r | |
52 | #define USB_PORT_STAT_C_SUSPEND 0x0004\r | |
53 | #define USB_PORT_STAT_C_OVERCURRENT 0x0008\r | |
54 | #define USB_PORT_STAT_C_RESET 0x0010\r | |
55 | \r | |
56 | \r | |
57 | //\r | |
58 | // Usb port features\r | |
59 | //\r | |
60 | typedef enum {\r | |
61 | EfiUsbPortEnable = 1,\r | |
62 | EfiUsbPortSuspend = 2,\r | |
63 | EfiUsbPortReset = 4,\r | |
64 | EfiUsbPortPower = 8,\r | |
65 | EfiUsbPortOwner = 13,\r | |
66 | EfiUsbPortConnectChange = 16,\r | |
67 | EfiUsbPortEnableChange = 17,\r | |
68 | EfiUsbPortSuspendChange = 18,\r | |
69 | EfiUsbPortOverCurrentChange = 19,\r | |
70 | EfiUsbPortResetChange = 20\r | |
71 | } EFI_USB_PORT_FEATURE;\r | |
72 | \r | |
73 | \r | |
74 | #define EFI_USB_SPEED_FULL 0x0000 // 12 Mb/s, USB 1.1 OHCI and UHCI HC.\r | |
75 | #define EFI_USB_SPEED_LOW 0x0001 // 1 Mb/s, USB 1.1 OHCI and UHCI HC.\r | |
76 | #define EFI_USB_SPEED_HIGH 0x0002 // 480 Mb/s, USB 2.0 EHCI HC.\r | |
77 | \r | |
78 | typedef struct {\r | |
79 | UINT8 TranslatorHubAddress;\r | |
80 | UINT8 TranslatorPortNumber;\r | |
81 | } EFI_USB2_HC_TRANSACTION_TRANSLATOR;\r | |
82 | \r | |
83 | //\r | |
84 | // Protocol definitions\r | |
85 | //\r | |
86 | \r | |
87 | /**\r | |
88 | Retrieves the Host Controller capabilities.\r | |
89 | \r | |
90 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
91 | @param MaxSpeed Host controller data transfer speed.\r | |
92 | @param PortNumber Number of the root hub ports.\r | |
93 | @param Is64BitCapable TRUE if controller supports 64-bit memory addressing,\r | |
94 | FALSE otherwise.\r | |
95 | \r | |
96 | @retval EFI_SUCCESS The host controller capabilities were retrieved successfully.\r | |
97 | @retval EFI_INVALID_PARAMETER One of the input args was NULL.\r | |
98 | @retval EFI_DEVICE_ERROR An error was encountered while attempting to\r | |
99 | retrieve the capabilities.\r | |
100 | \r | |
101 | **/\r | |
102 | typedef\r | |
103 | EFI_STATUS\r | |
104 | (EFIAPI *EFI_USB2_HC_PROTOCOL_GET_CAPABILITY)(\r | |
105 | IN EFI_USB2_HC_PROTOCOL *This,\r | |
106 | OUT UINT8 *MaxSpeed,\r | |
107 | OUT UINT8 *PortNumber,\r | |
108 | OUT UINT8 *Is64BitCapable\r | |
109 | )\r | |
110 | ;\r | |
111 | \r | |
112 | #define EFI_USB_HC_RESET_GLOBAL 0x0001\r | |
113 | #define EFI_USB_HC_RESET_HOST_CONTROLLER 0x0002\r | |
114 | #define EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG 0x0004\r | |
115 | #define EFI_USB_HC_RESET_HOST_WITH_DEBUG 0x0008\r | |
116 | /**\r | |
117 | Provides software reset for the USB host controller.\r | |
118 | \r | |
119 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
120 | @param Attributes A bit mask of the reset operation to perform.\r | |
121 | \r | |
122 | @retval EFI_SUCCESS The reset operation succeeded.\r | |
123 | @retval EFI_INVALID_PARAMETER Attributes is not valid.\r | |
124 | @retval EFI_UNSUPPORTED The type of reset specified by Attributes is not currently\r | |
125 | supported by the host controller hardware.\r | |
126 | @retval EFI_ACCESS_DENIED Reset operation is rejected due to the debug port being configured\r | |
127 | and active; only EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG or\r | |
128 | EFI_USB_HC_RESET_HOST_WITH_DEBUG reset Attributes can be used to\r | |
129 | perform reset operation for this host controller.\r | |
130 | @retval EFI_DEVICE_ERROR An error was encountered while attempting to\r | |
131 | retrieve the capabilities.\r | |
132 | \r | |
133 | **/\r | |
134 | typedef\r | |
135 | EFI_STATUS\r | |
136 | (EFIAPI *EFI_USB2_HC_PROTOCOL_RESET)(\r | |
137 | IN EFI_USB2_HC_PROTOCOL *This,\r | |
138 | IN UINT16 Attributes\r | |
139 | )\r | |
140 | ;\r | |
141 | \r | |
142 | /**\r | |
143 | \r | |
144 | @param EfiUsbHcStateHalt The host controller is in halt\r | |
145 | state. No USB transactions can occur\r | |
146 | while in this state. The host\r | |
147 | controller can enter this state for\r | |
148 | three reasons: 1) After host\r | |
149 | controller hardware reset. 2)\r | |
150 | Explicitly set by software. 3)\r | |
151 | Triggered by a fatal error such as\r | |
152 | consistency check failure.\r | |
153 | \r | |
154 | \r | |
155 | @param EfiUsbHcStateOperational The host controller is in an\r | |
156 | operational state. When in\r | |
157 | this state, the host\r | |
158 | controller can execute bus\r | |
159 | traffic. This state must be\r | |
160 | explicitly set to enable the\r | |
161 | USB bus traffic.\r | |
162 | \r | |
163 | \r | |
164 | @param EfiUsbHcStateSuspend The host controller is in the\r | |
165 | suspend state. No USB\r | |
166 | transactions can occur while in\r | |
167 | this state. The host controller\r | |
168 | enters this state for the\r | |
169 | following reasons: 1) Explicitly\r | |
170 | set by software. 2) Triggered\r | |
171 | when there is no bus traffic for\r | |
172 | 3 microseconds.\r | |
173 | \r | |
174 | **/\r | |
175 | typedef enum {\r | |
176 | EfiUsbHcStateHalt,\r | |
177 | EfiUsbHcStateOperational,\r | |
178 | EfiUsbHcStateSuspend,\r | |
179 | EfiUsbHcStateMaximum\r | |
180 | } EFI_USB_HC_STATE;\r | |
181 | \r | |
182 | /**\r | |
183 | Retrieves current state of the USB host controller.\r | |
184 | \r | |
185 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
186 | @param State A pointer to the EFI_USB_HC_STATE data structure that\r | |
187 | indicates current state of the USB host controller.\r | |
188 | \r | |
189 | @retval EFI_SUCCESS The state information of the host controller was returned in State.\r | |
190 | @retval EFI_INVALID_PARAMETER State is NULL.\r | |
191 | @retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve the\r | |
192 | host controller's current state.\r | |
193 | \r | |
194 | **/\r | |
195 | typedef\r | |
196 | EFI_STATUS\r | |
197 | (EFIAPI *EFI_USB2_HC_PROTOCOL_GET_STATE)(\r | |
198 | IN CONST EFI_USB2_HC_PROTOCOL *This,\r | |
199 | OUT EFI_USB_HC_STATE *State\r | |
200 | )\r | |
201 | ;\r | |
202 | \r | |
203 | /**\r | |
204 | Sets the USB host controller to a specific state.\r | |
205 | \r | |
206 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
207 | @param State Indicates the state of the host controller that will be set.\r | |
208 | \r | |
209 | @retval EFI_SUCCESS The USB host controller was successfully placed in the state\r | |
210 | specified by State.\r | |
211 | @retval EFI_INVALID_PARAMETER State is not valid.\r | |
212 | @retval EFI_DEVICE_ERROR Failed to set the state specified by State due to device error.\r | |
213 | \r | |
214 | **/\r | |
215 | typedef\r | |
216 | EFI_STATUS\r | |
217 | (EFIAPI *EFI_USB2_HC_PROTOCOL_SET_STATE)(\r | |
218 | IN EFI_USB2_HC_PROTOCOL *This,\r | |
219 | IN EFI_USB_HC_STATE State\r | |
220 | )\r | |
221 | ;\r | |
222 | \r | |
223 | /**\r | |
224 | Submits control transfer to a target USB device.\r | |
225 | \r | |
226 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
227 | @param DeviceAddress Represents the address of the target device on the USB.\r | |
228 | @param DeviceSpeed Indicates device speed.\r | |
229 | @param MaximumPacketLength Indicates the maximum packet size that the default control transfer\r | |
230 | endpoint is capable of sending or receiving.\r | |
231 | @param Request A pointer to the USB device request that will be sent to the USB device.\r | |
232 | @param TransferDirection Specifies the data direction for the transfer. There are three values\r | |
233 | available, EfiUsbDataIn, EfiUsbDataOut and EfiUsbNoData.\r | |
234 | @param Data A pointer to the buffer of data that will be transmitted to USB device or\r | |
235 | received from USB device.\r | |
236 | @param DataLength On input, indicates the size, in bytes, of the data buffer specified by Data.\r | |
237 | On output, indicates the amount of data actually transferred.\r | |
238 | @param Translator A pointer to the transaction translator data.\r | |
239 | @param TimeOut Indicates the maximum time, in milliseconds, which the transfer is\r | |
240 | allowed to complete.\r | |
241 | @param TransferResult A pointer to the detailed result information generated by this control\r | |
242 | transfer.\r | |
243 | \r | |
244 | @retval EFI_SUCCESS The control transfer was completed successfully.\r | |
245 | @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r | |
246 | @retval EFI_OUT_OF_RESOURCES The control transfer could not be completed due to a lack of resources.\r | |
247 | @retval EFI_TIMEOUT The control transfer failed due to timeout.\r | |
248 | @retval EFI_DEVICE_ERROR The control transfer failed due to host controller or device error.\r | |
249 | Caller should check TransferResult for detailed error information.\r | |
250 | \r | |
251 | **/\r | |
252 | typedef\r | |
253 | EFI_STATUS\r | |
254 | (EFIAPI *EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER)(\r | |
255 | IN EFI_USB2_HC_PROTOCOL *This,\r | |
256 | IN UINT8 DeviceAddress,\r | |
257 | IN UINT8 DeviceSpeed,\r | |
258 | IN UINTN MaximumPacketLength,\r | |
259 | IN EFI_USB_DEVICE_REQUEST *Request,\r | |
260 | IN EFI_USB_DATA_DIRECTION TransferDirection,\r | |
261 | IN OUT VOID *Data OPTIONAL,\r | |
262 | IN OUT UINTN *DataLength OPTIONAL,\r | |
263 | IN UINTN TimeOut,\r | |
264 | IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r | |
265 | OUT UINT32 *TransferResult\r | |
266 | )\r | |
267 | ;\r | |
268 | \r | |
269 | #define EFI_USB_MAX_BULK_BUFFER_NUM 10\r | |
270 | \r | |
271 | /**\r | |
272 | Submits bulk transfer to a bulk endpoint of a USB device.\r | |
273 | \r | |
274 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
275 | @param DeviceAddress Represents the address of the target device on the USB.\r | |
276 | @param EndPointAddress The combination of an endpoint number and an endpoint direction of the\r | |
277 | target USB device.\r | |
278 | @param DeviceSpeed Indicates device speed.\r | |
279 | @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of\r | |
280 | sending or receiving.\r | |
281 | @param DataBuffersNumber Number of data buffers prepared for the transfer.\r | |
282 | @param Data Array of pointers to the buffers of data that will be transmitted to USB\r | |
283 | device or received from USB device.\r | |
284 | @param DataLength When input, indicates the size, in bytes, of the data buffers specified by\r | |
285 | Data. When output, indicates the actually transferred data size.\r | |
286 | @param DataToggle A pointer to the data toggle value.\r | |
287 | @param Translator A pointer to the transaction translator data.\r | |
288 | @param TimeOut Indicates the maximum time, in milliseconds, which the transfer is\r | |
289 | allowed to complete.\r | |
290 | @param TransferResult A pointer to the detailed result information of the bulk transfer.\r | |
291 | \r | |
292 | @retval EFI_SUCCESS The bulk transfer was completed successfully.\r | |
293 | @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r | |
294 | @retval EFI_OUT_OF_RESOURCES The bulk transfer could not be submitted due to a lack of resources.\r | |
295 | @retval EFI_TIMEOUT The bulk transfer failed due to timeout.\r | |
296 | @retval EFI_DEVICE_ERROR The bulk transfer failed due to host controller or device error.\r | |
297 | Caller should check TransferResult for detailed error information.\r | |
298 | \r | |
299 | **/\r | |
300 | typedef\r | |
301 | EFI_STATUS\r | |
302 | (EFIAPI *EFI_USB2_HC_PROTOCOL_BULK_TRANSFER)(\r | |
303 | IN EFI_USB2_HC_PROTOCOL *This,\r | |
304 | IN UINT8 DeviceAddress,\r | |
305 | IN UINT8 EndPointAddress,\r | |
306 | IN UINT8 DeviceSpeed,\r | |
307 | IN UINTN MaximumPacketLength,\r | |
308 | IN UINT8 DataBuffersNumber,\r | |
309 | IN OUT VOID *Data[EFI_USB_MAX_BULK_BUFFER_NUM],\r | |
310 | IN OUT UINTN *DataLength,\r | |
311 | IN OUT UINT8 *DataToggle,\r | |
312 | IN UINTN TimeOut,\r | |
313 | IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r | |
314 | OUT UINT32 *TransferResult\r | |
315 | )\r | |
316 | ;\r | |
317 | \r | |
318 | /**\r | |
319 | Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.\r | |
320 | Translator parameter doesn't exist in UEFI2.0 spec, but it will be updated in the following specification version.\r | |
321 | \r | |
322 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
323 | @param DeviceAddress Represents the address of the target device on the USB.\r | |
324 | @param EndPointAddress The combination of an endpoint number and an endpoint direction of the\r | |
325 | target USB device.\r | |
326 | @param DeviceSpeed Indicates device speed.\r | |
327 | @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of\r | |
328 | sending or receiving.\r | |
329 | @param IsNewTransfer If TRUE, an asynchronous interrupt pipe is built between the host and the\r | |
330 | target interrupt endpoint. If FALSE, the specified asynchronous interrupt\r | |
331 | pipe is canceled. If TRUE, and an interrupt transfer exists for the target\r | |
332 | end point, then EFI_INVALID_PARAMETER is returned.\r | |
333 | @param DataToggle A pointer to the data toggle value.\r | |
334 | @param PollingInterval Indicates the interval, in milliseconds, that the asynchronous interrupt\r | |
335 | transfer is polled.\r | |
336 | @param DataLength Indicates the length of data to be received at the rate specified by\r | |
337 | PollingInterval from the target asynchronous interrupt endpoint.\r | |
338 | @param Translator A pointr to the transaction translator data.\r | |
339 | @param CallBackFunction The Callback function. This function is called at the rate specified by\r | |
340 | PollingInterval.\r | |
341 | @param Context The context that is passed to the CallBackFunction. This is an\r | |
342 | optional parameter and may be NULL.\r | |
343 | \r | |
344 | @retval EFI_SUCCESS The asynchronous interrupt transfer request has been successfully\r | |
345 | submitted or canceled.\r | |
346 | @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r | |
347 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r | |
348 | \r | |
349 | **/\r | |
350 | typedef\r | |
351 | EFI_STATUS\r | |
352 | (EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER)(\r | |
353 | IN EFI_USB2_HC_PROTOCOL *This,\r | |
354 | IN UINT8 DeviceAddress,\r | |
355 | IN UINT8 EndPointAddress,\r | |
356 | IN UINT8 DeviceSpeed,\r | |
357 | IN UINTN MaxiumPacketLength,\r | |
358 | IN BOOLEAN IsNewTransfer,\r | |
359 | IN OUT UINT8 *DataToggle,\r | |
360 | IN UINTN PollingInterval OPTIONAL,\r | |
361 | IN UINTN DataLength OPTIONAL,\r | |
362 | IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator OPTIONAL,\r | |
363 | IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction OPTIONAL,\r | |
364 | IN VOID *Context OPTIONAL\r | |
365 | )\r | |
366 | ;\r | |
367 | \r | |
368 | /**\r | |
369 | Submits synchronous interrupt transfer to an interrupt endpoint of a USB device.\r | |
370 | Translator parameter doesn't exist in UEFI2.0 spec, but it will be updated in the following specification version.\r | |
371 | \r | |
372 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
373 | @param DeviceAddress Represents the address of the target device on the USB.\r | |
374 | @param EndPointAddress The combination of an endpoint number and an endpoint direction of the\r | |
375 | target USB device.\r | |
376 | @param DeviceSpeed Indicates device speed.\r | |
377 | @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of\r | |
378 | sending or receiving.\r | |
379 | @param Data A pointer to the buffer of data that will be transmitted to USB device or\r | |
380 | received from USB device.\r | |
381 | @param DataLength On input, the size, in bytes, of the data buffer specified by Data. On\r | |
382 | output, the number of bytes transferred.\r | |
383 | @param DataToggle A pointer to the data toggle value.\r | |
384 | @param TimeOut Indicates the maximum time, in milliseconds, which the transfer is\r | |
385 | allowed to complete.\r | |
386 | @param Translator A pointr to the transaction translator data.\r | |
387 | @param TransferResult A pointer to the detailed result information from the synchronous\r | |
388 | interrupt transfer.\r | |
389 | \r | |
390 | @retval EFI_SUCCESS The synchronous interrupt transfer was completed successfully.\r | |
391 | @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r | |
392 | @retval EFI_OUT_OF_RESOURCES The synchronous interrupt transfer could not be submitted due to a lack of resources.\r | |
393 | @retval EFI_TIMEOUT The synchronous interrupt transfer failed due to timeout.\r | |
394 | @retval EFI_DEVICE_ERROR The synchronous interrupt transfer failed due to host controller or device error.\r | |
395 | Caller should check TransferResult for detailed error information.\r | |
396 | \r | |
397 | **/\r | |
398 | typedef\r | |
399 | EFI_STATUS\r | |
400 | (EFIAPI *EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER)(\r | |
401 | IN EFI_USB2_HC_PROTOCOL *This,\r | |
402 | IN UINT8 DeviceAddress,\r | |
403 | IN UINT8 EndPointAddress,\r | |
404 | IN UINT8 DeviceSpeed,\r | |
405 | IN UINTN MaximumPacketLength,\r | |
406 | IN OUT VOID *Data,\r | |
407 | IN OUT UINTN *DataLength,\r | |
408 | IN OUT UINT8 *DataToggle,\r | |
409 | IN UINTN TimeOut,\r | |
410 | IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r | |
411 | OUT UINT32 *TransferResult\r | |
412 | )\r | |
413 | ;\r | |
414 | \r | |
415 | #define EFI_USB_MAX_ISO_BUFFER_NUM 7\r | |
416 | #define EFI_USB_MAX_ISO_BUFFER_NUM1 2\r | |
417 | \r | |
418 | /**\r | |
419 | Submits isochronous transfer to an isochronous endpoint of a USB device.\r | |
420 | \r | |
421 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
422 | @param DeviceAddress Represents the address of the target device on the USB.\r | |
423 | @param EndPointAddress The combination of an endpoint number and an endpoint direction of the\r | |
424 | target USB device.\r | |
425 | @param DeviceSpeed Indicates device speed.\r | |
426 | @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of\r | |
427 | sending or receiving.\r | |
428 | @param DataBuffersNumber Number of data buffers prepared for the transfer.\r | |
429 | @param Data Array of pointers to the buffers of data that will be transmitted to USB\r | |
430 | device or received from USB device.\r | |
431 | @param DataLength Specifies the length, in bytes, of the data to be sent to or received from\r | |
432 | the USB device.\r | |
433 | @param Translator A pointer to the transaction translator data.\r | |
434 | @param TransferResult A pointer to the detailed result information of the isochronous transfer.\r | |
435 | \r | |
436 | @retval EFI_SUCCESS The isochronous transfer was completed successfully.\r | |
437 | @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r | |
438 | @retval EFI_OUT_OF_RESOURCES The isochronous transfer could not be submitted due to a lack of resources.\r | |
439 | @retval EFI_TIMEOUT The isochronous transfer cannot be completed within the one USB frame time.\r | |
440 | @retval EFI_DEVICE_ERROR The isochronous transfer failed due to host controller or device error.\r | |
441 | Caller should check TransferResult for detailed error information.\r | |
442 | \r | |
443 | **/\r | |
444 | typedef\r | |
445 | EFI_STATUS\r | |
446 | (EFIAPI *EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER)(\r | |
447 | IN EFI_USB2_HC_PROTOCOL *This,\r | |
448 | IN UINT8 DeviceAddress,\r | |
449 | IN UINT8 EndPointAddress,\r | |
450 | IN UINT8 DeviceSpeed,\r | |
451 | IN UINTN MaximumPacketLength,\r | |
452 | IN UINT8 DataBuffersNumber,\r | |
453 | IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],\r | |
454 | IN UINTN DataLength,\r | |
455 | IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r | |
456 | OUT UINT32 *TransferResult\r | |
457 | )\r | |
458 | ;\r | |
459 | \r | |
460 | /**\r | |
461 | Submits nonblocking isochronous transfer to an isochronous endpoint of a USB device.\r | |
462 | \r | |
463 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
464 | @param DeviceAddress Represents the address of the target device on the USB.\r | |
465 | @param EndPointAddress The combination of an endpoint number and an endpoint direction of the\r | |
466 | target USB device.\r | |
467 | @param DeviceSpeed Indicates device speed.\r | |
468 | @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of\r | |
469 | sending or receiving.\r | |
470 | @param DataBuffersNumber Number of data buffers prepared for the transfer.\r | |
471 | @param Data Array of pointers to the buffers of data that will be transmitted to USB\r | |
472 | device or received from USB device.\r | |
473 | @param DataLength Specifies the length, in bytes, of the data to be sent to or received from\r | |
474 | the USB device.\r | |
475 | @param Translator A pointer to the transaction translator data.\r | |
476 | @param IsochronousCallback The Callback function. This function is called if the requested\r | |
477 | isochronous transfer is completed.\r | |
478 | @param Context Data passed to the IsochronousCallback function. This is an\r | |
479 | optional parameter and may be NULL.\r | |
480 | \r | |
481 | @retval EFI_SUCCESS The asynchronous isochronous transfer request has been successfully\r | |
482 | submitted or canceled.\r | |
483 | @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r | |
484 | @retval EFI_OUT_OF_RESOURCES The asynchronous isochronous transfer could not be submitted due to\r | |
485 | a lack of resources.\r | |
486 | \r | |
487 | **/\r | |
488 | typedef\r | |
489 | EFI_STATUS\r | |
490 | (EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER)(\r | |
491 | IN EFI_USB2_HC_PROTOCOL *This,\r | |
492 | IN UINT8 DeviceAddress,\r | |
493 | IN UINT8 EndPointAddress,\r | |
494 | IN UINT8 DeviceSpeed,\r | |
495 | IN UINTN MaximumPacketLength,\r | |
496 | IN UINT8 DataBuffersNumber,\r | |
497 | IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],\r | |
498 | IN UINTN DataLength,\r | |
499 | IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r | |
500 | IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,\r | |
501 | IN VOID *Context OPTIONAL\r | |
502 | )\r | |
503 | ;\r | |
504 | \r | |
505 | /**\r | |
506 | Retrieves the current status of a USB root hub port.\r | |
507 | \r | |
508 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
509 | @param PortNumber Specifies the root hub port from which the status is to be retrieved.\r | |
510 | This value is zero based.\r | |
511 | @param PortStatus A pointer to the current port status bits and port status change bits.\r | |
512 | \r | |
513 | @retval EFI_SUCCESS The status of the USB root hub port specified by PortNumber\r | |
514 | was returned in PortStatus.\r | |
515 | @retval EFI_INVALID_PARAMETER PortNumber is invalid.\r | |
516 | \r | |
517 | **/\r | |
518 | typedef\r | |
519 | EFI_STATUS\r | |
520 | (EFIAPI *EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS)(\r | |
521 | IN CONST EFI_USB2_HC_PROTOCOL *This,\r | |
522 | IN CONST UINT8 PortNumber,\r | |
523 | OUT EFI_USB_PORT_STATUS *PortStatus\r | |
524 | )\r | |
525 | ;\r | |
526 | \r | |
527 | /**\r | |
528 | Sets a feature for the specified root hub port.\r | |
529 | \r | |
530 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
531 | @param PortNumber Specifies the root hub port whose feature is requested to be set. This\r | |
532 | value is zero based.\r | |
533 | @param PortFeature Indicates the feature selector associated with the feature set request.\r | |
534 | \r | |
535 | @retval EFI_SUCCESS The feature specified by PortFeature was set for the USB\r | |
536 | root hub port specified by PortNumber.\r | |
537 | @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.\r | |
538 | \r | |
539 | **/\r | |
540 | typedef\r | |
541 | EFI_STATUS\r | |
542 | (EFIAPI *EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE)(\r | |
543 | IN EFI_USB2_HC_PROTOCOL *This,\r | |
544 | IN UINT8 PortNumber,\r | |
545 | IN EFI_USB_PORT_FEATURE PortFeature\r | |
546 | )\r | |
547 | ;\r | |
548 | \r | |
549 | /**\r | |
550 | Clears a feature for the specified root hub port.\r | |
551 | \r | |
552 | @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r | |
553 | @param PortNumber Specifies the root hub port whose feature is requested to be cleared. This\r | |
554 | value is zero based.\r | |
555 | @param PortFeature Indicates the feature selector associated with the feature clear request.\r | |
556 | \r | |
557 | @retval EFI_SUCCESS The feature specified by PortFeature was cleared for the USB\r | |
558 | root hub port specified by PortNumber.\r | |
559 | @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.\r | |
560 | \r | |
561 | **/\r | |
562 | typedef\r | |
563 | EFI_STATUS\r | |
564 | (EFIAPI *EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE)(\r | |
565 | IN EFI_USB2_HC_PROTOCOL *This,\r | |
566 | IN UINT8 PortNumber,\r | |
567 | IN EFI_USB_PORT_FEATURE PortFeature\r | |
568 | )\r | |
569 | ;\r | |
570 | \r | |
571 | struct _EFI_USB2_HC_PROTOCOL {\r | |
572 | EFI_USB2_HC_PROTOCOL_GET_CAPABILITY GetCapability;\r | |
573 | EFI_USB2_HC_PROTOCOL_RESET Reset;\r | |
574 | EFI_USB2_HC_PROTOCOL_GET_STATE GetState;\r | |
575 | EFI_USB2_HC_PROTOCOL_SET_STATE SetState;\r | |
576 | EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER ControlTransfer;\r | |
577 | EFI_USB2_HC_PROTOCOL_BULK_TRANSFER BulkTransfer;\r | |
578 | EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER AsyncInterruptTransfer;\r | |
579 | EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER SyncInterruptTransfer;\r | |
580 | EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER IsochronousTransfer;\r | |
581 | EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER AsyncIsochronousTransfer;\r | |
582 | EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS GetRootHubPortStatus;\r | |
583 | EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE SetRootHubPortFeature;\r | |
584 | EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE ClearRootHubPortFeature;\r | |
585 | UINT16 MajorRevision;\r | |
586 | UINT16 MinorRevision;\r | |
587 | };\r | |
588 | \r | |
589 | extern EFI_GUID gEfiUsb2HcProtocolGuid;\r | |
590 | \r | |
591 | #endif\r |