]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbbus.c
- Remove the TOOL without NAME defined and its definition in ARCH_build.opt
[mirror_edk2.git] / EdkModulePkg / Bus / Usb / UsbBus / Dxe / usbbus.c
index 1d1f44d63874e30f8cba948cb31ad857be97f808..029d9cb4255bf06bb44b1210d1f27929e333d1e4 100644 (file)
@@ -23,8 +23,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "usbbus.h"\r
 \r
-UINTN                       gUSBDebugLevel  = EFI_D_INFO;\r
-UINTN                       gUSBErrorLevel  = EFI_D_ERROR;\r
+\r
+GLOBAL_REMOVE_IF_UNREFERENCED    UINTN    gUSBDebugLevel  = EFI_D_INFO;\r
+GLOBAL_REMOVE_IF_UNREFERENCED    UINTN    gUSBErrorLevel  = EFI_D_ERROR;\r
 \r
 //\r
 // The UsbBusProtocol is just used to locate USB_BUS_CONTROLLER\r
@@ -67,7 +68,7 @@ EFI_DRIVER_BINDING_PROTOCOL gUsbBusDriverBinding = {
   UsbBusControllerDriverSupported,\r
   UsbBusControllerDriverStart,\r
   UsbBusControllerDriverStop,\r
-  0x10,\r
+  0xa,\r
   NULL,\r
   NULL\r
 };\r
@@ -1000,7 +1001,9 @@ UsbDeviceConfiguration (
   //\r
   UsbIo = &FirstController->UsbIo;\r
 \r
-  ParentPortReset (FirstController, FALSE, 0);\r
+  if (UsbIoDevice->DeviceSpeed != EFI_USB_SPEED_HIGH) {\r
+    ParentPortReset (FirstController, FALSE, 0);\r
+  }\r
 \r
   //\r
   // First retrieve the 1st 8 bytes of\r
@@ -1273,6 +1276,7 @@ UsbDeviceDeConfiguration (
   USB_IO_DEVICE             *ChildDevice;\r
   UINT8                     Index;\r
   EFI_USB_IO_PROTOCOL       *UsbIo;\r
+  EFI_STATUS                Status;\r
 \r
   //\r
   // Double check UsbIoDevice exists\r
@@ -1362,14 +1366,17 @@ UsbDeviceDeConfiguration (
     // Uninstall EFI_USB_IO_PROTOCOL & DEVICE_PATH_PROTOCOL\r
     // installed on this handle\r
     //\r
-    gBS->UninstallMultipleProtocolInterfaces (\r
-          UsbController->Handle,\r
-          &gEfiDevicePathProtocolGuid,\r
-          UsbController->DevicePath,\r
-          &gEfiUsbIoProtocolGuid,\r
-          &UsbController->UsbIo,\r
-          NULL\r
-          );\r
+    Status = gBS->UninstallMultipleProtocolInterfaces (\r
+                    UsbController->Handle,\r
+                    &gEfiDevicePathProtocolGuid,\r
+                    UsbController->DevicePath,\r
+                    &gEfiUsbIoProtocolGuid,\r
+                    &UsbController->UsbIo,\r
+                    NULL\r
+                    );\r
+    if (EFI_ERROR (Status)) {\r
+      return Status;\r
+    }\r
 \r
     if (UsbController->DevicePath != NULL) {\r
       gBS->FreePool (UsbController->DevicePath);\r
@@ -2328,17 +2335,18 @@ UsbPortReset (
 --*/\r
 {\r
   USB_IO_CONTROLLER_DEVICE  *UsbIoController;\r
-  EFI_STATUS                Status;\r
 \r
   UsbIoController = USB_IO_CONTROLLER_DEVICE_FROM_USB_IO_THIS (This);\r
 \r
+  if (IsHub (UsbIoController)) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+  \r
   //\r
   // Since at this time, this device has already been configured,\r
   // it needs to be re-configured.\r
   //\r
-  Status = ParentPortReset (UsbIoController, TRUE, 0);\r
-\r
-  return Status;\r
+  return ParentPortReset (UsbIoController, TRUE, 0);\r
 }\r
 \r
 EFI_STATUS\r