/** @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
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
#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
#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
#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
USB_MASS_STORE_RBC = 0x01, // Reduced Block Commands\r
USB_MASS_STORE_8020I = 0x02, // SFF-8020i, typically a CD/DVD device\r
USB_MASS_STORE_QIC = 0x03, // Typically a tape device\r
- USB_MASS_STORE_UFI = 0x04, // Typically a floopy disk driver device\r
+ USB_MASS_STORE_UFI = 0x04, // Typically a floppy disk driver device\r
USB_MASS_STORE_8070I = 0x05, // SFF-8070i, typically a floppy disk driver device.\r
USB_MASS_STORE_SCSI = 0x06, // SCSI transparent command set\r
\r
USB_MASS_STORE_CBI1 = 0x01, // CBI protocol without command completion interrupt\r
USB_MASS_STORE_BOT = 0x50, // Bulk-Only Transport\r
\r
- USB_MASS_STALL_1_MS = 1000,\r
- USB_MASS_STALL_1_S = 1000 * USB_MASS_STALL_1_MS,\r
+ USB_MASS_1_MILLISECOND = 1000,\r
+ USB_MASS_1_SECOND = 1000 * USB_MASS_1_MILLISECOND,\r
\r
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
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
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
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
-extern UINTN mUsbMscInfo;\r
-extern UINTN mUsbMscError;\r
#endif\r