]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbBotPei/UsbPeim.h
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbBotPei / UsbPeim.h
index 4f3f57f0bc474f1aad4e927d74188360ae78c458..ec2c4ff35170f0c584f39f6cc9a46020000aaa04 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
 Usb Peim definition.\r
 \r
-Copyright (c) 2006, 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
@@ -21,8 +21,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <PiPei.h>\r
 \r
 #include <Ppi/UsbIo.h>\r
-#include <Ppi/UsbHostController.h>\r
 #include <Ppi/BlockIo.h>\r
+#include <Ppi/BlockIo2.h>\r
 \r
 #include <Library/DebugLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
@@ -30,150 +30,4 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include <IndustryStandard/Usb.h>\r
 \r
-#define MAX_ROOT_PORT             2\r
-#define MAX_ENDPOINT              16\r
-\r
-#define USB_SLOW_SPEED_DEVICE     0x01\r
-#define USB_FULL_SPEED_DEVICE     0x02\r
-\r
-#define PEI_USB_DEVICE_SIGNATURE  SIGNATURE_32 ('U', 's', 'b', 'D')\r
-typedef struct {\r
-  UINTN                         Signature;\r
-  PEI_USB_IO_PPI                UsbIoPpi;\r
-  EFI_PEI_PPI_DESCRIPTOR        UsbIoPpiList;\r
-  UINT8                         DeviceAddress;\r
-  UINT8                         MaxPacketSize0;\r
-  UINT8                         DeviceSpeed;\r
-  UINT8                         DataToggle;\r
-  UINT8                         IsHub;\r
-  UINT8                         DownStreamPortNo;\r
-  UINT8                         Reserved[2];  // Padding for IPF\r
-  UINTN                         AllocateAddress;\r
-  PEI_USB_HOST_CONTROLLER_PPI   *UsbHcPpi;\r
-  UINT8                         ConfigurationData[1024];\r
-  EFI_USB_CONFIG_DESCRIPTOR     *ConfigDesc;\r
-  EFI_USB_INTERFACE_DESCRIPTOR  *InterfaceDesc;\r
-  EFI_USB_ENDPOINT_DESCRIPTOR   *EndpointDesc[MAX_ENDPOINT];\r
-} PEI_USB_DEVICE;\r
-\r
-#define PEI_USB_DEVICE_FROM_THIS(a) CR (a, PEI_USB_DEVICE, UsbIoPpi, PEI_USB_DEVICE_SIGNATURE)\r
-\r
-\r
-/**\r
-  Submits control transfer to a target USB device.\r
-  \r
-  @param  PeiServices            The pointer of EFI_PEI_SERVICES.\r
-  @param  This                   The pointer of PEI_USB_IO_PPI.\r
-  @param  Request                USB device request to send.\r
-  @param  Direction              Specifies the data direction for the data stage.\r
-  @param  Timeout                Indicates the maximum timeout, in millisecond.\r
-  @param  Data                   Data buffer to be transmitted or received from USB device.\r
-  @param  DataLength             The size (in bytes) of the data buffer.\r
-\r
-  @retval EFI_SUCCESS            Transfer was completed successfully.\r
-  @retval EFI_OUT_OF_RESOURCES   The transfer failed due to lack of resources.\r
-  @retval EFI_INVALID_PARAMETER  Some parameters are invalid.\r
-  @retval EFI_TIMEOUT            Transfer failed due to timeout.\r
-  @retval EFI_DEVICE_ERROR       Transfer failed due to host controller or device error.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-PeiUsbControlTransfer (\r
-  IN     EFI_PEI_SERVICES          **PeiServices,\r
-  IN     PEI_USB_IO_PPI            *This,\r
-  IN     EFI_USB_DEVICE_REQUEST    *Request,\r
-  IN     EFI_USB_DATA_DIRECTION    Direction,\r
-  IN     UINT32                    Timeout,\r
-  IN OUT VOID                      *Data,      OPTIONAL\r
-  IN     UINTN                     DataLength  OPTIONAL\r
-  );\r
-\r
-/**\r
-  Submits bulk transfer to a bulk endpoint of a USB device.\r
-  \r
-  @param  PeiServices           The pointer of EFI_PEI_SERVICES.\r
-  @param  This                  The pointer of PEI_USB_IO_PPI.\r
-  @param  DeviceEndpoint        Endpoint number and its direction in bit 7.\r
-  @param  Data                  A pointer to the buffer of data to transmit \r
-                                from or receive into.\r
-  @param  DataLength            The lenght of the data buffer.\r
-  @param  Timeout               Indicates the maximum time, in millisecond, which the\r
-                                transfer is allowed to complete.\r
-\r
-  @retval EFI_SUCCESS           The transfer was completed successfully.\r
-  @retval EFI_OUT_OF_RESOURCES  The transfer failed due to lack of resource.\r
-  @retval EFI_INVALID_PARAMETER Parameters are invalid.\r
-  @retval EFI_TIMEOUT           The transfer failed due to timeout.\r
-  @retval EFI_DEVICE_ERROR      The transfer failed due to host controller error.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-PeiUsbBulkTransfer (\r
-  IN     EFI_PEI_SERVICES    **PeiServices,\r
-  IN     PEI_USB_IO_PPI      *This,\r
-  IN     UINT8               DeviceEndpoint,\r
-  IN OUT VOID                *Data,\r
-  IN OUT UINTN               *DataLength,\r
-  IN     UINTN               Timeout\r
-  );\r
-\r
-/**\r
-  Get the usb interface descriptor.\r
-\r
-  @param  PeiServices          General-purpose services that are available to every PEIM.\r
-  @param  This                 Indicates the PEI_USB_IO_PPI instance.\r
-  @param  InterfaceDescriptor  Request interface descriptor.\r
-\r
-\r
-  @retval EFI_SUCCESS     Usb interface descriptor is obtained successfully.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-PeiUsbGetInterfaceDescriptor (\r
-  IN  EFI_PEI_SERVICES                **PeiServices,\r
-  IN  PEI_USB_IO_PPI                  *This,\r
-  OUT EFI_USB_INTERFACE_DESCRIPTOR    **InterfaceDescriptor\r
-  );\r
-\r
-/**\r
-  Get the usb endpoint descriptor.\r
-\r
-  @param  PeiServices          General-purpose services that are available to every PEIM.\r
-  @param  This                 Indicates the PEI_USB_IO_PPI instance.\r
-  @param  EndpointIndex        The valid index of the specified endpoint.\r
-  @param  EndpointDescriptor   Request endpoint descriptor.\r
-\r
-  @retval EFI_SUCCESS       Usb endpoint descriptor is obtained successfully.\r
-  @retval EFI_NOT_FOUND     Usb endpoint descriptor is NOT found.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-PeiUsbGetEndpointDescriptor (\r
-  IN  EFI_PEI_SERVICES               **PeiServices,\r
-  IN  PEI_USB_IO_PPI                 *This,\r
-  IN  UINT8                          EndpointIndex,\r
-  OUT EFI_USB_ENDPOINT_DESCRIPTOR    **EndpointDescriptor\r
-  );\r
-\r
-/**\r
-  Reset the port and re-configure the usb device.\r
-\r
-  @param  PeiServices    General-purpose services that are available to every PEIM.\r
-  @param  This           Indicates the PEI_USB_IO_PPI instance.\r
-\r
-  @retval EFI_SUCCESS    Usb device is reset and configured successfully.\r
-  @retval Others         Other failure occurs.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-PeiUsbPortReset (\r
-  IN EFI_PEI_SERVICES    **PeiServices,\r
-  IN PEI_USB_IO_PPI      *This\r
-  );\r
-\r
 #endif\r