On Mon, 2003-03-24 at 01:04, Matthew Dharm wrote: > Well, here's my list of what the 'popular OS' uses for all devices: > > INQUIRY (for only 36 bytes -- nothing else!) > TEST_UNIT_READY > REQUEST_SENSE > ALLOW_MEDIUM_REMOVAL (mostly for eject purposes) > > For disk-like media: > > READ_10 > WRITE_10
We do about the best we can for read and write. For sd, we gauge the size of the command from the size of the medium: <1Gb=> six byte, from 1Gb to 2Tb 10 byte, over 2Tb 16 byte, so I think this should all be fine. > I'd have to go back to my notes for tape and CD media. But those aren't my > biggest problem areas -- the common probe and the disk driver are my > biggest headaches. > > Note that MODE_SENSE isn't on this list. How does the 'popular OS' test > for write-protect, you ask? It tries to write and then looks for a > failure, AFAICT. We use MODE_SENSE on CDs to probe for capabilities: this is required behaviour and we've been doing for a long time. sd also uses MODE_SENSE to probe the cache type as well as the write protect state. Cache type certainly can't be obtained any other way, and I'm not sure allowing writes to read only media wouldn't cause us more problems in the long run. > I'd be willing to write a helper, but I'm a bit out of my element here... > can someone at least suggest a good place to put such a helper (or > volunteer to mock one up for me)? OK, I can do this: A simple one with either a blacklist (reject these commands) or whitelist (only accept these commands) going by the first command byte OK? James ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel