X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FBus%2FUsb%2FUsbBusDxe%2Fusbbus.h;h=971e01b47ab12b4d40f93f88d83049ee953eaa20;hp=09ae44533e15f5ca69343c8a6c5312e8f3677457;hb=41e8ff2781f3ca14f73ef5f39e781ccba8cb373d;hpb=ed7748fe4a5575adea8055c6da5948fbee65fd7a diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/usbbus.h b/MdeModulePkg/Bus/Usb/UsbBusDxe/usbbus.h index 09ae44533e..971e01b47a 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/usbbus.h +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/usbbus.h @@ -55,21 +55,77 @@ typedef struct _USB_HUB_API USB_HUB_API; #include "UsbEnumer.h" enum { + USB_MAX_LANG_ID = 16, + USB_MAX_INTERFACE = 16, + USB_MAX_DEVICES = 128, + + USB_BUS_1_MILLISECOND = 1000, + // - // Time definition + // Roothub and hub's polling interval, set by experience, + // The unit of roothub is 100us, means 1s as interval, and + // the unit of hub is 1ms, means 64ms as interval. // - USB_STALL_1_MS = 1000, - TICKS_PER_MS = 10000U, - USB_ROOTHUB_POLL_INTERVAL = 1000 * TICKS_PER_MS, + USB_ROOTHUB_POLL_INTERVAL = 1000 * 10000U, USB_HUB_POLL_INTERVAL = 64, // - // Maximum definition + // Wait for port stable to work, refers to specification + // [USB20-9.1.2] // - USB_MAX_LANG_ID = 16, - USB_MAX_INTERFACE = 16, - USB_MAX_DEVICES = 128, + USB_WAIT_PORT_STABLE_STALL = 100 * USB_BUS_1_MILLISECOND, + + // + // Wait for port statue reg change, set by experience + // + USB_WAIT_PORT_STS_CHANGE_STALL = 5 * USB_BUS_1_MILLISECOND, + + // + // Wait for set device address, refers to specification + // [USB20-9.2.6.3, it says 2ms] + // + USB_SET_DEVICE_ADDRESS_STALL = 20 * USB_BUS_1_MILLISECOND, + + // + // Wait for retry max packet size, set by experience + // + USB_RETRY_MAX_PACK_SIZE_STALL = 100 * USB_BUS_1_MILLISECOND, + // + // Wait for hub port power-on, refers to specification + // [USB20-11.23.2] + // + USB_SET_PORT_POWER_STALL = 2 * USB_BUS_1_MILLISECOND, + + // + // Wait for port reset, refers to specification + // [USB20-7.1.7.5, it says 10ms for hub and 50ms for + // root hub] + // + USB_SET_PORT_RESET_STALL = 20 * USB_BUS_1_MILLISECOND, + USB_SET_ROOT_PORT_RESET_STALL = 50 * USB_BUS_1_MILLISECOND, + + // + // Wait for clear roothub port reset, set by experience + // + USB_CLR_ROOT_PORT_RESET_STALL = 1 * USB_BUS_1_MILLISECOND, + + // + // Wait for set roothub port enable, set by experience + // + USB_SET_ROOT_PORT_ENABLE_STALL = 20 * USB_BUS_1_MILLISECOND, + + // + // Send general device request timeout, refers to + // specification[USB20-11.24.1] + // + USB_GENERAL_DEVICE_REQUEST_TIMEOUT = 50 * USB_BUS_1_MILLISECOND, + + // + // Send clear feature request timeout, set by experience + // + USB_CLEAR_FEATURE_REQUEST_TIMEOUT = 10 * USB_BUS_1_MILLISECOND, + // // Bus raises TPL to TPL_NOTIFY to serialize all its operations // to protect shared data structures. @@ -84,7 +140,7 @@ enum { #define USB_BIT_IS_SET(Data, Bit) ((BOOLEAN)(((Data) & (Bit)) == (Bit))) #define EFI_USB_BUS_PROTOCOL_GUID \ - {0x2B2F68CC, 0x0CD2, 0x44cf, 0x8E, 0x8B, 0xBB, 0xA2, 0x0B, 0x1B, 0x5B, 0x75} + {0x2B2F68CC, 0x0CD2, 0x44cf, {0x8E, 0x8B, 0xBB, 0xA2, 0x0B, 0x1B, 0x5B, 0x75}} #define USB_INTERFACE_FROM_USBIO(a) \ CR(a, USB_INTERFACE, UsbIo, USB_INTERFACE_SIGNATURE) @@ -197,8 +253,9 @@ struct _USB_BUS { USB_DEVICE *Devices[USB_MAX_DEVICES]; }; -extern EFI_USB_IO_PROTOCOL mUsbIoProtocol; -extern EFI_DRIVER_BINDING_PROTOCOL mUsbBusDriverBinding; -extern EFI_COMPONENT_NAME_PROTOCOL mUsbBusComponentName; +extern EFI_USB_IO_PROTOCOL mUsbIoProtocol; +extern EFI_DRIVER_BINDING_PROTOCOL mUsbBusDriverBinding; +extern EFI_COMPONENT_NAME_PROTOCOL mUsbBusComponentName; +extern EFI_COMPONENT_NAME2_PROTOCOL mUsbBusComponentName2; #endif