]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.c
MdeModulePkg UsbBusPei: Remove redundant functions
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbBusPei / PeiUsbLib.c
index 42be13ac3b7c2e0497256302829d014372ece321..73a163e7a07f680b4e197774b9cbb20067b0ecf5 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
@@ -104,62 +104,7 @@ PeiUsbSetDeviceAddress (
                      );\r
 }\r
 \r
-/**\r
-  Clear a given usb feature.\r
-\r
-  @param  PeiServices       General-purpose services that are available to every PEIM.\r
-  @param  UsbIoPpi          Indicates the PEI_USB_IO_PPI instance.\r
-  @param  Recipient         The recipient of ClearFeature Request, should be one of Device/Interface/Endpoint.\r
-  @param  Value             Request Value.\r
-  @param  Target            Request Index.\r
 \r
-  @retval EFI_SUCCESS       Usb feature is cleared successfully.\r
-  @retval EFI_DEVICE_ERROR  Cannot clear the usb feature due to a hardware error.\r
-  @retval Others            Other failure occurs.\r
-\r
-**/\r
-EFI_STATUS\r
-PeiUsbClearDeviceFeature (\r
-  IN EFI_PEI_SERVICES         **PeiServices,\r
-  IN PEI_USB_IO_PPI           *UsbIoPpi,\r
-  IN EFI_USB_RECIPIENT        Recipient,\r
-  IN UINT16                   Value,\r
-  IN UINT16                   Target\r
-  )\r
-{\r
-  EFI_USB_DEVICE_REQUEST  DevReq;\r
-\r
-  ASSERT (UsbIoPpi != NULL);\r
-\r
-  switch (Recipient) {\r
-  case EfiUsbDevice:\r
-    DevReq.RequestType = USB_DEV_CLEAR_FEATURE_REQ_TYPE_D;\r
-    break;\r
-\r
-  case EfiUsbInterface:\r
-    DevReq.RequestType = USB_DEV_CLEAR_FEATURE_REQ_TYPE_I;\r
-    break;\r
-\r
-  case EfiUsbEndpoint:\r
-    DevReq.RequestType = USB_DEV_CLEAR_FEATURE_REQ_TYPE_E;\r
-    break;\r
-  }\r
-\r
-  DevReq.Request      = USB_DEV_CLEAR_FEATURE;\r
-  DevReq.Value        = Value;\r
-  DevReq.Index        = Target;\r
-  DevReq.Length       = 0;\r
-\r
-  return UsbIoPpi->UsbControlTransfer (\r
-                     PeiServices,\r
-                     UsbIoPpi,\r
-                     &DevReq,\r
-                     EfiUsbNoData,\r
-                     PcdGet32 (PcdUsbTransferTimeoutValue),\r
-                     NULL,\r
-                     0\r
-                     );\r
-}\r
 \r
 /**\r
   Configure a usb device to Configuration 1.\r
@@ -244,26 +189,4 @@ PeiUsbGetDeviceSpeed (
   }\r
 }\r
 \r
-/**\r
-  Judge if the port is in "connection change" status or not.\r
-\r
-  @param  PortChangeStatus  The usb port change status gotten.\r
-\r
-  @retval TRUE              The port is in "connection change" status.\r
-  @retval FALSE             The port is NOT in "connection change" status.\r
 \r
-**/\r
-BOOLEAN\r
-IsPortConnectChange (\r
-  IN UINT16  PortChangeStatus\r
-  )\r
-{\r
-  //\r
-  // return the bit 0 value of PortChangeStatus\r
-  //\r
-  if ((PortChangeStatus & USB_PORT_STAT_C_CONNECTION) != 0) {\r
-    return TRUE;\r
-  } else {\r
-    return FALSE;\r
-  }\r
-}\r