Tech Support > Microsoft Windows > Drivers > Limiting read/write transfer lengths for a storage device
Limiting read/write transfer lengths for a storage device
Posted by Brian Anderson on August 17th, 2007


Greetings,

I've created a USB mass storage device that implements the commands
defined in SBC-2. For this particular device it is desirable that only a
single block is read or written at a time. That is, in the READ/WRITE
CDBs, the transfer length field should always be set to 1. As I read the
spec, the obvious way to do this is with VPD page B0h, but this page
doesn't seem to be requested by the driver.

A lower storage filter driver implements some device-specific
functionality. At the moment my strategy for limiting the transfer length
is to intercept READ10 and WRITE10 SRBs, create a new SRB and IRP for
each block requested, then complete the original IRP, but this doesn't
strike me as the correct solution. I've read that miniport drivers are
responsible for limiting DMA request sizes, but that doesn't seem to
apply to my problem.

If anybody could give me some direction on the correct way to go about
this, I would be grateful. I'm new to USB, SCSI and device driver
programming, so any corrections to my understanding of the issues is
welcome.

Regards,
Brian