EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index
Data Structures | Defines | Typedefs

MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMass.h File Reference

#include <Uefi.h>
#include <Protocol/BlockIo.h>
#include <Protocol/UsbIo.h>
#include <Protocol/DevicePath.h>
#include <Protocol/DiskInfo.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/DevicePathLib.h>
#include "UsbMassBot.h"
#include "UsbMassCbi.h"
#include "UsbMassBoot.h"
#include "UsbMassDiskInfo.h"
#include "UsbMassImpl.h"

Go to the source code of this file.

Data Structures

struct  _USB_MASS_TRANSPORT
struct  _USB_MASS_DEVICE

Defines

#define USB_IS_IN_ENDPOINT(EndPointAddr)   (((EndPointAddr) & BIT7) == BIT7)
#define USB_IS_OUT_ENDPOINT(EndPointAddr)   (((EndPointAddr) & BIT7) == 0)
#define USB_IS_BULK_ENDPOINT(Attribute)   (((Attribute) & (BIT0 | BIT1)) == USB_ENDPOINT_BULK)
#define USB_IS_INTERRUPT_ENDPOINT(Attribute)   (((Attribute) & (BIT0 | BIT1)) == USB_ENDPOINT_INTERRUPT)
#define USB_IS_ERROR(Result, Error)   (((Result) & (Error)) != 0)
#define USB_MASS_STORE_CLASS   0x08
#define USB_MASS_STORE_RBC   0x01
 Reduced Block Commands.
#define USB_MASS_STORE_8020I   0x02
 SFF-8020i, typically a CD/DVD device.
#define USB_MASS_STORE_QIC   0x03
 Typically a tape device.
#define USB_MASS_STORE_UFI   0x04
 Typically a floppy disk driver device.
#define USB_MASS_STORE_8070I   0x05
 SFF-8070i, typically a floppy disk driver device.
#define USB_MASS_STORE_SCSI   0x06
 SCSI transparent command set.
#define USB_MASS_STORE_CBI0   0x00
 CBI protocol with command completion interrupt.
#define USB_MASS_STORE_CBI1   0x01
 CBI protocol without command completion interrupt.
#define USB_MASS_STORE_BOT   0x50
 Bulk-Only Transport.
#define USB_MASS_1_MILLISECOND   1000
#define USB_MASS_1_SECOND   (1000 * USB_MASS_1_MILLISECOND)
#define USB_MASS_CMD_SUCCESS   0
#define USB_MASS_CMD_FAIL   1
#define USB_MASS_CMD_PERSISTENT   2

Typedefs

typedef struct _USB_MASS_TRANSPORT USB_MASS_TRANSPORT
typedef struct _USB_MASS_DEVICE USB_MASS_DEVICE
typedef EFI_STATUS(* USB_MASS_INIT_TRANSPORT )(IN EFI_USB_IO_PROTOCOL *Usb, OUT VOID **Context OPTIONAL)
typedef EFI_STATUS(* USB_MASS_EXEC_COMMAND )(IN VOID *Context, IN VOID *Cmd, IN UINT8 CmdLen, IN EFI_USB_DATA_DIRECTION DataDir, IN VOID *Data, IN UINT32 DataLen, IN UINT8 Lun, IN UINT32 Timeout, OUT UINT32 *CmdStatus)
typedef EFI_STATUS(* USB_MASS_RESET )(IN VOID *Context, IN BOOLEAN ExtendedVerification)
typedef EFI_STATUS(* USB_MASS_GET_MAX_LUN )(IN VOID *Context, IN UINT8 *MaxLun)
typedef EFI_STATUS(* USB_MASS_CLEAN_UP )(IN VOID *Context)

Detailed Description

Definition of USB Mass Storage Class and its value, USB Mass Transport Protocol, and other common definitions.

Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.
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 http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Definition in file UsbMass.h.


Define Documentation

#define USB_IS_BULK_ENDPOINT (   Attribute)    (((Attribute) & (BIT0 | BIT1)) == USB_ENDPOINT_BULK)

Definition at line 46 of file UsbMass.h.

#define USB_IS_ERROR (   Result,
  Error 
)    (((Result) & (Error)) != 0)

Definition at line 48 of file UsbMass.h.

#define USB_IS_IN_ENDPOINT (   EndPointAddr)    (((EndPointAddr) & BIT7) == BIT7)

Definition at line 44 of file UsbMass.h.

#define USB_IS_INTERRUPT_ENDPOINT (   Attribute)    (((Attribute) & (BIT0 | BIT1)) == USB_ENDPOINT_INTERRUPT)

Definition at line 47 of file UsbMass.h.

