]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
Enhance the Usb bus driver to support Star with Remaining device path.
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbBusDxe / UsbEnumer.c
index 65eb2dd77ffa547a57f3381e3ab15083f6b5e843..6b46e5c3ce4548ef91f249a29b394e9f3d31a015 100644 (file)
@@ -288,18 +288,24 @@ UsbConnectDriver (
     // twisted TPL used. It should be no problem for us to connect\r
     // or disconnect at CALLBACK.\r
     //\r
-    OldTpl            = UsbGetCurrentTpl ();\r
-    DEBUG ((EFI_D_INFO, "UsbConnectDriver: TPL before connect is %d\n", OldTpl));\r
+    \r
+    //\r
+    // Only recursively wanted usb child device\r
+    //\r
+    if (UsbBusIsWantedUsbIO (UsbIf->Device->Bus, UsbIf)) {\r
+      OldTpl            = UsbGetCurrentTpl ();\r
+      DEBUG ((EFI_D_INFO, "UsbConnectDriver: TPL before connect is %d\n", OldTpl));\r
 \r
-    gBS->RestoreTPL (TPL_CALLBACK);\r
+      gBS->RestoreTPL (TPL_CALLBACK);\r
 \r
-    Status            = gBS->ConnectController (UsbIf->Handle, NULL, NULL, TRUE);\r
-    UsbIf->IsManaged  = (BOOLEAN)!EFI_ERROR (Status);\r
+      Status            = gBS->ConnectController (UsbIf->Handle, NULL, NULL, TRUE);\r
+      UsbIf->IsManaged  = (BOOLEAN)!EFI_ERROR (Status);\r
 \r
-    DEBUG ((EFI_D_INFO, "UsbConnectDriver: TPL after connect is %d\n", UsbGetCurrentTpl()));\r
-    ASSERT (UsbGetCurrentTpl () == TPL_CALLBACK);\r
+      DEBUG ((EFI_D_INFO, "UsbConnectDriver: TPL after connect is %d\n", UsbGetCurrentTpl()));\r
+      ASSERT (UsbGetCurrentTpl () == TPL_CALLBACK);\r
 \r
-    gBS->RaiseTPL (OldTpl);\r
+      gBS->RaiseTPL (OldTpl);\r
+    }\r
   }\r
 \r
   return Status;\r