]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c
1. Retired HotPlugDevice protocol.
[mirror_edk2.git] / MdeModulePkg / Universal / Console / ConPlatformDxe / ConPlatform.c
index 0cb07a2971aa2a5f505c3495bc28e339739c2221..f6483ed1fd0ec07767fc3b95bdf3971cd11d48fc 100644 (file)
@@ -256,7 +256,7 @@ ConPlatformTextInDriverBindingStart (
     return Status;\r
   }\r
   //\r
-  // Check the device handle, if it is a hot plug device,\r
+  // Check the device path, if it is a hot plug device,\r
   // do not put the device path into ConInDev, and install\r
   // gEfiConsoleInDeviceGuid to the device handle directly.\r
   // The policy is, make hot plug device plug in and play immediately.\r
@@ -373,7 +373,7 @@ ConPlatformTextOutDriverBindingStart (
     return Status;\r
   }\r
   //\r
-  // Check the device handle, if it is a hot plug device,\r
+  // Check the device path, if it is a hot plug device,\r
   // do not put the device path into ConOutDev and ErrOutDev,\r
   // and install gEfiConsoleOutDeviceGuid to the device handle directly.\r
   // The policy is, make hot plug device plug in and play immediately.\r
@@ -953,24 +953,31 @@ IsHotPlugDevice (
   IN  EFI_DEVICE_PATH_PROTOCOL    *DevicePath\r
   )\r
 {\r
-  //\r
-  // Check device whether is hot plug device or not throught Device Path\r
-  // \r
-  if ((DevicePathType (DevicePath) == MESSAGING_DEVICE_PATH) &&\r
-      (DevicePathSubType (DevicePath) == MSG_USB_DP ||\r
-       DevicePathSubType (DevicePath) == MSG_USB_CLASS_DP ||\r
-       DevicePathSubType (DevicePath) == MSG_USB_WWID_DP)) {\r
-    //\r
-    // If Device is USB device\r
-    //\r
-    return TRUE;\r
-  }\r
-  if ((DevicePathType (DevicePath) == HARDWARE_DEVICE_PATH) &&\r
-      (DevicePathSubType (DevicePath) == HW_PCCARD_DP)) {\r
-    //\r
-    // If Device is PCCard\r
+  EFI_DEVICE_PATH_PROTOCOL     *CheckDevicePath;\r
+\r
+  CheckDevicePath = DevicePath;\r
+  while (!IsDevicePathEnd (CheckDevicePath)) {\r
     //\r
-    return TRUE;\r
+    // Check device whether is hot plug device or not throught Device Path\r
+    // \r
+    if ((DevicePathType (CheckDevicePath) == MESSAGING_DEVICE_PATH) &&\r
+        (DevicePathSubType (CheckDevicePath) == MSG_USB_DP ||\r
+         DevicePathSubType (CheckDevicePath) == MSG_USB_CLASS_DP ||\r
+         DevicePathSubType (CheckDevicePath) == MSG_USB_WWID_DP)) {\r
+      //\r
+      // If Device is USB device\r
+      //\r
+      return TRUE;\r
+    }\r
+    if ((DevicePathType (CheckDevicePath) == HARDWARE_DEVICE_PATH) &&\r
+        (DevicePathSubType (CheckDevicePath) == HW_PCCARD_DP)) {\r
+      //\r
+      // If Device is PCCard\r
+      //\r
+      return TRUE;\r
+    }\r
+  \r
+    CheckDevicePath = NextDevicePathNode (CheckDevicePath);\r
   }\r
 \r
   return FALSE;\r