USB_BOOT_READ10_CMD ReadCmd;\r
EFI_STATUS Status;\r
UINT16 Count;\r
+ UINT16 CountMax;\r
UINT32 BlockSize;\r
UINT32 ByteSize;\r
UINT32 Timeout;\r
\r
BlockSize = UsbMass->BlockIoMedia.BlockSize;\r
+ CountMax = (UINT16)(USB_BOOT_MAX_CARRY_SIZE / BlockSize);\r
Status = EFI_SUCCESS;\r
\r
while (TotalBlock > 0) {\r
// on the device. We must split the total block because the READ10\r
// command only has 16 bit transfer length (in the unit of block).\r
//\r
- Count = (UINT16)((TotalBlock < USB_BOOT_IO_BLOCKS) ? TotalBlock : USB_BOOT_IO_BLOCKS);\r
+ Count = (UINT16)((TotalBlock < CountMax) ? TotalBlock : CountMax);\r
ByteSize = (UINT32)Count * BlockSize;\r
\r
//\r
USB_BOOT_WRITE10_CMD WriteCmd;\r
EFI_STATUS Status;\r
UINT16 Count;\r
+ UINT16 CountMax;\r
UINT32 BlockSize;\r
UINT32 ByteSize;\r
UINT32 Timeout;\r
\r
BlockSize = UsbMass->BlockIoMedia.BlockSize;\r
+ CountMax = (UINT16)(USB_BOOT_MAX_CARRY_SIZE / BlockSize);\r
Status = EFI_SUCCESS;\r
\r
while (TotalBlock > 0) {\r
// on the device. We must split the total block because the WRITE10\r
// command only has 16 bit transfer length (in the unit of block).\r
//\r
- Count = (UINT16)((TotalBlock < USB_BOOT_IO_BLOCKS) ? TotalBlock : USB_BOOT_IO_BLOCKS);\r
+ Count = (UINT16)((TotalBlock < CountMax) ? TotalBlock : CountMax);\r
ByteSize = (UINT32)Count * BlockSize;\r
\r
//\r
UINT8 ReadCmd[16];\r
EFI_STATUS Status;\r
UINT16 Count;\r
+ UINT16 CountMax;\r
UINT32 BlockSize;\r
UINT32 ByteSize;\r
UINT32 Timeout;\r
\r
BlockSize = UsbMass->BlockIoMedia.BlockSize;\r
+ CountMax = (UINT16)(USB_BOOT_MAX_CARRY_SIZE / BlockSize);\r
Status = EFI_SUCCESS;\r
\r
while (TotalBlock > 0) {\r
//\r
// Split the total blocks into smaller pieces.\r
//\r
- Count = (UINT16)((TotalBlock < USB_BOOT_IO_BLOCKS) ? TotalBlock : USB_BOOT_IO_BLOCKS);\r
+ Count = (UINT16)((TotalBlock < CountMax) ? TotalBlock : CountMax);\r
ByteSize = (UINT32)Count * BlockSize;\r
\r
//\r
UINT8 WriteCmd[16];\r
EFI_STATUS Status;\r
UINT16 Count;\r
+ UINT16 CountMax;\r
UINT32 BlockSize;\r
UINT32 ByteSize;\r
UINT32 Timeout;\r
\r
BlockSize = UsbMass->BlockIoMedia.BlockSize;\r
+ CountMax = (UINT16)(USB_BOOT_MAX_CARRY_SIZE / BlockSize);\r
Status = EFI_SUCCESS;\r
\r
while (TotalBlock > 0) {\r
//\r
// Split the total blocks into smaller pieces.\r
//\r
- Count = (UINT16)((TotalBlock < USB_BOOT_IO_BLOCKS) ? TotalBlock : USB_BOOT_IO_BLOCKS);\r
+ Count = (UINT16)((TotalBlock < CountMax) ? TotalBlock : CountMax);\r
ByteSize = (UINT32)Count * BlockSize;\r
\r
//\r
#define USB_PDT_SIMPLE_DIRECT 0x0E ///< Simplified direct access device\r
\r
//\r
-// Other parameters, Max carried size is 512B * 128 = 64KB\r
+// Other parameters, Max carried size is 64KB.\r
//\r
-#define USB_BOOT_IO_BLOCKS 128\r
+#define USB_BOOT_MAX_CARRY_SIZE SIZE_64KB\r
\r
//\r
// Retry mass command times, set by experience\r