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