/** @file
Definition of USB Mass Storage Class and its value, USB Mass Transport Protocol,
and other common definitions.
Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _EFI_USBMASS_H_
#define _EFI_USBMASS_H_
#include <Uefi.h>
#include <IndustryStandard/Scsi.h>
#include <Protocol/DevicePath.h>
#include <Protocol/DiskInfo.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/DevicePathLib.h>
#include "UsbMassBot.h"
#include "UsbMassCbi.h"
#include "UsbMassBoot.h"
#include "UsbMassDiskInfo.h"
#include "UsbMassImpl.h"
#define USB_IS_INTERRUPT_ENDPOINT(Attribute) (((Attribute) & (BIT0 | BIT1)) == USB_ENDPOINT_INTERRUPT)
//
// Usb mass storage class code
//
//
// Usb mass storage subclass code, specify the command set used.
//
//
// Usb mass storage protocol code, specify the transport protocol
//
#define USB_MASS_CMD_SUCCESS 0
/**
Initializes USB transport protocol.
This function initializes the USB mass storage class transport protocol.
It will save its context in the Context if Context isn't NULL.
@param UsbIo The USB I/O Protocol instance
@param Context The buffer to save the context to
@retval EFI_SUCCESS The device is successfully initialized.
@retval EFI_UNSUPPORTED The transport protocol doesn't support the device.
@retval Other The USB transport initialization fails.
**/
typedef
);
/**
Execute USB mass storage command through the transport protocol.
@param Context The USB Transport Protocol.
@param Cmd The command to transfer to device
@param CmdLen The length of the command
@param DataDir The direction of data transfer
@param Data The buffer to hold the data
@param DataLen The length of the buffer
@param Lun Should be 0, this field for bot only
@param Timeout The time to wait
@param CmdStatus The result of the command execution
@retval EFI_SUCCESS The command is executed successfully.
@retval Other Failed to execute the command
**/
typedef
);
/**
Reset the USB mass storage device by Transport protocol.
@param Context The USB Transport Protocol
@param ExtendedVerification The flag controlling the rule of reset.
Not used here.
@retval EFI_SUCCESS The device is reset.
@retval Others Failed to reset the device.
**/
typedef
(*USB_MASS_RESET) (
);
/**
Get the max LUN (Logical Unit Number) of USB mass storage device.
@param Context The context of the transport protocol.
@param MaxLun Return pointer to the max number of LUN. (e.g. MaxLun=1 means LUN0 and
LUN1 in all.)
@retval EFI_SUCCESS Max LUN is got successfully.
@retval Others Fail to execute this request.
**/
typedef
(*USB_MASS_GET_MAX_LUN) (
);
/**
Clean up the transport protocol's resource.
@param Context The instance of transport protocol.
@retval EFI_SUCCESS The resource is cleaned up.
**/
typedef
(*USB_MASS_CLEAN_UP) (
);
///
/// This structure contains information necessary to select the
/// proper transport protocol. The mass storage class defines
/// two transport protocols. One is the CBI, and the other is BOT.
/// CBI is being obseleted. The design is made modular by this
/// structure so that the CBI protocol can be easily removed when
/// it is no longer necessary.
///
struct _USB_MASS_TRANSPORT {
};
struct _USB_MASS_DEVICE {
};
#endif