]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMass.h
add macro function comments
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbMassStorageDxe / UsbMass.h
index fe3f8b9e68100ccd9e1bd26d4248f025f95efdea..b65fc18b14064d119fd79e2ac0a2cd30d89475cc 100644 (file)
@@ -1,20 +1,5 @@
 /** @file\r
 \r
-Copyright (c) 2007, 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
-\r
-Module Name:\r
-\r
-  UsbMass.h\r
-\r
-Abstract:\r
-\r
   Defination for the USB mass storage class driver. The USB mass storage\r
   class is specified in two layers: the bottom layer is the transportation\r
   protocol. The top layer is the command set. The transportation layer\r
@@ -23,8 +8,14 @@ Abstract:
   Control/Bulk/Interrupt transport are two transportation protocol. USB mass\r
   storage class adopts various industrial standard as its command set.\r
 \r
-Revision History\r
+Copyright (c) 2007 - 2008, 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
 \r
 **/\r
 \r
@@ -32,10 +23,11 @@ Revision History
 #define _EFI_USBMASS_H_\r
 \r
 \r
-#include <PiDxe.h>\r
+#include <Uefi.h>\r
 \r
 #include <Protocol/BlockIo.h>\r
 #include <Protocol/UsbIo.h>\r
+#include <Protocol/DevicePath.h>\r
 \r
 #include <Library/DebugLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
@@ -43,6 +35,7 @@ Revision History
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/UefiLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
+#include <Library/DevicePathLib.h>\r
 \r
 #define USB_IS_IN_ENDPOINT(EndPointAddr)      (((EndPointAddr) & 0x80) == 0x80)\r
 #define USB_IS_OUT_ENDPOINT(EndPointAddr)     (((EndPointAddr) & 0x80) == 0)\r
@@ -50,7 +43,7 @@ Revision History
 #define USB_IS_INTERRUPT_ENDPOINT(Attribute)  (((Attribute) & 0x03) == 0x03)\r
 #define USB_IS_ERROR(Result, Error)           (((Result) & (Error)) != 0)\r
 \r
-enum {\r
+typedef enum {\r
   //\r
   // Usb mass storage class code\r
   //\r
@@ -79,13 +72,12 @@ enum {
   USB_MASS_CMD_SUCCESS    = 0,\r
   USB_MASS_CMD_FAIL,\r
   USB_MASS_CMD_PERSISTENT\r
-};\r
+}USB_MASS_DEV_CLASS_AND_VALUE;\r
 \r
 typedef\r
 EFI_STATUS\r
 (*USB_MASS_INIT_TRANSPORT) (\r
   IN  EFI_USB_IO_PROTOCOL     *Usb,\r
-  IN  EFI_HANDLE              Controller,\r
   OUT VOID                    **Context    OPTIONAL\r
   );\r
 \r
@@ -98,6 +90,7 @@ EFI_STATUS
   IN  EFI_USB_DATA_DIRECTION  DataDir,\r
   IN  VOID                    *Data,\r
   IN  UINT32                  DataLen,\r
+  IN  UINT8                   Lun,\r
   IN  UINT32                  Timeout,\r
   OUT UINT32                  *CmdStatus\r
   );\r
@@ -109,6 +102,13 @@ EFI_STATUS
   IN  BOOLEAN                 ExtendedVerification\r
   );\r
 \r
+typedef\r
+EFI_STATUS\r
+(*USB_MASS_GET_MAX_LUN) (\r
+  IN  VOID                    *Context,\r
+  IN  UINT8                   *MaxLun\r
+  );\r
+\r
 typedef\r
 EFI_STATUS\r
 (*USB_MASS_FINI) (\r
@@ -128,14 +128,26 @@ typedef struct {
   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_FINI           Fini;        // Clean up the resources.\r
 } USB_MASS_TRANSPORT;\r
 \r
 \r
+/**\r
+  Use the USB clear feature control transfer to clear the endpoint\r
+  stall condition.\r
+\r
+  @param  UsbIo                  The USB IO protocol to use\r
+  @param  EndpointAddr           The endpoint to clear stall for\r
+\r
+  @retval EFI_SUCCESS            The endpoint stall condtion is clear\r
+  @retval Others                 Failed to clear the endpoint stall condtion\r
+\r
+**/\r
 EFI_STATUS\r
 UsbClearEndpointStall (\r
   IN EFI_USB_IO_PROTOCOL      *UsbIo,\r
-  IN UINT8                    EndpointAddress\r
+  IN UINT8                    EndpointAddr\r
   );\r
 \r
 #endif\r