]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg UsbBotPei: Remove redundant functions
authorshenglei <shenglei.zhang@intel.com>
Wed, 8 Aug 2018 07:38:33 +0000 (15:38 +0800)
committerStar Zeng <star.zeng@intel.com>
Tue, 21 Aug 2018 08:29:01 +0000 (16:29 +0800)
The functions that are never called have been removed.
They are PeiUsbSetConfiguration,PeiUsbSetDeviceAddress,
IsPortConnect,IsPortConnectChange,IsPortLowSpeedDeviceAttached
and PeiUsbGetDescriptor.
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: Star Zeng <star.zeng@intel.com>
MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.c
MdeModulePkg/Bus/Usb/UsbBotPei/PeiUsbLib.h

index 4f20c711442cfdf2ddfafdf1f841d671a3c44f3b..cd765c40c59e677de3df3d29fd92f7cb9814f450 100644 (file)
@@ -17,92 +17,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include "UsbPeim.h"\r
 #include "PeiUsbLib.h"\r
 \r
-/**\r
-  Get a given usb descriptor.\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              Request Value.\r
-  @param  Index              Request Index.\r
-  @param  DescriptorLength   Request descriptor Length.\r
-  @param  Descriptor         Request descriptor.\r
-\r
-\r
-  @retval EFI_SUCCESS        Usb descriptor is obtained successfully.\r
-  @retval EFI_DEVICE_ERROR   Cannot get the usb descriptor due to a hardware error.\r
-  @retval Others             Other failure occurs.\r
-\r
-**/\r
-EFI_STATUS\r
-PeiUsbGetDescriptor (\r
-  IN  EFI_PEI_SERVICES         **PeiServices,\r
-  IN  PEI_USB_IO_PPI           *UsbIoPpi,\r
-  IN  UINT16                   Value,\r
-  IN  UINT16                   Index,\r
-  IN  UINT16                   DescriptorLength,\r
-  OUT VOID                     *Descriptor\r
-  )\r
-{\r
-  EFI_USB_DEVICE_REQUEST  DevReq;\r
-\r
-  ASSERT (UsbIoPpi != NULL);\r
-\r
-  DevReq.RequestType  = USB_DEV_GET_DESCRIPTOR_REQ_TYPE;\r
-  DevReq.Request      = USB_DEV_GET_DESCRIPTOR;\r
-  DevReq.Value        = Value;\r
-  DevReq.Index        = Index;\r
-  DevReq.Length       = DescriptorLength;\r
-\r
-  return UsbIoPpi->UsbControlTransfer (\r
-                     PeiServices,\r
-                     UsbIoPpi,\r
-                     &DevReq,\r
-                     EfiUsbDataIn,\r
-                     PcdGet32 (PcdUsbTransferTimeoutValue),\r
-                     Descriptor,\r
-                     DescriptorLength\r
-                     );\r
-}\r
-\r
-/**\r
-  Set a usb device with a specified address.\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  AddressValue       The address to assign.\r
-\r
-  @retval EFI_SUCCESS        Usb device address is set successfully.\r
-  @retval EFI_DEVICE_ERROR   Cannot set the usb address due to a hardware error.\r
-  @retval Others             Other failure occurs.\r
-\r
-**/\r
-EFI_STATUS\r
-PeiUsbSetDeviceAddress (\r
-  IN EFI_PEI_SERVICES         **PeiServices,\r
-  IN PEI_USB_IO_PPI           *UsbIoPpi,\r
-  IN UINT16                   AddressValue\r
-  )\r
-{\r
-  EFI_USB_DEVICE_REQUEST  DevReq;\r
-\r
-  ASSERT (UsbIoPpi != NULL);\r
-\r
-  DevReq.RequestType  = USB_DEV_SET_ADDRESS_REQ_TYPE;\r
-  DevReq.Request      = USB_DEV_SET_ADDRESS;\r
-  DevReq.Value        = AddressValue;\r
-  DevReq.Index        = 0;\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
   Clear a given usb feature.\r
@@ -161,40 +75,6 @@ PeiUsbClearDeviceFeature (
                      );\r
 }\r
 \r
