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