UINT8 TransferLen[2]; ///< Transfer length\r
UINT8 Reserverd1;\r
UINT8 Pad[2];\r
-} USB_BOOT_READ10_CMD;\r
-\r
-typedef struct {\r
- UINT8 OpCode;\r
- UINT8 Lun;\r
- UINT8 Lba[4];\r
- UINT8 Reserved0;\r
- UINT8 TransferLen[2];\r
- UINT8 Reserverd1;\r
- UINT8 Pad[2];\r
-} USB_BOOT_WRITE10_CMD;\r
+} USB_BOOT_READ_WRITE_10_CMD;\r
\r
typedef struct {\r
UINT8 OpCode;\r
);\r
\r
/**\r
- Write some blocks to the device.\r
+ Read or write some blocks from the device.\r
\r
- @param UsbMass The USB mass storage device to write to\r
+ @param UsbMass The USB mass storage device to access\r
+ @param Write TRUE for write operation.\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
+ @param TotalBlock Total block number to read or write\r
+ @param Buffer The buffer to read to or write from\r
\r
- @retval EFI_SUCCESS Data are written into the buffer\r
- @retval Others Failed to write all the data\r
+ @retval EFI_SUCCESS Data are read into the buffer or writen into the device.\r
+ @retval Others Failed to read or write all the data\r
\r
**/\r
EFI_STATUS\r
-UsbBootWriteBlocks (\r
- IN USB_MASS_DEVICE *UsbMass,\r
- IN UINT32 Lba,\r
- IN UINTN TotalBlock,\r
- IN UINT8 *Buffer\r
+UsbBootReadWriteBlocks (\r
+ IN USB_MASS_DEVICE *UsbMass,\r
+ IN BOOLEAN Write,\r
+ IN UINT32 Lba,\r
+ IN UINTN TotalBlock,\r
+ IN OUT UINT8 *Buffer\r
);\r
\r
/**\r
- Read some blocks from the device by SCSI 16 byte cmd.\r
+ Read or write some blocks from the device by SCSI 16 byte cmd.\r
\r
- @param UsbMass The USB mass storage device to read from\r
+ @param UsbMass The USB mass storage device to access\r
+ @param Write TRUE for write operation.\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
+ @param TotalBlock Total block number to read or write\r
+ @param Buffer The buffer to read to or write from\r
\r
+ @retval EFI_SUCCESS Data are read into the buffer or writen into the device.\r
+ @retval Others Failed to read or write all the data\r
**/\r
EFI_STATUS\r
-UsbBootReadBlocks16 (\r
+UsbBootReadWriteBlocks16 (\r
IN USB_MASS_DEVICE *UsbMass,\r
+ IN BOOLEAN Write,\r
IN UINT64 Lba,\r
IN UINTN TotalBlock,\r
- OUT UINT8 *Buffer\r
+ IN 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