Add extra tests to the MassStorage device demo and class driver for validating command blocks from the host.

This commit is contained in:
Dean Camera 2009-07-21 04:46:48 +00:00
parent 67f390fe74
commit d0db78432f
2 changed files with 4 additions and 0 deletions

View file

@ -256,6 +256,8 @@ static bool ReadInCommandBlock(void)
/* Verify the command block - abort if invalid */
if ((CommandBlock.Signature != CBW_SIGNATURE) ||
(CommandBlock.LUN >= TOTAL_LUNS) ||
(CommandBlock.Flags & 0x1F) ||
(CommandBlock.SCSICommandLength == 0) ||
(CommandBlock.SCSICommandLength > MAX_SCSI_COMMAND_LENGTH))
{
/* Stall both data pipes until reset by host */