X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FBus%2FUsb%2FUsbBusPei%2FPeiUsbLib.c;h=c5e599e2f77babb9fd8d94d84cc981ff761d4db3;hp=6fef61e5658ab56bc41028e4cb9b5a7235040e48;hb=d1102dba7210b95e41d06c2338a22ba6af248645;hpb=506560e75abceaab3cd8f7b7508f9d26b3c6036d
diff --git a/MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.c b/MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.c
index 6fef61e565..c5e599e2f7 100644
--- a/MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.c
+++ b/MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.c
@@ -1,8 +1,8 @@
/** @file
Common Libarary for PEI USB
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
-
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+
This program and the accompanying materials
are licensed and made available under the terms and conditions
of the BSD License which accompanies this distribution. The
@@ -221,26 +221,24 @@ IsPortConnect (
}
/**
- Judge if the port is connected with a low-speed usb device or not.
+ Get device speed according to port status.
- @param PortStatus The usb port status gotten.
+ @param PortStatus The usb port status gotten.
- @retval TRUE A low-speed usb device is connected with the port.
- @retval FALSE No low-speed usb device is connected with the port.
+ @return Device speed value.
**/
UINTN
-IsPortLowSpeedDeviceAttached (
- IN UINT16 PortStatus
+PeiUsbGetDeviceSpeed (
+ IN UINT16 PortStatus
)
{
- //
- // return the bit 9 value of PortStatus
- //
if ((PortStatus & USB_PORT_STAT_LOW_SPEED) != 0) {
return EFI_USB_SPEED_LOW;
} else if ((PortStatus & USB_PORT_STAT_HIGH_SPEED) != 0){
return EFI_USB_SPEED_HIGH;
+ } else if ((PortStatus & USB_PORT_STAT_SUPER_SPEED) != 0) {
+ return EFI_USB_SPEED_SUPER;
} else {
return EFI_USB_SPEED_FULL;
}