TianoCore EDK2 master
Loading...
Searching...
No Matches
Usb2HostController.h
Go to the documentation of this file.
1
12#ifndef _USB2_HOSTCONTROLLER_H_
13#define _USB2_HOSTCONTROLLER_H_
14
15#include <Protocol/UsbIo.h>
16
17#define EFI_USB2_HC_PROTOCOL_GUID \
18 { \
19 0x3e745226, 0x9818, 0x45b6, {0xa2, 0xac, 0xd7, 0xcd, 0xe, 0x8b, 0xa2, 0xbc } \
20 }
21
26
27typedef struct {
28 UINT16 PortStatus;
31
35#define USB_PORT_STAT_CONNECTION 0x0001
36#define USB_PORT_STAT_ENABLE 0x0002
37#define USB_PORT_STAT_SUSPEND 0x0004
38#define USB_PORT_STAT_OVERCURRENT 0x0008
39#define USB_PORT_STAT_RESET 0x0010
40#define USB_PORT_STAT_POWER 0x0100
41#define USB_PORT_STAT_LOW_SPEED 0x0200
42#define USB_PORT_STAT_HIGH_SPEED 0x0400
43#define USB_PORT_STAT_SUPER_SPEED 0x0800
44#define USB_PORT_STAT_OWNER 0x2000
45
49#define USB_PORT_STAT_C_CONNECTION 0x0001
50#define USB_PORT_STAT_C_ENABLE 0x0002
51#define USB_PORT_STAT_C_SUSPEND 0x0004
52#define USB_PORT_STAT_C_OVERCURRENT 0x0008
53#define USB_PORT_STAT_C_RESET 0x0010
54
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
72
73#define EFI_USB_SPEED_FULL 0x0000
74#define EFI_USB_SPEED_LOW 0x0001
75#define EFI_USB_SPEED_HIGH 0x0002
76#define EFI_USB_SPEED_SUPER 0x0003
77
78typedef struct {
82
83//
84// Protocol definitions
85//
86
102typedef
106 OUT UINT8 *MaxSpeed,
107 OUT UINT8 *PortNumber,
108 OUT UINT8 *Is64BitCapable
109 );
110
111#define EFI_USB_HC_RESET_GLOBAL 0x0001
112#define EFI_USB_HC_RESET_HOST_CONTROLLER 0x0002
113#define EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG 0x0004
114#define EFI_USB_HC_RESET_HOST_WITH_DEBUG 0x0008
115
134typedef
138 IN UINT16 Attributes
139 );
140
144typedef enum {
154
162
172
175
189typedef
193 OUT EFI_USB_HC_STATE *State
194 );
195
208typedef
212 IN EFI_USB_HC_STATE State
213 );
214
244typedef
248 IN UINT8 DeviceAddress,
249 IN UINT8 DeviceSpeed,
250 IN UINTN MaximumPacketLength,
251 IN EFI_USB_DEVICE_REQUEST *Request,
252 IN EFI_USB_DATA_DIRECTION TransferDirection,
253 IN OUT VOID *Data OPTIONAL,
254 IN OUT UINTN *DataLength OPTIONAL,
255 IN UINTN TimeOut,
257 OUT UINT32 *TransferResult
258 );
259
260#define EFI_USB_MAX_BULK_BUFFER_NUM 10
261
291typedef
295 IN UINT8 DeviceAddress,
296 IN UINT8 EndPointAddress,
297 IN UINT8 DeviceSpeed,
298 IN UINTN MaximumPacketLength,
299 IN UINT8 DataBuffersNumber,
300 IN OUT VOID *Data[EFI_USB_MAX_BULK_BUFFER_NUM],
301 IN OUT UINTN *DataLength,
302 IN OUT UINT8 *DataToggle,
303 IN UINTN TimeOut,
305 OUT UINT32 *TransferResult
306 );
307
340typedef
344 IN UINT8 DeviceAddress,
345 IN UINT8 EndPointAddress,
346 IN UINT8 DeviceSpeed,
347 IN UINTN MaxiumPacketLength,
348 IN BOOLEAN IsNewTransfer,
349 IN OUT UINT8 *DataToggle,
350 IN UINTN PollingInterval OPTIONAL,
351 IN UINTN DataLength OPTIONAL,
354 IN VOID *Context OPTIONAL
355 );
356
387typedef
391 IN UINT8 DeviceAddress,
392 IN UINT8 EndPointAddress,
393 IN UINT8 DeviceSpeed,
394 IN UINTN MaximumPacketLength,
395 IN OUT VOID *Data,
396 IN OUT UINTN *DataLength,
397 IN OUT UINT8 *DataToggle,
398 IN UINTN TimeOut,
400 OUT UINT32 *TransferResult
401 );
402
403#define EFI_USB_MAX_ISO_BUFFER_NUM 7
404#define EFI_USB_MAX_ISO_BUFFER_NUM1 2
405
463typedef
467 IN UINT8 DeviceAddress,
468 IN UINT8 EndPointAddress,
469 IN UINT8 DeviceSpeed,
470 IN UINTN MaximumPacketLength,
471 IN UINT8 DataBuffersNumber,
472 IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],
473 IN UINTN DataLength,
475 OUT UINT32 *TransferResult
476 );
477
538typedef
542 IN UINT8 DeviceAddress,
543 IN UINT8 EndPointAddress,
544 IN UINT8 DeviceSpeed,
545 IN UINTN MaximumPacketLength,
546 IN UINT8 DataBuffersNumber,
547 IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],
548 IN UINTN DataLength,
550 IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,
551 IN VOID *Context OPTIONAL
552 );
553
567typedef
571 IN UINT8 PortNumber,
572 OUT EFI_USB_PORT_STATUS *PortStatus
573 );
574
588typedef
592 IN UINT8 PortNumber,
593 IN EFI_USB_PORT_FEATURE PortFeature
594 );
595
609typedef
613 IN UINT8 PortNumber,
614 IN EFI_USB_PORT_FEATURE PortFeature
615 );
616
639
646
653};
654
655extern EFI_GUID gEfiUsb2HcProtocolGuid;
656
657#endif
UINT64 UINTN
#define OPTIONAL
Definition: Base.h:290
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER)(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 DeviceAddress, IN UINT8 EndPointAddress, IN UINT8 DeviceSpeed, IN UINTN MaxiumPacketLength, IN BOOLEAN IsNewTransfer, IN OUT UINT8 *DataToggle, IN UINTN PollingInterval OPTIONAL, IN UINTN DataLength OPTIONAL, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator OPTIONAL, IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction OPTIONAL, IN VOID *Context OPTIONAL)
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER)(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 DeviceAddress, IN UINT8 EndPointAddress, IN UINT8 DeviceSpeed, IN UINTN MaximumPacketLength, IN OUT VOID *Data, IN OUT UINTN *DataLength, IN OUT UINT8 *DataToggle, IN UINTN TimeOut, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, OUT UINT32 *TransferResult)
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_GET_CAPABILITY)(IN EFI_USB2_HC_PROTOCOL *This, OUT UINT8 *MaxSpeed, OUT UINT8 *PortNumber, OUT UINT8 *Is64BitCapable)
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER)(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 DeviceAddress, IN UINT8 EndPointAddress, IN UINT8 DeviceSpeed, IN UINTN MaximumPacketLength, IN UINT8 DataBuffersNumber, IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM], IN UINTN DataLength, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack, IN VOID *Context OPTIONAL)
EFI_USB_PORT_FEATURE
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS)(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 PortNumber, OUT EFI_USB_PORT_STATUS *PortStatus)
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_RESET)(IN EFI_USB2_HC_PROTOCOL *This, IN UINT16 Attributes)
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE)(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 PortNumber, IN EFI_USB_PORT_FEATURE PortFeature)
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_SET_STATE)(IN EFI_USB2_HC_PROTOCOL *This, IN EFI_USB_HC_STATE State)
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_BULK_TRANSFER)(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 DeviceAddress, IN UINT8 EndPointAddress, IN UINT8 DeviceSpeed, IN UINTN MaximumPacketLength, IN UINT8 DataBuffersNumber, IN OUT VOID *Data[EFI_USB_MAX_BULK_BUFFER_NUM], IN OUT UINTN *DataLength, IN OUT UINT8 *DataToggle, IN UINTN TimeOut, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, OUT UINT32 *TransferResult)
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER)(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 DeviceAddress, IN UINT8 DeviceSpeed, IN UINTN MaximumPacketLength, IN EFI_USB_DEVICE_REQUEST *Request, IN EFI_USB_DATA_DIRECTION TransferDirection, IN OUT VOID *Data OPTIONAL, IN OUT UINTN *DataLength OPTIONAL, IN UINTN TimeOut, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, OUT UINT32 *TransferResult)
EFI_USB_HC_STATE
@ EfiUsbHcStateHalt
@ EfiUsbHcStateOperational
@ EfiUsbHcStateSuspend
@ EfiUsbHcStateMaximum
Maximum value for enumration value of HC status.
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER)(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 DeviceAddress, IN UINT8 EndPointAddress, IN UINT8 DeviceSpeed, IN UINTN MaximumPacketLength, IN UINT8 DataBuffersNumber, IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM], IN UINTN DataLength, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, OUT UINT32 *TransferResult)
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_GET_STATE)(IN EFI_USB2_HC_PROTOCOL *This, OUT EFI_USB_HC_STATE *State)
EFI_STATUS(EFIAPI * EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE)(IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 PortNumber, IN EFI_USB_PORT_FEATURE PortFeature)
EFI_USB_DATA_DIRECTION
Definition: UsbIo.h:44
EFI_STATUS(EFIAPI * EFI_ASYNC_USB_TRANSFER_CALLBACK)(IN VOID *Data, IN UINTN DataLength, IN VOID *Context, IN UINT32 Status)
Definition: UsbIo.h:80
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
UINT8 TranslatorPortNumber
the port number of the hub that device is connected to.
UINT16 PortChangeStatus
Contains current port status change bitmap.
UINT16 PortStatus
Contains current port status bitmap.
Definition: Base.h:213