]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.c
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbBusPei / PeiUsbLib.c
index 6fef61e5658ab56bc41028e4cb9b5a7235040e48..c5e599e2f77babb9fd8d94d84cc981ff761d4db3 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
 Common Libarary for PEI USB\r
 \r
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved. <BR>\r
-  \r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved. <BR>\r
+\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
 of the BSD License which accompanies this distribution.  The\r
@@ -221,26 +221,24 @@ IsPortConnect (
 }\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
-  @param  PortStatus  The usb port status gotten.\r
+  @param    PortStatus  The usb port status gotten.\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
-IsPortLowSpeedDeviceAttached (\r
-  IN UINT16  PortStatus\r
+PeiUsbGetDeviceSpeed (\r
+  IN UINT16 PortStatus\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
+  } 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