10#ifndef _EFI_USB_BUS_H_
11#define _EFI_USB_BUS_H_
46#define USB_MAX_LANG_ID 16
47#define USB_MAX_INTERFACE 16
48#define USB_MAX_DEVICES 128
50#define USB_BUS_1_MILLISECOND 1000
57#define USB_ROOTHUB_POLL_INTERVAL (100 * 10000U)
58#define USB_HUB_POLL_INTERVAL 64
64#define USB_WAIT_PORT_STABLE_STALL (100 * USB_BUS_1_MILLISECOND)
69#define USB_WAIT_PORT_STS_CHANGE_STALL (100)
75#define USB_SET_DEVICE_ADDRESS_STALL (2 * USB_BUS_1_MILLISECOND)
80#define USB_RETRY_MAX_PACK_SIZE_STALL (100 * USB_BUS_1_MILLISECOND)
86#define USB_SET_PORT_POWER_STALL (2 * USB_BUS_1_MILLISECOND)
96#define USB_SET_PORT_RESET_STALL (20 * USB_BUS_1_MILLISECOND)
97#define USB_SET_ROOT_PORT_RESET_STALL (50 * USB_BUS_1_MILLISECOND)
103#define USB_SET_PORT_RECOVERY_STALL (10 * USB_BUS_1_MILLISECOND)
108#define USB_CLR_ROOT_PORT_RESET_STALL (20 * USB_BUS_1_MILLISECOND)
113#define USB_SET_ROOT_PORT_ENABLE_STALL (20 * USB_BUS_1_MILLISECOND)
122#define USB_GENERAL_DEVICE_REQUEST_TIMEOUT 500
127#define USB_CLEAR_FEATURE_REQUEST_TIMEOUT 10
133#define USB_BUS_TPL TPL_NOTIFY
135#define USB_INTERFACE_SIGNATURE SIGNATURE_32 ('U', 'S', 'B', 'I')
136#define USB_BUS_SIGNATURE SIGNATURE_32 ('U', 'S', 'B', 'B')
138#define USB_BIT(a) ((UINTN)(1 << (a)))
139#define USB_BIT_IS_SET(Data, Bit) ((BOOLEAN)(((Data) & (Bit)) == (Bit)))
141#define USB_INTERFACE_FROM_USBIO(a) \
142 CR(a, USB_INTERFACE, UsbIo, USB_INTERFACE_SIGNATURE)
144#define USB_BUS_FROM_THIS(a) \
145 CR(a, USB_BUS, BusId, USB_BUS_SIGNATURE)
176 UINT16 LangId[USB_MAX_LANG_ID];
179 UINT8 NumOfInterface;
191 BOOLEAN DisconnectFail;
276 USB_HUB_GET_PORT_STATUS GetPortStatus;
277 USB_HUB_CLEAR_PORT_CHANGE ClearPortChange;
278 USB_HUB_SET_PORT_FEATURE SetPortFeature;
279 USB_HUB_CLEAR_PORT_FEATURE ClearPortFeature;
280 USB_HUB_RESET_PORT ResetPort;
281 USB_HUB_RELEASE Release;
284#define USB_US_LAND_ID 0x0409
286#define DEVICE_PATH_LIST_ITEM_SIGNATURE SIGNATURE_32('d','p','l','i')
390 IN OUT VOID *Data OPTIONAL,
392 OUT UINT32 *UsbStatus
419 OUT UINT32 *UsbStatus
446 OUT UINT32 *UsbStatus
474 IN BOOLEAN IsNewTransfer,
475 IN UINTN PollInterval OPTIONAL,
478 IN VOID *Context OPTIONAL
497 IN UINT8 DeviceEndpoint,
521 IN UINT8 DeviceEndpoint,
525 IN VOID *Context OPTIONAL
614 OUT UINT16 **LangIDTable,
615 OUT UINT16 *TableSize
635 IN UINT8 StringIndex,
EFI_STATUS(EFIAPI * EFI_ASYNC_USB_TRANSFER_CALLBACK)(IN VOID *Data, IN UINTN DataLength, IN VOID *Context, IN UINT32 Status)
EFI_STATUS EFIAPI UsbBusBuildProtocol(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
EFI_STATUS EFIAPI UsbIoAsyncInterruptTransfer(IN EFI_USB_IO_PROTOCOL *This, IN UINT8 Endpoint, IN BOOLEAN IsNewTransfer, IN UINTN PollInterval OPTIONAL, IN UINTN DataLength OPTIONAL, IN EFI_ASYNC_USB_TRANSFER_CALLBACK Callback OPTIONAL, IN VOID *Context OPTIONAL)
EFI_STATUS EFIAPI UsbBusAddWantedUsbIoDP(IN EFI_USB_BUS_PROTOCOL *UsbBusId, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
EFI_STATUS EFIAPI UsbIoSyncInterruptTransfer(IN EFI_USB_IO_PROTOCOL *This, IN UINT8 Endpoint, IN OUT VOID *Data, IN OUT UINTN *DataLength, IN UINTN Timeout, OUT UINT32 *UsbStatus)
EFI_STATUS EFIAPI UsbBusControllerDriverSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
EFI_STATUS EFIAPI UsbIoGetEndpointDescriptor(IN EFI_USB_IO_PROTOCOL *This, IN UINT8 Index, OUT EFI_USB_ENDPOINT_DESCRIPTOR *Descriptor)
EFI_STATUS EFIAPI UsbIoIsochronousTransfer(IN EFI_USB_IO_PROTOCOL *This, IN UINT8 DeviceEndpoint, IN OUT VOID *Data, IN UINTN DataLength, OUT UINT32 *Status)
EFI_STATUS EFIAPI UsbBusControllerDriverStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
EFI_STATUS EFIAPI UsbIoGetActiveConfigDescriptor(IN EFI_USB_IO_PROTOCOL *This, OUT EFI_USB_CONFIG_DESCRIPTOR *Descriptor)
EFI_STATUS EFIAPI UsbIoGetInterfaceDescriptor(IN EFI_USB_IO_PROTOCOL *This, OUT EFI_USB_INTERFACE_DESCRIPTOR *Descriptor)
EFI_STATUS EFIAPI UsbIoGetSupportedLanguages(IN EFI_USB_IO_PROTOCOL *This, OUT UINT16 **LangIDTable, OUT UINT16 *TableSize)
EFI_STATUS EFIAPI UsbIoGetStringDescriptor(IN EFI_USB_IO_PROTOCOL *This, IN UINT16 LangID, IN UINT8 StringIndex, OUT CHAR16 **String)
EFI_STATUS EFIAPI UsbBusFreeUsbDPList(IN LIST_ENTRY *UsbIoDPList)
BOOLEAN EFIAPI UsbBusIsWantedUsbIO(IN USB_BUS *Bus, IN USB_INTERFACE *UsbIf)
EFI_STATUS EFIAPI UsbBusDriverEntryPoint(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI UsbIoAsyncIsochronousTransfer(IN EFI_USB_IO_PROTOCOL *This, IN UINT8 DeviceEndpoint, IN OUT VOID *Data, IN UINTN DataLength, IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack, IN VOID *Context OPTIONAL)
EFI_STATUS EFIAPI UsbIoGetDeviceDescriptor(IN EFI_USB_IO_PROTOCOL *This, OUT EFI_USB_DEVICE_DESCRIPTOR *Descriptor)
EFI_STATUS EFIAPI UsbBusRecursivelyConnectWantedUsbIo(IN EFI_USB_BUS_PROTOCOL *UsbBusId)
EFI_STATUS EFIAPI UsbBusControllerDriverStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
EFI_STATUS EFIAPI UsbIoControlTransfer(IN EFI_USB_IO_PROTOCOL *This, IN EFI_USB_DEVICE_REQUEST *Request, IN EFI_USB_DATA_DIRECTION Direction, IN UINT32 Timeout, IN OUT VOID *Data OPTIONAL, IN UINTN DataLength OPTIONAL, OUT UINT32 *UsbStatus)
EFI_STATUS EFIAPI UsbIoBulkTransfer(IN EFI_USB_IO_PROTOCOL *This, IN UINT8 Endpoint, IN OUT VOID *Data, IN OUT UINTN *DataLength, IN UINTN Timeout, OUT UINT32 *UsbStatus)
EFI_STATUS EFIAPI UsbIoPortReset(IN EFI_USB_IO_PROTOCOL *This)