Information Technology Reference
In-Depth Information
VERIFY
The VERIFY command requests the device to test one or more sectors. If
the BYTCHK bit in the command block equals zero, the device should
attempt to read from the specified locations. If BYTCHK = 1, the host
sends data in the data-transport phase, and the device should verify that the
received data matches what is stored in the device. If the media uses
error-checking protection information as specified in the response to an
INQUIRY command, the verify operation checks this information as well.
There are four VERIFY commands: VERIFY(10), VERIFY(12), VER-
IFY(16), and VERIFY(32). The commands vary in the size of the fields in
the command block. The VERIFY(32) command block also contains addi-
tional fields. Support for this command is optional for SBC devices.
WRITE
The WRITE commands are the complements of the READ commands.
The host issues a WRITE command to request to write a block of data to
the device. In the command block, the LOGICAL BLOCK ADDRESS
field specifies the LBA of the first block to write to, and the TRANSFER
LENGTH field contains the number of blocks to write.
There are five WRITE commands: WRITE(6), WRITE(10), WRITE(12),
WRITE(16), and WRITE(32). The commands vary in the sizes of the logi-
cal-block-address and transfer-length fields and in the quantity and type of
status and control information included in the command block. WRITE(6)
and WRITE(10) are mandatory for SBC devices (except of course for
read-only media). The specification recommends migrating all code from
WRITE(6) to WRITE(10), but a host might still attempt to use
WRITE(6). The Windows USB mass-storage driver uses WRITE(10).
After receiving a WRITE(10) command block, a device should receive the
data to write in the data-transport phase and should write the received data
to the specified locations in the storage media. The device doesn't have to
know or care what is in the received blocks. All the device needs is a block
number and data to write to the block.
The MSDWriteHandler function gets the LBA and number of blocks to
write from the CBW in a WRITE(10) command. The function then calls
Search WWH ::




Custom Search