TianoCore EDK2 master
|
#include <Uefi.h>
#include <IndustryStandard/Scsi.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 |
Macros | |
#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_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) |
Definition of USB Mass Storage Class and its value, USB Mass Transport Protocol, and other common definitions.
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file UsbMass.h.
#define USB_IS_BULK_ENDPOINT | ( | Attribute | ) | (((Attribute) & (BIT0 | BIT1)) == USB_ENDPOINT_BULK) |
#define USB_IS_ERROR | ( | Result, | |
Error | |||
) | (((Result) & (Error)) != 0) |
#define USB_IS_IN_ENDPOINT | ( | EndPointAddr | ) | (((EndPointAddr) & BIT7) == BIT7) |
#define USB_IS_INTERRUPT_ENDPOINT | ( | Attribute | ) | (((Attribute) & (BIT0 | BIT1)) == USB_ENDPOINT_INTERRUPT) |
#define USB_IS_OUT_ENDPOINT | ( | EndPointAddr | ) | (((EndPointAddr) & BIT7) == 0) |
typedef EFI_STATUS(* USB_MASS_CLEAN_UP) (IN VOID *Context) |
typedef struct _USB_MASS_DEVICE USB_MASS_DEVICE |
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.
Context | The USB Transport Protocol. |
Cmd | The command to transfer to device |
CmdLen | The length of the command |
DataDir | The direction of data transfer |
Data | The buffer to hold the data |
DataLen | The length of the buffer |
Lun | Should be 0, this field for bot only |
Timeout | The time to wait |
CmdStatus | The result of the command execution |
EFI_SUCCESS | The command is executed successfully. |
Other | Failed to execute the command |
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.
Context | The context of the transport protocol. |
MaxLun | Return pointer to the max number of LUN. (e.g. MaxLun=1 means LUN0 and LUN1 in all.) |
EFI_SUCCESS | Max LUN is got successfully. |
Others | Fail to execute this request. |
typedef EFI_STATUS(* USB_MASS_INIT_TRANSPORT) (IN EFI_USB_IO_PROTOCOL *Usb, OUT VOID **Context OPTIONAL) |
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.
UsbIo | The USB I/O Protocol instance |
Context | The buffer to save the context to |
EFI_SUCCESS | The device is successfully initialized. |
EFI_UNSUPPORTED | The transport protocol doesn't support the device. |
Other | The USB transport initialization fails. |
typedef EFI_STATUS(* USB_MASS_RESET) (IN VOID *Context, IN BOOLEAN ExtendedVerification) |
typedef struct _USB_MASS_TRANSPORT USB_MASS_TRANSPORT |