X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FBus%2FUsb%2FUsbMassStorageDxe%2FUsbMassBoot.h;h=8f19ebd4d69626ba71c23e06cdc6b352e401b3cf;hb=e59db6a732dbbb064b1e39a288a25edc90adac5d;hp=13a926035ceb4b6b5709ea3c86f6ea9b8134be5f;hpb=275b96da6081b05f515aea775bec8bef9bfeac88;p=mirror_edk2.git diff --git a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h index 13a926035c..8f19ebd4d6 100644 --- a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h +++ b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h @@ -2,7 +2,7 @@ Definition of the command set of USB Mass Storage Specification for Bootability, Revision 1.0. -Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2018, 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 @@ -21,7 +21,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // INQUIRY/REQUEST_SENSE are "No Timeout Commands" as specified // by Multi-Media Commands (MMC) set. // Others are "Group 1 Timeout Commands". That is, -// they should be retried if driver is ready. +// they should be retried if driver is ready. // #define USB_BOOT_INQUIRY_OPCODE 0x12 #define USB_BOOT_REQUEST_SENSE_OPCODE 0x03 @@ -65,9 +65,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #define USB_PDT_SIMPLE_DIRECT 0x0E ///< Simplified direct access device // -// Other parameters, Max carried size is 512B * 128 = 64KB +// Other parameters, Max carried size is 64KB. // -#define USB_BOOT_IO_BLOCKS 128 +#define USB_BOOT_MAX_CARRY_SIZE SIZE_64KB // // Retry mass command times, set by experience @@ -82,17 +82,17 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // // Mass command timeout, refers to specification[USB20-9.2.6.1] // -// USB2.0 Spec define the up-limit timeout 5s for all command. USB floppy, -// USB CD-Rom and iPod devices are much slower than USB key when reponse +// USB2.0 Spec define the up-limit timeout 5s for all command. USB floppy, +// USB CD-Rom and iPod devices are much slower than USB key when reponse // most of commands, So we set 5s as timeout here. -// +// #define USB_BOOT_GENERAL_CMD_TIMEOUT (5 * USB_MASS_1_SECOND) // // The required commands are INQUIRY, READ CAPACITY, TEST UNIT READY, // READ10, WRITE10, and REQUEST SENSE. The BLOCK_IO protocol uses LBA // so it isn't necessary to issue MODE SENSE / READ FORMAT CAPACITY -// command to retrieve the disk gemotrics. +// command to retrieve the disk gemotrics. // #pragma pack(1) typedef struct { @@ -161,17 +161,7 @@ typedef struct { UINT8 TransferLen[2]; ///< Transfer length UINT8 Reserverd1; UINT8 Pad[2]; -} USB_BOOT_READ10_CMD; - -typedef struct { - UINT8 OpCode; - UINT8 Lun; - UINT8 Lba[4]; - UINT8 Reserved0; - UINT8 TransferLen[2]; - UINT8 Reserverd1; - UINT8 Pad[2]; -} USB_BOOT_WRITE10_CMD; +} USB_BOOT_READ_WRITE_10_CMD; typedef struct { UINT8 OpCode; @@ -292,66 +282,48 @@ UsbBootReadBlocks ( ); /** - Write some blocks to the device. + Read or write some blocks from the device. - @param UsbMass The USB mass storage device to write to + @param UsbMass The USB mass storage device to access + @param Write TRUE for write operation. @param Lba The start block number - @param TotalBlock Total block number to write - @param Buffer Pointer to the source buffer for the data. + @param TotalBlock Total block number to read or write + @param Buffer The buffer to read to or write from - @retval EFI_SUCCESS Data are written into the buffer - @retval Others Failed to write all the data + @retval EFI_SUCCESS Data are read into the buffer or writen into the device. + @retval Others Failed to read or write all the data **/ EFI_STATUS -UsbBootWriteBlocks ( - IN USB_MASS_DEVICE *UsbMass, - IN UINT32 Lba, - IN UINTN TotalBlock, - IN UINT8 *Buffer +UsbBootReadWriteBlocks ( + IN USB_MASS_DEVICE *UsbMass, + IN BOOLEAN Write, + IN UINT32 Lba, + IN UINTN TotalBlock, + IN OUT UINT8 *Buffer ); /** - Read some blocks from the device by SCSI 16 byte cmd. + Read or write some blocks from the device by SCSI 16 byte cmd. - @param UsbMass The USB mass storage device to read from + @param UsbMass The USB mass storage device to access + @param Write TRUE for write operation. @param Lba The start block number - @param TotalBlock Total block number to read - @param Buffer The buffer to read to - - @retval EFI_SUCCESS Data are read into the buffer - @retval Others Failed to read all the data + @param TotalBlock Total block number to read or write + @param Buffer The buffer to read to or write from + @retval EFI_SUCCESS Data are read into the buffer or writen into the device. + @retval Others Failed to read or write all the data **/ EFI_STATUS -UsbBootReadBlocks16 ( +UsbBootReadWriteBlocks16 ( IN USB_MASS_DEVICE *UsbMass, + IN BOOLEAN Write, IN UINT64 Lba, IN UINTN TotalBlock, - OUT UINT8 *Buffer + IN OUT UINT8 *Buffer ); -/** - Write some blocks to the device by SCSI 16 byte cmd. - - @param UsbMass The USB mass storage device to write to - @param Lba The start block number - @param TotalBlock Total block number to write - @param Buffer Pointer to the source buffer for the data. - - @retval EFI_SUCCESS Data are written into the buffer - @retval Others Failed to write all the data - -**/ -EFI_STATUS -UsbBootWriteBlocks16 ( - IN USB_MASS_DEVICE *UsbMass, - IN UINT64 Lba, - IN UINTN TotalBlock, - IN UINT8 *Buffer - ); - - /** Use the USB clear feature control transfer to clear the endpoint stall condition.