X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FBus%2FUsb%2FUsbBusDxe%2Fusbbus.h;h=e85fc84fe8f816b93cc7f860ac80109c9bc00a27;hp=971e01b47ab12b4d40f93f88d83049ee953eaa20;hb=ecb575d9e65c9d52c17866eebba5f798f178effe;hpb=be0187bbbad2039b83b15aebf9352de27a9d3c00 diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/usbbus.h b/MdeModulePkg/Bus/Usb/UsbBusDxe/usbbus.h index 971e01b47a..e85fc84fe8 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/usbbus.h +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/usbbus.h @@ -32,6 +32,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include +#include #include #include #include @@ -75,7 +76,7 @@ enum { // 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, @@ -98,8 +99,8 @@ enum { 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 + // 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, @@ -112,11 +113,11 @@ enum { // // 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 + // Send general device request timeout, refers to // specification[USB20-11.24.1] // USB_GENERAL_DEVICE_REQUEST_TIMEOUT = 50 * USB_BUS_1_MILLISECOND, @@ -125,7 +126,7 @@ enum { // 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. @@ -251,8 +252,59 @@ struct _USB_BUS { // for root hub. Device with address i is at Devices[i]. // USB_DEVICE *Devices[USB_MAX_DEVICES]; + + // + // USB Bus driver need to control the recursive connect policy of the bus, only those wanted + // usb child device will be recursively connected. + // + // WantedUsbIoDPList tracks the Usb child devices which user want to recursivly fully connecte, + // every wanted child device is stored in a item of the WantedUsbIoDPList, whose structrure is + // DEVICE_PATH_LIST_ITEM + // + LIST_ENTRY WantedUsbIoDPList; + }; +#define USB_US_LAND_ID 0x0409 + +#define DEVICE_PATH_LIST_ITEM_SIGNATURE EFI_SIGNATURE_32('d','p','l','i') +typedef struct _DEVICE_PATH_LIST_ITEM{ + UINTN Signature; + LIST_ENTRY Link; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; +} DEVICE_PATH_LIST_ITEM; + +typedef struct { + USB_CLASS_DEVICE_PATH UsbClass; + EFI_DEVICE_PATH_PROTOCOL End; +} USB_CLASS_FORMAT_DEVICE_PATH; + +EFI_STATUS +EFIAPI +UsbBusFreeUsbDPList ( + IN LIST_ENTRY *UsbIoDPList + ); + +EFI_STATUS +EFIAPI +UsbBusAddWantedUsbIoDP ( + IN EFI_USB_BUS_PROTOCOL *UsbBusId, + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath + ); + +BOOLEAN +EFIAPI +UsbBusIsWantedUsbIO ( + IN USB_BUS *Bus, + IN USB_INTERFACE *UsbIf + ); + +EFI_STATUS +EFIAPI +UsbBusRecursivelyConnectWantedUsbIo ( + IN EFI_USB_BUS_PROTOCOL *UsbBusId + ); + extern EFI_USB_IO_PROTOCOL mUsbIoProtocol; extern EFI_DRIVER_BINDING_PROTOCOL mUsbBusDriverBinding; extern EFI_COMPONENT_NAME_PROTOCOL mUsbBusComponentName;