]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h
MdeModulePkg/UsbMassStorageDxe: Fix USB Mass Storage detection
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbMassStorageDxe / UsbMassBoot.h
index 91a21fc571a559ebccefe4fce7c11487f4402041..13a926035ceb4b6b5709ea3c86f6ea9b8134be5f 100644 (file)
@@ -2,8 +2,8 @@
   Definition of the command set of USB Mass Storage Specification\r
   for Bootability, Revision 1.0.\r
 \r
-Copyright (c) 2007 - 2010, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php\r
@@ -16,8 +16,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #ifndef _EFI_USB_MASS_BOOT_H_\r
 #define _EFI_USB_MASS_BOOT_H_\r
 \r
-#include "UsbMass.h"\r
-\r
 //\r
 // The opcodes of various USB boot commands:\r
 // INQUIRY/REQUEST_SENSE are "No Timeout Commands" as specified\r
@@ -53,9 +51,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define USB_BOOT_SENSE_VOLUME_OVERFLOW  0x0D ///< Partition overflow\r
 #define USB_BOOT_SENSE_MISCOMPARE       0x0E ///< Source data mis-match while verfying.\r
 \r
-#define USB_BOOT_ASC_NOT_READY          0x04\r
-#define USB_BOOT_ASC_NO_MEDIA           0x3A\r
-#define USB_BOOT_ASC_MEDIA_CHANGE       0x28\r
+#define USB_BOOT_ASC_NO_ADDITIONAL_SENSE_INFORMATION  0x00\r
+#define USB_BOOT_ASC_NOT_READY                        0x04\r
+#define USB_BOOT_ASC_NO_MEDIA                         0x3A\r
+#define USB_BOOT_ASC_MEDIA_CHANGE                     0x28\r
 \r
 //\r
 // Supported PDT codes, or Peripheral Device Type\r
@@ -74,7 +73,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 // Retry mass command times, set by experience\r
 //\r
 #define USB_BOOT_COMMAND_RETRY          5\r
-#define USB_BOOT_INIT_MEDIA_RETRY       5\r
 \r
 //\r
 // Wait for unit ready command, set by experience\r
@@ -313,6 +311,47 @@ UsbBootWriteBlocks (
   IN  UINT8                   *Buffer\r
   );\r
 \r
+/**\r
+  Read some blocks from the device by SCSI 16 byte cmd.\r
+\r
+  @param  UsbMass                The USB mass storage device to read from\r
+  @param  Lba                    The start block number\r
+  @param  TotalBlock             Total block number to read\r
+  @param  Buffer                 The buffer to read to\r
+\r
+  @retval EFI_SUCCESS            Data are read into the buffer\r
+  @retval Others                 Failed to read all the data\r
+\r
+**/\r
+EFI_STATUS\r
+UsbBootReadBlocks16 (\r
+  IN  USB_MASS_DEVICE       *UsbMass,\r
+  IN  UINT64                Lba,\r
+  IN  UINTN                 TotalBlock,\r
+  OUT UINT8                 *Buffer\r
+  );\r
+\r
+/**\r
+  Write some blocks to the device by SCSI 16 byte cmd.\r
+\r
+  @param  UsbMass                The USB mass storage device to write to\r
+  @param  Lba                    The start block number\r
+  @param  TotalBlock             Total block number to write\r
+  @param  Buffer                 Pointer to the source buffer for the data.\r
+\r
+  @retval EFI_SUCCESS            Data are written into the buffer\r
+  @retval Others                 Failed to write all the data\r
+\r
+**/\r
+EFI_STATUS\r
+UsbBootWriteBlocks16 (\r
+  IN  USB_MASS_DEVICE         *UsbMass,\r
+  IN  UINT64                  Lba,\r
+  IN  UINTN                   TotalBlock,\r
+  IN  UINT8                   *Buffer\r
+  );\r
+\r
+\r
 /**\r
   Use the USB clear feature control transfer to clear the endpoint stall condition.\r
 \r