Information Technology Reference
In-Depth Information
Table 6-5: The data-transport phase in a MODE SENSE(6) command begins
with this header.
Byte
Description
0
MODE DATA LENGTH. The number of bytes that follow.
1
MEDIUM TYPE. 00h for SBC devices.
2
DEVICE-SPECIFIC PARAMETER. For SBC devices:
bit 7: WP. Set to 1 if the media is write-protected.
bits 6..4: reserved
bit 4: DPOFUA. Set to 1 if the device supports the DPO and FUA bits (used in caching)
bits 3..0: reserved
3
BLOCK DESCRIPTOR LENGTH. The length in bytes of all block descriptors in the
mode parameter list.
The MSDModeSenseHandler function prepares a response to a MODE
SENSE(6) command, writing data to return into msd_buffer and setting
fields in the command's CSW:
void MSDModeSenseHandler()
{
// Set values to return, from SPC spec, section 7.4.3 and SBC spec, section 6.3.1.
msd_buffer[0] = 0x03; // The number of bytes that follow.
msd_buffer[1] = 0x00; // The media type is SBC.
msd_buffer[2] = 0x00; // Not write-protected, no cache-control-bit support.
msd_buffer[3] = 0x00; // No mode-parameter block descriptors.
msd_csw.bCSWStatus=0x0;
msd_csw.dCSWDataResidue=0x04;
return;
}
PREVENT ALLOW MEDIUM REMOVAL
The PREVENT ALLOW MEDIUM REMOVAL command requests the
device to prevent or allow users to remove the storage media from the
device. A 2-bit PREVENT field in the command is set to 00b to allow
media removal or 01b to prohibit removal. The command has no
data-transport phase. Support for this command is optional. Of course,
many devices have non-removable media or use flash-memory cards or other
media with no mechanism to prevent removal.
Search WWH ::




Custom Search