]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.c
MdeModulePkg XhciPei/UsbBusPei: Add XHCI recovery support.
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbBusPei / PeiUsbLib.c
index 6fef61e5658ab56bc41028e4cb9b5a7235040e48..42be13ac3b7c2e0497256302829d014372ece321 100644 (file)
@@ -221,26 +221,24 @@ IsPortConnect (
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
-  Judge if the port is connected with a low-speed usb device or not.\r
+  Get device speed according to port status.\r
 \r
 \r
-  @param  PortStatus  The usb port status gotten.\r
+  @param    PortStatus  The usb port status gotten.\r
 \r
 \r
-  @retval TRUE        A low-speed usb device is connected with the port.\r
-  @retval FALSE       No low-speed usb device is connected with the port.\r
+  @return   Device speed value.\r
 \r
 **/\r
 UINTN\r
 \r
 **/\r
 UINTN\r
-IsPortLowSpeedDeviceAttached (\r
-  IN UINT16  PortStatus\r
+PeiUsbGetDeviceSpeed (\r
+  IN UINT16 PortStatus\r
   )\r
 {\r
   )\r
 {\r
-  //\r
-  // return the bit 9 value of PortStatus\r
-  //\r
   if ((PortStatus & USB_PORT_STAT_LOW_SPEED) != 0) {\r
     return EFI_USB_SPEED_LOW;\r
   } else if ((PortStatus & USB_PORT_STAT_HIGH_SPEED) != 0){\r
     return EFI_USB_SPEED_HIGH;\r
   if ((PortStatus & USB_PORT_STAT_LOW_SPEED) != 0) {\r
     return EFI_USB_SPEED_LOW;\r
   } else if ((PortStatus & USB_PORT_STAT_HIGH_SPEED) != 0){\r
     return EFI_USB_SPEED_HIGH;\r
+  } else if ((PortStatus & USB_PORT_STAT_SUPER_SPEED) != 0) {\r
+    return EFI_USB_SPEED_SUPER;\r
   } else {\r
     return EFI_USB_SPEED_FULL;\r
   }\r
   } else {\r
     return EFI_USB_SPEED_FULL;\r
   }\r