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