]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMass.h
MdeModulePkg: Apply uncrustify changes
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbMassStorageDxe / UsbMass.h
index b89014a8129989b0960f0241bbf3b0396a754f84..2ac98030110925af7866970a6353af5e8ab26e76 100644 (file)
@@ -1,28 +1,21 @@
 /** @file\r
-  Definition of USB Mass Storage Class and its value, USB Mass Transport Protocol, \r
+  Definition of USB Mass Storage Class and its value, USB Mass Transport Protocol,\r
   and other common definitions.\r
 \r
-Copyright (c) 2007 - 2010, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
 #ifndef _EFI_USBMASS_H_\r
 #define _EFI_USBMASS_H_\r
 \r
-\r
 #include <Uefi.h>\r
-\r
+#include <IndustryStandard/Scsi.h>\r
 #include <Protocol/BlockIo.h>\r
 #include <Protocol/UsbIo.h>\r
 #include <Protocol/DevicePath.h>\r
-\r
+#include <Protocol/DiskInfo.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
@@ -32,40 +25,27 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/DevicePathLib.h>\r
 \r
+typedef struct _USB_MASS_TRANSPORT  USB_MASS_TRANSPORT;\r
+typedef struct _USB_MASS_DEVICE     USB_MASS_DEVICE;\r
+\r
+#include "UsbMassBot.h"\r
+#include "UsbMassCbi.h"\r
+#include "UsbMassBoot.h"\r
+#include "UsbMassDiskInfo.h"\r
+#include "UsbMassImpl.h"\r
+\r
 #define USB_IS_IN_ENDPOINT(EndPointAddr)      (((EndPointAddr) & BIT7) == BIT7)\r
 #define USB_IS_OUT_ENDPOINT(EndPointAddr)     (((EndPointAddr) & BIT7) == 0)\r
 #define USB_IS_BULK_ENDPOINT(Attribute)       (((Attribute) & (BIT0 | BIT1)) == USB_ENDPOINT_BULK)\r
 #define USB_IS_INTERRUPT_ENDPOINT(Attribute)  (((Attribute) & (BIT0 | BIT1)) == USB_ENDPOINT_INTERRUPT)\r
 #define USB_IS_ERROR(Result, Error)           (((Result) & (Error)) != 0)\r
 \r
-//\r
-// Usb mass storage class code\r
-//\r
-#define USB_MASS_STORE_CLASS    0x08\r
-\r
-//\r
-// Usb mass storage subclass code, specify the command set used.\r
-//\r
-#define USB_MASS_STORE_RBC      0x01 ///< Reduced Block Commands\r
-#define USB_MASS_STORE_8020I    0x02 ///< SFF-8020i, typically a CD/DVD device\r
-#define USB_MASS_STORE_QIC      0x03 ///< Typically a tape device\r
-#define USB_MASS_STORE_UFI      0x04 ///< Typically a floppy disk driver device\r
-#define USB_MASS_STORE_8070I    0x05 ///< SFF-8070i, typically a floppy disk driver device.\r
-#define USB_MASS_STORE_SCSI     0x06 ///< SCSI transparent command set\r
-\r
-//\r
-// Usb mass storage protocol code, specify the transport protocol\r
-//\r
-#define USB_MASS_STORE_CBI0     0x00 ///< CBI protocol with command completion interrupt\r
-#define USB_MASS_STORE_CBI1     0x01 ///< CBI protocol without command completion interrupt\r
-#define USB_MASS_STORE_BOT      0x50 ///< Bulk-Only Transport\r
-\r
 #define USB_MASS_1_MILLISECOND  1000\r
 #define USB_MASS_1_SECOND       (1000 * USB_MASS_1_MILLISECOND)\r
 \r
-#define USB_MASS_CMD_SUCCESS    0\r
-#define USB_MASS_CMD_FAIL       1\r
-#define USB_MASS_CMD_PERSISTENT 2\r
+#define USB_MASS_CMD_SUCCESS     0\r
+#define USB_MASS_CMD_FAIL        1\r
+#define USB_MASS_CMD_PERSISTENT  2\r
 \r
 /**\r
   Initializes USB transport protocol.\r
@@ -84,8 +64,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 typedef\r
 EFI_STATUS\r
 (*USB_MASS_INIT_TRANSPORT) (\r
-  IN  EFI_USB_IO_PROTOCOL     *Usb,\r
-  OUT VOID                    **Context    OPTIONAL\r
+  IN  EFI_USB_IO_PROTOCOL  *Usb,\r
+  OUT VOID                 **Context    OPTIONAL\r
   );\r
 \r
 /**\r
@@ -133,8 +113,8 @@ EFI_STATUS
 typedef\r
 EFI_STATUS\r
 (*USB_MASS_RESET) (\r
-  IN  VOID                    *Context,\r
-  IN  BOOLEAN                 ExtendedVerification\r
+  IN  VOID     *Context,\r
+  IN  BOOLEAN  ExtendedVerification\r
   );\r
 \r
 /**\r
@@ -151,8 +131,8 @@ EFI_STATUS
 typedef\r
 EFI_STATUS\r
 (*USB_MASS_GET_MAX_LUN) (\r
-  IN  VOID                    *Context,\r
-  IN  UINT8                   *MaxLun\r
+  IN  VOID   *Context,\r
+  IN  UINT8  *MaxLun\r
   );\r
 \r
 /**\r
@@ -166,7 +146,7 @@ EFI_STATUS
 typedef\r
 EFI_STATUS\r
 (*USB_MASS_CLEAN_UP) (\r
-  IN  VOID                    *Context\r
+  IN  VOID  *Context\r
   );\r
 \r
 ///\r
@@ -177,27 +157,30 @@ EFI_STATUS
 /// structure so that the CBI protocol can be easily removed when\r
 /// it is no longer necessary.\r
 ///\r
-typedef struct {\r
-  UINT8                   Protocol;\r
-  USB_MASS_INIT_TRANSPORT Init;        ///< Initialize the mass storage transport protocol\r
-  USB_MASS_EXEC_COMMAND   ExecCommand; ///< Transport command to the device then get result\r
-  USB_MASS_RESET          Reset;       ///< Reset the device\r
-  USB_MASS_GET_MAX_LUN    GetMaxLun;   ///< Get max lun, only for bot\r
-  USB_MASS_CLEAN_UP       CleanUp;     ///< Clean up the resources.\r
-} USB_MASS_TRANSPORT;\r
-\r
-typedef struct {\r
-  UINT32                    Signature;\r
-  EFI_HANDLE                Controller;\r
-  EFI_USB_IO_PROTOCOL       *UsbIo;\r
-  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
-  EFI_BLOCK_IO_PROTOCOL     BlockIo;\r
-  EFI_BLOCK_IO_MEDIA        BlockIoMedia;\r
-  BOOLEAN                   OpticalStorage;\r
-  UINT8                     Lun;          ///< Logical Unit Number\r
-  UINT8                     Pdt;          ///< Peripheral Device Type\r
-  USB_MASS_TRANSPORT        *Transport;   ///< USB mass storage transport protocol\r
-  VOID                      *Context;     \r
-} USB_MASS_DEVICE;\r
+struct _USB_MASS_TRANSPORT {\r
+  UINT8                      Protocol;\r
+  USB_MASS_INIT_TRANSPORT    Init;        ///< Initialize the mass storage transport protocol\r
+  USB_MASS_EXEC_COMMAND      ExecCommand; ///< Transport command to the device then get result\r
+  USB_MASS_RESET             Reset;       ///< Reset the device\r
+  USB_MASS_GET_MAX_LUN       GetMaxLun;   ///< Get max lun, only for bot\r
+  USB_MASS_CLEAN_UP          CleanUp;     ///< Clean up the resources.\r
+};\r
+\r
+struct _USB_MASS_DEVICE {\r
+  UINT32                      Signature;\r
+  EFI_HANDLE                  Controller;\r
+  EFI_USB_IO_PROTOCOL         *UsbIo;\r
+  EFI_DEVICE_PATH_PROTOCOL    *DevicePath;\r
+  EFI_BLOCK_IO_PROTOCOL       BlockIo;\r
+  EFI_BLOCK_IO_MEDIA          BlockIoMedia;\r
+  BOOLEAN                     OpticalStorage;\r
+  UINT8                       Lun;        ///< Logical Unit Number\r
+  UINT8                       Pdt;        ///< Peripheral Device Type\r
+  USB_MASS_TRANSPORT          *Transport; ///< USB mass storage transport protocol\r
+  VOID                        *Context;\r
+  EFI_DISK_INFO_PROTOCOL      DiskInfo;\r
+  USB_BOOT_INQUIRY_DATA       InquiryData;\r
+  BOOLEAN                     Cdb16Byte;\r
+};\r
 \r
 #endif\r