10#ifndef _EFI_USB_MASS_BOOT_H_
11#define _EFI_USB_MASS_BOOT_H_
20#define USB_BOOT_INQUIRY_OPCODE 0x12
21#define USB_BOOT_REQUEST_SENSE_OPCODE 0x03
22#define USB_BOOT_MODE_SENSE10_OPCODE 0x5A
23#define USB_BOOT_READ_CAPACITY_OPCODE 0x25
24#define USB_BOOT_TEST_UNIT_READY_OPCODE 0x00
25#define USB_BOOT_READ10_OPCODE 0x28
26#define USB_BOOT_WRITE10_OPCODE 0x2A
28#define USB_SCSI_MODE_SENSE6_OPCODE 0x1A
34#define USB_BOOT_SENSE_NO_SENSE 0x00
35#define USB_BOOT_SENSE_RECOVERED 0x01
36#define USB_BOOT_SENSE_NOT_READY 0x02
37#define USB_BOOT_SNESE_MEDIUM_ERROR 0X03
38#define USB_BOOT_SENSE_HARDWARE_ERROR 0X04
39#define USB_BOOT_SENSE_ILLEGAL_REQUEST 0X05
40#define USB_BOOT_SENSE_UNIT_ATTENTION 0X06
41#define USB_BOOT_SENSE_DATA_PROTECT 0X07
42#define USB_BOOT_SENSE_BLANK_CHECK 0X08
43#define USB_BOOT_SENSE_VENDOR 0X09
44#define USB_BOOT_SENSE_ABORTED 0X0B
45#define USB_BOOT_SENSE_VOLUME_OVERFLOW 0x0D
46#define USB_BOOT_SENSE_MISCOMPARE 0x0E
48#define USB_BOOT_ASC_NO_ADDITIONAL_SENSE_INFORMATION 0x00
49#define USB_BOOT_ASC_NOT_READY 0x04
50#define USB_BOOT_ASC_NO_MEDIA 0x3A
51#define USB_BOOT_ASC_MEDIA_CHANGE 0x28
56#define USB_PDT_DIRECT_ACCESS 0x00
57#define USB_PDT_CDROM 0x05
58#define USB_PDT_OPTICAL 0x07
59#define USB_PDT_SIMPLE_DIRECT 0x0E
64#define USB_BOOT_MAX_CARRY_SIZE SIZE_64KB
69#define USB_BOOT_COMMAND_RETRY 5
74#define USB_BOOT_RETRY_UNIT_READY_STALL (500 * USB_MASS_1_MILLISECOND)
83#define USB_BOOT_GENERAL_CMD_TIMEOUT (5 * USB_MASS_1_SECOND)
109 UINT8 ProductRevision[4];
136 UINT8 ParaListLenMsb;
137 UINT8 ParaListLenLsb;
143 UINT8 ModeDataLenMsb;
144 UINT8 ModeDataLenLsb;
155 UINT8 TransferLen[2];
201#define USB_BOOT_LUN(Lun) ((Lun) << 5)
206#define USB_BOOT_REMOVABLE(RmbByte) (((RmbByte) & BIT7) != 0)
207#define USB_BOOT_PDT(Pdt) ((Pdt) & 0x1f)
208#define USB_BOOT_SENSE_KEY(Key) ((Key) & 0x0f)
334 IN UINT8 EndpointAddr
EFI_STATUS UsbBootGetParams(IN USB_MASS_DEVICE *UsbMass)
EFI_STATUS UsbBootIsUnitReady(IN USB_MASS_DEVICE *UsbMass)
EFI_STATUS UsbBootReadWriteBlocks(IN USB_MASS_DEVICE *UsbMass, IN BOOLEAN Write, IN UINT32 Lba, IN UINTN TotalBlock, IN OUT UINT8 *Buffer)
EFI_STATUS UsbBootReadBlocks(IN USB_MASS_DEVICE *UsbMass, IN UINT32 Lba, IN UINTN TotalBlock, OUT UINT8 *Buffer)
EFI_STATUS UsbBootReadWriteBlocks16(IN USB_MASS_DEVICE *UsbMass, IN BOOLEAN Write, IN UINT64 Lba, IN UINTN TotalBlock, IN OUT UINT8 *Buffer)
EFI_STATUS UsbBootDetectMedia(IN USB_MASS_DEVICE *UsbMass)
EFI_STATUS UsbClearEndpointStall(IN EFI_USB_IO_PROTOCOL *UsbIo, IN UINT8 EndpointAddr)
UINT8 Lun
Lun (high 3 bits)
UINT8 Pdt
Peripheral Device Type (low 5 bits)
UINT8 AddLen
Additional length.
UINT8 Removable
Removable Media (highest bit)
UINT8 Lun
Lun (High 3 bits)
UINT8 AllocLen
Allocation length.
UINT8 Lun
Lun (High 3 bits)
UINT8 Ascq
Additional Sense Code Qualifier.
UINT8 Asc
Additional Sense Code.
UINT8 SenseKey
Sense key (low 4 bits)
UINT8 AddLen
Additional Sense length, 10.