Information Technology Reference
In-Depth Information
The MSDRequestSenseHandler function copies data from the gblSense-
Data array into msd_buffer for returning to the host. The function also sets
values in the CSW.
void MSDRequestSenseHandler(void)
{
byte i;
for (i = 0; i < sizeof(RequestSenseResponse); i++)
msd_buffer[i] = gblSenseData._byte[i];
msd_csw.dCSWDataResidue = sizeof(RequestSenseResponse);
msd_csw.bCSWStatus = 0x0; // success
return;
}
SEND DIAGNOSTIC
The SEND DIAGNOSTIC command requests the device to test itself, a
logical unit, or both. For SBC devices, support for a default, vendor-specific
self test is mandatory. The host requests the default test by setting SELF-
TEST = 1, SELF-TEST CODE = zero, and PARAMETER LIST
LENGTH = zero. On receiving the command, a device begins the self test
in the background (without using bus bandwidth). On completion of the
test, the device returns a CSW with status information.
While a background test is in progress, on receiving most commands, the
device should suspend testing within two seconds and respond to the com-
mand. SBC devices don't need to service FORMAT UNIT or START
STOP UNIT commands while self-testing. To terminate testing, a host can
issue a SEND DIAGNOSTIC command with SELF-TEST CODE = 100b.
Hosts rarely use this command. Some devices support the command by
returning success immediately, without performing a test.
TEST UNIT READY
The host issues a TEST UNIT READY command to find out if a storage
device is ready for use. The command has no data-transport phase. If the
media isn't ready, the device updates its sense data and returns a CSW with
the bCSWStatus field set to 01h to indicate that the command failed. The
host can then request sense data by issuing a REQUEST SENSE command.
All SBC devices must support this command.
Search WWH ::




Custom Search