]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/Usb2HostController.h
clean up the un-suitable ';' location when declaring the functions.
[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
20b1aab6 144\r
4ca9b6c4
LG
145 @param EfiUsbHcStateHalt The host controller is in halt\r
146 state. No USB transactions can occur\r
147 while in this state. The host\r
148 controller can enter this state for\r
149 three reasons: 1) After host\r
150 controller hardware reset. 2)\r
151 Explicitly set by software. 3)\r
152 Triggered by a fatal error such as\r
153 consistency check failure.\r
20b1aab6 154\r
155\r
d1f95000 156 @param EfiUsbHcStateOperational The host controller is in an\r
157 operational state. When in\r
158 this state, the host\r
159 controller can execute bus\r
160 traffic. This state must be\r
161 explicitly set to enable the\r
162 USB bus traffic.\r
20b1aab6 163\r
164\r
4ca9b6c4
LG
165 @param 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
20b1aab6 174\r
d1f95000 175**/\r
176typedef enum {\r
177 EfiUsbHcStateHalt,\r
178 EfiUsbHcStateOperational,\r
179 EfiUsbHcStateSuspend,\r
180 EfiUsbHcStateMaximum\r
181} EFI_USB_HC_STATE;\r
182\r
183/**\r
184 Retrieves current state of the USB host controller.\r
185\r
186 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
187 @param State A pointer to the EFI_USB_HC_STATE data structure that\r
188 indicates current state of the USB host controller.\r
189\r
190 @retval EFI_SUCCESS The state information of the host controller was returned in State.\r
191 @retval EFI_INVALID_PARAMETER State is NULL.\r
192 @retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve the\r
193 host controller's current state.\r
194\r
195**/\r
196typedef\r
197EFI_STATUS\r
8b13229b 198(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_STATE)(\r
d1f95000 199 IN CONST EFI_USB2_HC_PROTOCOL *This,\r
200 OUT EFI_USB_HC_STATE *State\r
ed66e1bc 201);\r
d1f95000 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
215typedef\r
216EFI_STATUS\r
8b13229b 217(EFIAPI *EFI_USB2_HC_PROTOCOL_SET_STATE)(\r
d1f95000 218 IN EFI_USB2_HC_PROTOCOL *This,\r
219 IN EFI_USB_HC_STATE State\r
ed66e1bc 220 );\r
d1f95000 221\r
222/**\r
223 Submits control transfer to a target USB device.\r
224\r
225 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
226 @param DeviceAddress Represents the address of the target device on the USB.\r
227 @param DeviceSpeed Indicates device speed.\r
228 @param MaximumPacketLength Indicates the maximum packet size that the default control transfer\r
229 endpoint is capable of sending or receiving.\r
230 @param Request A pointer to the USB device request that will be sent to the USB device.\r
231 @param TransferDirection Specifies the data direction for the transfer. There are three values\r
232 available, EfiUsbDataIn, EfiUsbDataOut and EfiUsbNoData.\r
233 @param Data A pointer to the buffer of data that will be transmitted to USB device or\r
234 received from USB device.\r
235 @param DataLength On input, indicates the size, in bytes, of the data buffer specified by Data.\r
236 On output, indicates the amount of data actually transferred.\r
d1f95000 237 @param TimeOut Indicates the maximum time, in milliseconds, which the transfer is\r
238 allowed to complete.\r
4ca9b6c4 239 @param Translator A pointer to the transaction translator data.\r
d1f95000 240 @param TransferResult A pointer to the detailed result information generated by this control\r
241 transfer.\r
242\r
243 @retval EFI_SUCCESS The control transfer was completed successfully.\r
244 @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
245 @retval EFI_OUT_OF_RESOURCES The control transfer could not be completed due to a lack of resources.\r
246 @retval EFI_TIMEOUT The control transfer failed due to timeout.\r
247 @retval EFI_DEVICE_ERROR The control transfer failed due to host controller or device error.\r
248 Caller should check TransferResult for detailed error information.\r
249\r
250**/\r
251typedef\r
252EFI_STATUS\r
8b13229b 253(EFIAPI *EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER)(\r
d1f95000 254 IN EFI_USB2_HC_PROTOCOL *This,\r
255 IN UINT8 DeviceAddress,\r
256 IN UINT8 DeviceSpeed,\r
257 IN UINTN MaximumPacketLength,\r
258 IN EFI_USB_DEVICE_REQUEST *Request,\r
259 IN EFI_USB_DATA_DIRECTION TransferDirection,\r
260 IN OUT VOID *Data OPTIONAL,\r
261 IN OUT UINTN *DataLength OPTIONAL,\r
262 IN UINTN TimeOut,\r
263 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
264 OUT UINT32 *TransferResult\r
ed66e1bc 265 );\r
d1f95000 266\r
267#define EFI_USB_MAX_BULK_BUFFER_NUM 10\r
268\r
269/**\r
270 Submits bulk transfer to a bulk endpoint of a USB device.\r
271\r
272 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
273 @param DeviceAddress Represents the address of the target device on the USB.\r
274 @param EndPointAddress The combination of an endpoint number and an endpoint direction of the\r
275 target USB device.\r
276 @param DeviceSpeed Indicates device speed.\r
277 @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of\r
278 sending or receiving.\r
279 @param DataBuffersNumber Number of data buffers prepared for the transfer.\r
280 @param Data Array of pointers to the buffers of data that will be transmitted to USB\r
281 device or received from USB device.\r
282 @param DataLength When input, indicates the size, in bytes, of the data buffers specified by\r
283 Data. When output, indicates the actually transferred data size.\r
284 @param DataToggle A pointer to the data toggle value.\r
d1f95000 285 @param TimeOut Indicates the maximum time, in milliseconds, which the transfer is\r
286 allowed to complete.\r
4ca9b6c4 287 @param Translator A pointer to the transaction translator data.\r
d1f95000 288 @param TransferResult A pointer to the detailed result information of the bulk transfer.\r
289\r
290 @retval EFI_SUCCESS The bulk transfer was completed successfully.\r
291 @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
292 @retval EFI_OUT_OF_RESOURCES The bulk transfer could not be submitted due to a lack of resources.\r
293 @retval EFI_TIMEOUT The bulk transfer failed due to timeout.\r
294 @retval EFI_DEVICE_ERROR The bulk transfer failed due to host controller or device error.\r
295 Caller should check TransferResult for detailed error information.\r
296\r
297**/\r
298typedef\r
299EFI_STATUS\r
8b13229b 300(EFIAPI *EFI_USB2_HC_PROTOCOL_BULK_TRANSFER)(\r
d1f95000 301 IN EFI_USB2_HC_PROTOCOL *This,\r
302 IN UINT8 DeviceAddress,\r
303 IN UINT8 EndPointAddress,\r
304 IN UINT8 DeviceSpeed,\r
305 IN UINTN MaximumPacketLength,\r
306 IN UINT8 DataBuffersNumber,\r
307 IN OUT VOID *Data[EFI_USB_MAX_BULK_BUFFER_NUM],\r
308 IN OUT UINTN *DataLength,\r
309 IN OUT UINT8 *DataToggle,\r
310 IN UINTN TimeOut,\r
311 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
312 OUT UINT32 *TransferResult\r
ed66e1bc 313 );\r
d1f95000 314\r
315/**\r
316 Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.\r
317 Translator parameter doesn't exist in UEFI2.0 spec, but it will be updated in the following specification version.\r
20b1aab6 318\r
d1f95000 319 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
320 @param DeviceAddress Represents the address of the target device on the USB.\r
321 @param EndPointAddress The combination of an endpoint number and an endpoint direction of the\r
322 target USB device.\r
323 @param DeviceSpeed Indicates device speed.\r
324 @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of\r
325 sending or receiving.\r
326 @param IsNewTransfer If TRUE, an asynchronous interrupt pipe is built between the host and the\r
327 target interrupt endpoint. If FALSE, the specified asynchronous interrupt\r
328 pipe is canceled. If TRUE, and an interrupt transfer exists for the target\r
329 end point, then EFI_INVALID_PARAMETER is returned.\r
330 @param DataToggle A pointer to the data toggle value.\r
331 @param PollingInterval Indicates the interval, in milliseconds, that the asynchronous interrupt\r
332 transfer is polled.\r
333 @param DataLength Indicates the length of data to be received at the rate specified by\r
334 PollingInterval from the target asynchronous interrupt endpoint.\r
335 @param Translator A pointr to the transaction translator data.\r
336 @param CallBackFunction The Callback function. This function is called at the rate specified by\r
337 PollingInterval.\r
338 @param Context The context that is passed to the CallBackFunction. This is an\r
339 optional parameter and may be NULL.\r
340\r
341 @retval EFI_SUCCESS The asynchronous interrupt transfer request has been successfully\r
342 submitted or canceled.\r
343 @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
344 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
345\r
346**/\r
347typedef\r
348EFI_STATUS\r
8b13229b 349(EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER)(\r
d1f95000 350 IN EFI_USB2_HC_PROTOCOL *This,\r
351 IN UINT8 DeviceAddress,\r
352 IN UINT8 EndPointAddress,\r
353 IN UINT8 DeviceSpeed,\r
354 IN UINTN MaxiumPacketLength,\r
355 IN BOOLEAN IsNewTransfer,\r
356 IN OUT UINT8 *DataToggle,\r
357 IN UINTN PollingInterval OPTIONAL,\r
358 IN UINTN DataLength OPTIONAL,\r
359 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator OPTIONAL,\r
360 IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction OPTIONAL,\r
361 IN VOID *Context OPTIONAL\r
ed66e1bc 362 );\r
d1f95000 363\r
364/**\r
365 Submits synchronous interrupt transfer to an interrupt endpoint of a USB device.\r
366 Translator parameter doesn't exist in UEFI2.0 spec, but it will be updated in the following specification version.\r
367\r
368 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
369 @param DeviceAddress Represents the address of the target device on the USB.\r
370 @param EndPointAddress The combination of an endpoint number and an endpoint direction of the\r
371 target USB device.\r
372 @param DeviceSpeed Indicates device speed.\r
373 @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of\r
374 sending or receiving.\r
375 @param Data A pointer to the buffer of data that will be transmitted to USB device or\r
376 received from USB device.\r
377 @param DataLength On input, the size, in bytes, of the data buffer specified by Data. On\r
378 output, the number of bytes transferred.\r
379 @param DataToggle A pointer to the data toggle value.\r
380 @param TimeOut Indicates the maximum time, in milliseconds, which the transfer is\r
381 allowed to complete.\r
382 @param Translator A pointr to the transaction translator data.\r
383 @param TransferResult A pointer to the detailed result information from the synchronous\r
384 interrupt transfer.\r
385\r
386 @retval EFI_SUCCESS The synchronous interrupt transfer was completed successfully.\r
387 @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
388 @retval EFI_OUT_OF_RESOURCES The synchronous interrupt transfer could not be submitted due to a lack of resources.\r
389 @retval EFI_TIMEOUT The synchronous interrupt transfer failed due to timeout.\r
390 @retval EFI_DEVICE_ERROR The synchronous interrupt transfer failed due to host controller or device error.\r
391 Caller should check TransferResult for detailed error information.\r
392\r
393**/\r
394typedef\r
395EFI_STATUS\r
8b13229b 396(EFIAPI *EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER)(\r
d1f95000 397 IN EFI_USB2_HC_PROTOCOL *This,\r
398 IN UINT8 DeviceAddress,\r
399 IN UINT8 EndPointAddress,\r
400 IN UINT8 DeviceSpeed,\r
401 IN UINTN MaximumPacketLength,\r
402 IN OUT VOID *Data,\r
403 IN OUT UINTN *DataLength,\r
404 IN OUT UINT8 *DataToggle,\r
405 IN UINTN TimeOut,\r
406 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
407 OUT UINT32 *TransferResult\r
ed66e1bc 408 );\r
d1f95000 409\r
410#define EFI_USB_MAX_ISO_BUFFER_NUM 7\r
411#define EFI_USB_MAX_ISO_BUFFER_NUM1 2\r
412\r
413/**\r
414 Submits isochronous transfer to an isochronous endpoint of a USB device.\r
415\r
416 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
417 @param DeviceAddress Represents the address of the target device on the USB.\r
418 @param EndPointAddress The combination of an endpoint number and an endpoint direction of the\r
419 target USB device.\r
420 @param DeviceSpeed Indicates device speed.\r
421 @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of\r
422 sending or receiving.\r
423 @param DataBuffersNumber Number of data buffers prepared for the transfer.\r
424 @param Data Array of pointers to the buffers of data that will be transmitted to USB\r
425 device or received from USB device.\r
426 @param DataLength Specifies the length, in bytes, of the data to be sent to or received from\r
427 the USB device.\r
428 @param Translator A pointer to the transaction translator data.\r
429 @param TransferResult A pointer to the detailed result information of the isochronous transfer.\r
430\r
431 @retval EFI_SUCCESS The isochronous transfer was completed successfully.\r
432 @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
433 @retval EFI_OUT_OF_RESOURCES The isochronous transfer could not be submitted due to a lack of resources.\r
434 @retval EFI_TIMEOUT The isochronous transfer cannot be completed within the one USB frame time.\r
435 @retval EFI_DEVICE_ERROR The isochronous transfer failed due to host controller or device error.\r
436 Caller should check TransferResult for detailed error information.\r
437\r
438**/\r
439typedef\r
440EFI_STATUS\r
8b13229b 441(EFIAPI *EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER)(\r
d1f95000 442 IN EFI_USB2_HC_PROTOCOL *This,\r
443 IN UINT8 DeviceAddress,\r
444 IN UINT8 EndPointAddress,\r
445 IN UINT8 DeviceSpeed,\r
446 IN UINTN MaximumPacketLength,\r
447 IN UINT8 DataBuffersNumber,\r
448 IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],\r
449 IN UINTN DataLength,\r
450 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
451 OUT UINT32 *TransferResult\r
ed66e1bc 452 );\r
d1f95000 453\r
454/**\r
455 Submits nonblocking isochronous transfer to an isochronous endpoint of a USB device.\r
456\r
457 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
458 @param DeviceAddress Represents the address of the target device on the USB.\r
459 @param EndPointAddress The combination of an endpoint number and an endpoint direction of the\r
460 target USB device.\r
461 @param DeviceSpeed Indicates device speed.\r
462 @param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of\r
463 sending or receiving.\r
464 @param DataBuffersNumber Number of data buffers prepared for the transfer.\r
465 @param Data Array of pointers to the buffers of data that will be transmitted to USB\r
466 device or received from USB device.\r
467 @param DataLength Specifies the length, in bytes, of the data to be sent to or received from\r
468 the USB device.\r
469 @param Translator A pointer to the transaction translator data.\r
470 @param IsochronousCallback The Callback function. This function is called if the requested\r
471 isochronous transfer is completed.\r
472 @param Context Data passed to the IsochronousCallback function. This is an\r
473 optional parameter and may be NULL.\r
474\r
475 @retval EFI_SUCCESS The asynchronous isochronous transfer request has been successfully\r
476 submitted or canceled.\r
477 @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
478 @retval EFI_OUT_OF_RESOURCES The asynchronous isochronous transfer could not be submitted due to\r
479 a lack of resources.\r
480\r
481**/\r
482typedef\r
483EFI_STATUS\r
8b13229b 484(EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER)(\r
d1f95000 485 IN EFI_USB2_HC_PROTOCOL *This,\r
486 IN UINT8 DeviceAddress,\r
487 IN UINT8 EndPointAddress,\r
488 IN UINT8 DeviceSpeed,\r
489 IN UINTN MaximumPacketLength,\r
490 IN UINT8 DataBuffersNumber,\r
491 IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],\r
492 IN UINTN DataLength,\r
493 IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
494 IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,\r
495 IN VOID *Context OPTIONAL\r
ed66e1bc 496 );\r
d1f95000 497\r
498/**\r
499 Retrieves the current status of a USB root hub port.\r
500\r
501 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
502 @param PortNumber Specifies the root hub port from which the status is to be retrieved.\r
503 This value is zero based.\r
504 @param PortStatus A pointer to the current port status bits and port status change bits.\r
505\r
506 @retval EFI_SUCCESS The status of the USB root hub port specified by PortNumber\r
507 was returned in PortStatus.\r
508 @retval EFI_INVALID_PARAMETER PortNumber is invalid.\r
509\r
510**/\r
511typedef\r
512EFI_STATUS\r
8b13229b 513(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS)(\r
d1f95000 514 IN CONST EFI_USB2_HC_PROTOCOL *This,\r
515 IN CONST UINT8 PortNumber,\r
516 OUT EFI_USB_PORT_STATUS *PortStatus\r
ed66e1bc 517 );\r
d1f95000 518\r
519/**\r
520 Sets a feature for the specified root hub port.\r
521\r
522 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
523 @param PortNumber Specifies the root hub port whose feature is requested to be set. This\r
524 value is zero based.\r
525 @param PortFeature Indicates the feature selector associated with the feature set request.\r
526\r
527 @retval EFI_SUCCESS The feature specified by PortFeature was set for the USB\r
528 root hub port specified by PortNumber.\r
529 @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.\r
530\r
531**/\r
532typedef\r
533EFI_STATUS\r
8b13229b 534(EFIAPI *EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE)(\r
d1f95000 535 IN EFI_USB2_HC_PROTOCOL *This,\r
536 IN UINT8 PortNumber,\r
537 IN EFI_USB_PORT_FEATURE PortFeature\r
ed66e1bc 538 );\r
d1f95000 539\r
540/**\r
541 Clears a feature for the specified root hub port.\r
542\r
543 @param This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
544 @param PortNumber Specifies the root hub port whose feature is requested to be cleared. This\r
545 value is zero based.\r
546 @param PortFeature Indicates the feature selector associated with the feature clear request.\r
547\r
548 @retval EFI_SUCCESS The feature specified by PortFeature was cleared for the USB\r
549 root hub port specified by PortNumber.\r
550 @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.\r
551\r
552**/\r
553typedef\r
554EFI_STATUS\r
8b13229b 555(EFIAPI *EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE)(\r
d1f95000 556 IN EFI_USB2_HC_PROTOCOL *This,\r
557 IN UINT8 PortNumber,\r
558 IN EFI_USB_PORT_FEATURE PortFeature\r
ed66e1bc 559 );\r
d1f95000 560\r
4ca9b6c4
LG
561/** \r
562 @par Protocol Description:\r
563 The EFI_USB2_HC_PROTOCOL provides USB host controller management, basic \r
564 data transactions over a USB bus, and USB root hub access. A device driver \r
565 that wishes to manage a USB bus in a system retrieves the EFI_USB2_HC_PROTOCOL \r
566 instance that is associated with the USB bus to be managed. A device handle \r
567 for a USB host controller will minimally contain an EFI_DEVICE_PATH_PROTOCOL \r
568 instance, and an EFI_USB2_HC_PROTOCOL instance.\r
569\r
570 @param GetCapability\r
571 Retrieves the capabilities of the USB host controller. \r
572\r
573 @param Reset\r
574 Software reset of USB. \r
575\r
576 @param GetState\r
577 Retrieves the current state of the USB host controller. \r
578\r
579 @param SetState\r
580 Sets the USB host controller to a specific state. \r
581\r
582 @param ControlTransfer\r
583 Submits a control transfer to a target USB device. \r
584\r
585 @param BulkTransfer\r
586 Submits a bulk transfer to a bulk endpoint of a USB device. \r
587\r
588 @param AsyncInterruptTransfer\r
589 Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device. \r
590\r
591 @param SyncInterruptTransfer\r
592 Submits a synchronous interrupt transfer to an interrupt endpoint of a USB device. \r
593\r
594 @param IsochronousTransfer\r
595 Submits isochronous transfer to an isochronous endpoint of a USB device. \r
596\r
597 @param AsyncIsochronousTransfer\r
598 Submits nonblocking USB isochronous transfer. \r
599\r
600 @param GetRootHubPortStatus\r
601 Retrieves the status of the specified root hub port. \r
602\r
603 @param SetRootHubPortFeature\r
604 Sets the feature for the specified root hub port. \r
605\r
606 @param ClearRootHubPortFeature\r
607 Clears the feature for the specified root hub port. \r
608\r
609 @param MajorRevision\r
610 The major revision number of the USB host controller. The revision information \r
611 indicates the release of the Universal Serial Bus Specification with which the \r
612 host controller is compliant.\r
613\r
614 @param MinorRevision\r
615 The minor revision number of the USB host controller. The revision information \r
616 indicates the release of the Universal Serial Bus Specification with which the \r
617 host controller is compliant.\r
618**/\r
d1f95000 619struct _EFI_USB2_HC_PROTOCOL {\r
620 EFI_USB2_HC_PROTOCOL_GET_CAPABILITY GetCapability;\r
621 EFI_USB2_HC_PROTOCOL_RESET Reset;\r
622 EFI_USB2_HC_PROTOCOL_GET_STATE GetState;\r
623 EFI_USB2_HC_PROTOCOL_SET_STATE SetState;\r
624 EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER ControlTransfer;\r
625 EFI_USB2_HC_PROTOCOL_BULK_TRANSFER BulkTransfer;\r
626 EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER AsyncInterruptTransfer;\r
627 EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER SyncInterruptTransfer;\r
628 EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER IsochronousTransfer;\r
629 EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER AsyncIsochronousTransfer;\r
630 EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS GetRootHubPortStatus;\r
631 EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE SetRootHubPortFeature;\r
632 EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE ClearRootHubPortFeature;\r
633 UINT16 MajorRevision;\r
634 UINT16 MinorRevision;\r
635};\r
636\r
637extern EFI_GUID gEfiUsb2HcProtocolGuid;\r
638\r
639#endif\r