-/**\r
-  Configure a usb device to Configuration 1.\r
-\r
-  @param  PeiServices        General-purpose services that are available to every PEIM.\r
-  @param  UsbIoPpi           Indicates the PEI_USB_IO_PPI instance.\r
-\r
-  @retval EFI_SUCCESS       Usb device is set to use Configuration 1 successfully.\r
-  @retval EFI_DEVICE_ERROR  Cannot set the usb device due to a hardware error.\r
-  @retval Others            Other failure occurs.\r
-\r
-**/\r
-EFI_STATUS\r
-PeiUsbSetConfiguration (\r
-  IN EFI_PEI_SERVICES         **PeiServices,\r
-  IN PEI_USB_IO_PPI           *UsbIoPpi\r
-  )\r
-{\r
-  EFI_USB_DEVICE_REQUEST  DevReq;\r
-  ZeroMem (&DevReq, sizeof (EFI_USB_DEVICE_REQUEST));\r
-\r
-  DevReq.RequestType  = USB_DEV_SET_CONFIGURATION_REQ_TYPE;\r
-  DevReq.Request      = USB_DEV_SET_CONFIGURATION;\r
-  DevReq.Value        = 1;\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
   Clear Endpoint Halt.\r
@@ -258,74 +138,4 @@ PeiUsbClearEndpointHalt (
   return Status;\r
 }\r
 \r
-/**\r
-  Judge if the port is connected with a usb device or not.\r
-\r
-  @param  PortStatus  The usb port status gotten.\r
 \r
-  @retval TRUE        A usb device is connected with the port.\r
-  @retval FALSE       No usb device is connected with the port.\r
-\r
-**/\r
-BOOLEAN\r
-IsPortConnect (\r
-  IN UINT16  PortStatus\r
-  )\r
-{\r
-  //\r
-  // return the bit 0 value of PortStatus\r
-  //\r
-  if ((PortStatus & USB_PORT_STAT_CONNECTION) != 0) {\r
-    return TRUE;\r
-  } else {\r
-    return FALSE;\r
-  }\r
-}\r
-\r
-/**\r
-  Judge if the port is connected with a low-speed usb device or not.\r
-\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
-\r
-**/\r
-BOOLEAN\r
-IsPortLowSpeedDeviceAttached (\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 TRUE;\r
-  } else {\r
-    return FALSE;\r
-  }\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 6d39b764eb86f16f4843900b96930fc959b65307..a160146cae4ed11a0901d6e060c3f85454ccd03d 100644 (file)
@@ -100,50 +100,6 @@ typedef enum {
   EfiUsbEndpoint\r
 } EFI_USB_RECIPIENT;\r
 \r
-/**\r
-  Get a given usb descriptor.\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              Request Value.\r
-  @param  Index              Request Index.\r
-  @param  DescriptorLength   Request descriptor Length.\r
-  @param  Descriptor         Request descriptor.\r
-\r
-\r
-  @retval EFI_SUCCESS       Usb descriptor is obtained successfully.\r
-  @retval EFI_DEVICE_ERROR  Cannot get the usb descriptor due to a hardware error.\r
-  @retval Others            Other failure occurs.\r
-\r
-**/\r
-EFI_STATUS\r
-PeiUsbGetDescriptor (\r
-  IN  EFI_PEI_SERVICES         **PeiServices,\r
-  IN  PEI_USB_IO_PPI           *UsbIoPpi,\r
-  IN  UINT16                   Value,\r
-  IN  UINT16                   Index,\r
-  IN  UINT16                   DescriptorLength,\r
-  OUT VOID                     *Descriptor\r
-  );\r
-\r
-/**\r
-  Set a usb device with a specified address.\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  AddressValue       The address to assign.\r
-\r
-  @retval EFI_SUCCESS        Usb device address is set successfully.\r
-  @retval EFI_DEVICE_ERROR   Cannot set the usb address due to a hardware error.\r
-  @retval Others             Other failure occurs.\r
-\r
-**/\r
-EFI_STATUS\r
-PeiUsbSetDeviceAddress (\r
-  IN EFI_PEI_SERVICES         **PeiServices,\r
-  IN PEI_USB_IO_PPI           *UsbIoPpi,\r
-  IN UINT16                   AddressValue\r
-  );\r
 \r
 /**\r
   Clear a given usb feature.\r
@@ -168,22 +124,6 @@ PeiUsbClearDeviceFeature (
   IN UINT16                   Target\r
   );\r
 \r
-/**\r
-  Configure a usb device to Configuration 1.\r
-\r
-  @param  PeiServices        General-purpose services that are available to every PEIM.\r
-  @param  UsbIoPpi           Indicates the PEI_USB_IO_PPI instance.\r
-\r
-  @retval EFI_SUCCESS        Usb device is set to use Configuration 1 successfully.\r
-  @retval EFI_DEVICE_ERROR   Cannot set the usb device due to a hardware error.\r
-  @retval Others             Other failure occurs.\r
-\r
-**/\r
-EFI_STATUS\r
-PeiUsbSetConfiguration (\r
-  IN EFI_PEI_SERVICES         **PeiServices,\r
-  IN PEI_USB_IO_PPI           *UsbIoPpi\r
-  );\r
 \r
 /**\r
   Clear Endpoint Halt.\r
@@ -204,45 +144,7 @@ PeiUsbClearEndpointHalt (
   IN UINT8                    EndpointAddress\r
   );\r
 \r
-/**\r
-  Judge if the port is connected with a usb device or not.\r
-\r
-  @param  PortStatus  The usb port status gotten.\r
-\r
-  @retval TRUE        A usb device is connected with the port.\r
-  @retval FALSE       No usb device is connected with the port.\r
-\r
-**/\r
-BOOLEAN\r
-IsPortConnect (\r
-  IN UINT16  PortStatus\r
-  );\r
-\r
-/**\r
-  Judge if the port is connected with a low-speed usb device or not.\r
-\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
 \r
-**/\r
-BOOLEAN\r
-IsPortLowSpeedDeviceAttached (\r
-  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