#define USB_IS_OUT_ENDPOINT (   EndPointAddr)    (((EndPointAddr) & BIT7) == 0)

Definition at line 45 of file UsbMass.h.

#define USB_MASS_1_MILLISECOND   1000

Definition at line 72 of file UsbMass.h.

#define USB_MASS_1_SECOND   (1000 * USB_MASS_1_MILLISECOND)

Definition at line 73 of file UsbMass.h.

#define USB_MASS_CMD_FAIL   1

Definition at line 76 of file UsbMass.h.

#define USB_MASS_CMD_PERSISTENT   2

Definition at line 77 of file UsbMass.h.

#define USB_MASS_CMD_SUCCESS   0

Definition at line 75 of file UsbMass.h.

#define USB_MASS_STORE_8020I   0x02

SFF-8020i, typically a CD/DVD device.

Definition at line 59 of file UsbMass.h.

#define USB_MASS_STORE_8070I   0x05

SFF-8070i, typically a floppy disk driver device.

Definition at line 62 of file UsbMass.h.

#define USB_MASS_STORE_BOT   0x50

Bulk-Only Transport.

Definition at line 70 of file UsbMass.h.

#define USB_MASS_STORE_CBI0   0x00

CBI protocol with command completion interrupt.

Definition at line 68 of file UsbMass.h.

#define USB_MASS_STORE_CBI1   0x01

CBI protocol without command completion interrupt.

Definition at line 69 of file UsbMass.h.

#define USB_MASS_STORE_CLASS   0x08

Definition at line 53 of file UsbMass.h.

#define USB_MASS_STORE_QIC   0x03

Typically a tape device.

Definition at line 60 of file UsbMass.h.

#define USB_MASS_STORE_RBC   0x01

Reduced Block Commands.

Definition at line 58 of file UsbMass.h.

#define USB_MASS_STORE_SCSI   0x06

SCSI transparent command set.

Definition at line 63 of file UsbMass.h.

#define USB_MASS_STORE_UFI   0x04

Typically a floppy disk driver device.

Definition at line 61 of file UsbMass.h.


Typedef Documentation

typedef EFI_STATUS(* USB_MASS_CLEAN_UP)(IN VOID *Context)

Clean up the transport protocol's resource.

Parameters:
ContextThe instance of transport protocol.
Return values:
EFI_SUCCESSThe resource is cleaned up.

Definition at line 177 of file UsbMass.h.

Definition at line 36 of file UsbMass.h.

typedef EFI_STATUS(* USB_MASS_EXEC_COMMAND)(IN VOID *Context, IN VOID *Cmd, IN UINT8 CmdLen, IN EFI_USB_DATA_DIRECTION DataDir, IN VOID *Data, IN UINT32 DataLen, IN UINT8 Lun, IN UINT32 Timeout, OUT UINT32 *CmdStatus)

Execute USB mass storage command through the transport protocol.

Parameters:
ContextThe USB Transport Protocol.
CmdThe command to transfer to device
CmdLenThe length of the command
DataDirThe direction of data transfer
DataThe buffer to hold the data
DataLenThe length of the buffer
LunShould be 0, this field for bot only
TimeoutThe time to wait
CmdStatusThe result of the command execution
Return values:
EFI_SUCCESSThe command is executed successfully.
OtherFailed to execute the command

Definition at line 119 of file UsbMass.h.

typedef EFI_STATUS(* USB_MASS_GET_MAX_LUN)(IN VOID *Context, IN UINT8 *MaxLun)

Get the max LUN (Logical Unit Number) of USB mass storage device.

Parameters:
ContextThe context of the transport protocol.
MaxLunReturn pointer to the max number of LUN. (e.g. MaxLun=1 means LUN0 and LUN1 in all.)
Return values:
EFI_SUCCESSMax LUN is got successfully.
OthersFail to execute this request.

Definition at line 162 of file UsbMass.h.

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.

Parameters:
UsbIoThe USB I/O Protocol instance
ContextThe buffer to save the context to
Return values:
EFI_SUCCESSThe device is successfully initialized.
EFI_UNSUPPORTEDThe transport protocol doesn't support the device.
OtherThe USB transport initialization fails.

Definition at line 95 of file UsbMass.h.

Reset the USB mass storage device by Transport protocol.

Parameters:
ContextThe USB Transport Protocol
ExtendedVerificationThe flag controlling the rule of reset. Not used here.
Return values:
EFI_SUCCESSThe device is reset.
OthersFailed to reset the device.

Definition at line 144 of file UsbMass.h.

Definition at line 35 of file UsbMass.h.

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines