]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg UsbBusPei: Remove redundant functions
authorshenglei <shenglei.zhang@intel.com>
Wed, 8 Aug 2018 07:41:25 +0000 (15:41 +0800)
committerStar Zeng <star.zeng@intel.com>
Tue, 21 Aug 2018 08:29:03 +0000 (16:29 +0800)
The functions that are never called have been removed.
They are PeiHubSetHubFeature,IsPortConnectChange and
PeiUsbClearDeviceFeature.
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
MdeModulePkg/Bus/Usb/UsbBusPei/HubPeim.c
MdeModulePkg/Bus/Usb/UsbBusPei/HubPeim.h
MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.c
MdeModulePkg/Bus/Usb/UsbBusPei/PeiUsbLib.h

index 806602511c6fba2f20409655bbd271ed3c5c3a5f..5607c65b1330318934f9b2dbac23d0b69a87d0a5 100644 (file)
@@ -193,46 +193,7 @@ PeiHubGetHubStatus (
                      );\r
 }\r
 \r
-/**\r
-  Set specified feature to a given hub.\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  Value         New feature value.\r
-\r
-  @retval EFI_SUCCESS       Port feature is set successfully.\r
-  @retval EFI_DEVICE_ERROR  Cannot set the port feature due to a hardware error.\r
-  @retval Others            Other failure occurs.\r
-\r
-**/\r
-EFI_STATUS\r
-PeiHubSetHubFeature (\r
-  IN EFI_PEI_SERVICES    **PeiServices,\r
-  IN PEI_USB_IO_PPI      *UsbIoPpi,\r
-  IN UINT8               Value\r
-  )\r
-{\r
-  EFI_USB_DEVICE_REQUEST      DeviceRequest;\r
 \r
-  ZeroMem (&DeviceRequest, sizeof (EFI_USB_DEVICE_REQUEST));\r
-\r
-  //\r
-  // Fill Device request packet\r
-  //\r
-  DeviceRequest.RequestType = USB_HUB_SET_HUB_FEATURE_REQ_TYPE;\r
-  DeviceRequest.Request     = USB_HUB_SET_HUB_FEATURE;\r
-  DeviceRequest.Value       = Value;\r
-\r
-  return UsbIoPpi->UsbControlTransfer (\r
-                     PeiServices,\r
-                     UsbIoPpi,\r
-                     &DeviceRequest,\r
-                     EfiUsbNoData,\r
-                     PcdGet32 (PcdUsbTransferTimeoutValue),\r
-                     NULL,\r
-                     0\r
-                     );\r
-}\r
 \r
 /**\r
   Clear specified feature on a given hub.\r
index 385a14ec0d15817070e0e8c6d7f10869d77842a8..d21057c34995d8a7553dc4c5702e602d8d06adc4 100644 (file)
@@ -145,24 +145,6 @@ PeiHubSetPortFeature (
   IN  UINT8                 Value\r
   );\r
 \r
-/**\r
-  Set specified feature to a given hub.\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  Value         New feature value.\r
-\r
-  @retval EFI_SUCCESS       Port feature is set successfully.\r
-  @retval EFI_DEVICE_ERROR  Cannot set the port feature due to a hardware error.\r
-  @retval Others            Other failure occurs.\r
-\r
-**/\r
-EFI_STATUS\r
-PeiHubSetHubFeature (\r
-  IN EFI_PEI_SERVICES       **PeiServices,\r
-  IN PEI_USB_IO_PPI         *UsbIoPpi,\r
-  IN  UINT8                 Value\r
-  );\r
 \r
 /**\r
   Get a given hub status.\r
index c5e599e2f77babb9fd8d94d84cc981ff761d4db3..73a163e7a07f680b4e197774b9cbb20067b0ecf5 100644 (file)
@@ -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
index 35f47a35ecf5064d37873740e99374da45c98b93..e3afee6e847c2b88445ce946d0344a736e3dcee4 100644 (file)
@@ -148,28 +148,6 @@ PeiUsbSetDeviceAddress (
   IN UINT16                   AddressValue\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
 /**\r
   Configure a usb device to Configuration 1.\r
@@ -215,17 +193,4 @@ PeiUsbGetDeviceSpeed (
   IN UINT16 PortStatus\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
 #endif\r