TianoCore EDK2 master
Loading...
Searching...
No Matches
UsbMass.h
Go to the documentation of this file.
1
10#ifndef _EFI_USBMASS_H_
11#define _EFI_USBMASS_H_
12
13#include <Uefi.h>
15#include <Protocol/BlockIo.h>
16#include <Protocol/UsbIo.h>
17#include <Protocol/DevicePath.h>
18#include <Protocol/DiskInfo.h>
19#include <Library/BaseLib.h>
20#include <Library/DebugLib.h>
24#include <Library/UefiLib.h>
27
30
31#include "UsbMassBot.h"
32#include "UsbMassCbi.h"
33#include "UsbMassBoot.h"
34#include "UsbMassDiskInfo.h"
35#include "UsbMassImpl.h"
36
37#define USB_IS_IN_ENDPOINT(EndPointAddr) (((EndPointAddr) & BIT7) == BIT7)
38#define USB_IS_OUT_ENDPOINT(EndPointAddr) (((EndPointAddr) & BIT7) == 0)
39#define USB_IS_BULK_ENDPOINT(Attribute) (((Attribute) & (BIT0 | BIT1)) == USB_ENDPOINT_BULK)
40#define USB_IS_INTERRUPT_ENDPOINT(Attribute) (((Attribute) & (BIT0 | BIT1)) == USB_ENDPOINT_INTERRUPT)
41#define USB_IS_ERROR(Result, Error) (((Result) & (Error)) != 0)
42
43#define USB_MASS_1_MILLISECOND 1000
44#define USB_MASS_1_SECOND (1000 * USB_MASS_1_MILLISECOND)
45
46#define USB_MASS_CMD_SUCCESS 0
47#define USB_MASS_CMD_FAIL 1
48#define USB_MASS_CMD_PERSISTENT 2
49
64typedef
68 OUT VOID **Context OPTIONAL
69 );
70
88typedef
91 IN VOID *Context,
92 IN VOID *Cmd,
93 IN UINT8 CmdLen,
95 IN VOID *Data,
96 IN UINT32 DataLen,
97 IN UINT8 Lun,
98 IN UINT32 Timeout,
99 OUT UINT32 *CmdStatus
100 );
101
113typedef
116 IN VOID *Context,
117 IN BOOLEAN ExtendedVerification
118 );
119
131typedef
134 IN VOID *Context,
135 IN UINT8 *MaxLun
136 );
137
146typedef
149 IN VOID *Context
150 );
151
161 UINT8 Protocol;
167};
168
170 UINT32 Signature;
171 EFI_HANDLE Controller;
172 EFI_USB_IO_PROTOCOL *UsbIo;
173 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
174 EFI_BLOCK_IO_PROTOCOL BlockIo;
175 EFI_BLOCK_IO_MEDIA BlockIoMedia;
176 BOOLEAN OpticalStorage;
177 UINT8 Lun;
178 UINT8 Pdt;
180 VOID *Context;
181 EFI_DISK_INFO_PROTOCOL DiskInfo;
182 USB_BOOT_INQUIRY_DATA InquiryData;
183 BOOLEAN Cdb16Byte;
184};
185
186#endif
#define OPTIONAL
Definition: Base.h:290
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_USB_DATA_DIRECTION
Definition: UsbIo.h:44
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
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)
Definition: UsbMass.h:90
EFI_STATUS(* USB_MASS_CLEAN_UP)(IN VOID *Context)
Definition: UsbMass.h:148
EFI_STATUS(* USB_MASS_GET_MAX_LUN)(IN VOID *Context, IN UINT8 *MaxLun)
Definition: UsbMass.h:133
EFI_STATUS(* USB_MASS_RESET)(IN VOID *Context, IN BOOLEAN ExtendedVerification)
Definition: UsbMass.h:115
EFI_STATUS(* USB_MASS_INIT_TRANSPORT)(IN EFI_USB_IO_PROTOCOL *Usb, OUT VOID **Context OPTIONAL)
Definition: UsbMass.h:66
UINT8 Pdt
Peripheral Device Type.
Definition: UsbMass.h:178
UINT8 Lun
Logical Unit Number.
Definition: UsbMass.h:177
USB_MASS_TRANSPORT * Transport
USB mass storage transport protocol.
Definition: UsbMass.h:179
USB_MASS_GET_MAX_LUN GetMaxLun
Get max lun, only for bot.
Definition: UsbMass.h:165
USB_MASS_INIT_TRANSPORT Init
Initialize the mass storage transport protocol.
Definition: UsbMass.h:162
USB_MASS_RESET Reset
Reset the device.
Definition: UsbMass.h:164
USB_MASS_CLEAN_UP CleanUp
Clean up the resources.
Definition: UsbMass.h:166
USB_MASS_EXEC_COMMAND ExecCommand
Transport command to the device then get result.
Definition: UsbMass.h:163