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