Commit Graph

8 Commits

Author SHA1 Message Date
mycroft e873dbd7ad If READ CAPACITY fails, try a READ FORMAT CAPACITIES. Separate this into
another function, always doing a page 0 MODE SENSE to get the block
descriptor if we use READ CAPACITY, and use SMS_DBD on the page 4/5 MODE
SENSE.  This does one extra command in some cases, but it separates and
simplifies the code a little.

Why do we prefer READ CAPACITY over READ FORMAT CAPACITIES?  Two reasons:
1) It's much older and is much less likely to have had its command code
abused, and is thus "safer" to try first.  2) ALL of my USB flash readers
and pen drives screw up their capacity descriptors -- mostly off-by-one
errors in the size (they return the maximum LBA number instead, a la READ
CAPACITY, which has *never* been how READ FORMAT CAPACITIES was documented
in the MMC spec), and one returns the "no media" code on slots that have
media inserted (despite returning almost-correct data otherwise)!

F*** me with a chainsaw.
2003-09-17 23:33:43 +00:00
matt 5d09a84558 Add multiple inclusion protection. 2003-01-06 21:02:18 +00:00
soren eefc317219 Remove duplicate struct scsipi_start_stop. 2001-11-19 17:18:08 +00:00
thorpej dda09e1b39 Add the Force Unit Access and Disable Page Out bits to the
READ(10) and WRITE(10) commands.
2001-09-02 20:17:04 +00:00
enami d0ad49a001 Backout previous change, and rather, remove all protection but the one
actually currently required.  Suggested by Charles M. Hannum.
1998-02-13 08:28:16 +00:00
enami ef09ae656f Fix or add protection for mutiple inclusion. 1998-02-13 04:19:13 +00:00
enami d7d845c3d2 Cosmetic changes to keep coding style consistency in this directory;
- Indent with tab of width 8.
- Use four column to indent continuation line.
- Fold long line if possible.
- Use return (xx) instead of return xx.
- Compare pointer against NULL instead of testing like boolean.
- Delete whitespace at the end of line.
- Delete whitespace in front of function call operator.
- Delete whitespace after cast.
- Dereference a pointer to function explicitly.
- Add an empty line after local variable declaration.
- Use NULL instead of (char *)0.
- Dont use block for single statement.
1997-10-01 01:18:38 +00:00
bouyer 6f3bab1f59 Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
1997-08-27 11:22:52 +00:00