summaryrefslogtreecommitdiff
path: root/sys/scsi/sd_scsi.c
AgeCommit message (Collapse)Author
2005-06-03Tweak scsi_do_mode_sense(). NetBSD was right and I was wrong. Sigh.Kenneth R Westerback
Add 'big' parameter to report which mode sense header type is being returned. Eliminate icky pointer arithmetic, since it won't work if only block descriptors are returned by the device. No functional change.
2005-05-28Add _lto8b() and _8btol() to decode nblocks field ofKenneth R Westerback
scsi_mode_blk_desc_big. Will be needed to move st to new mode sense function. Be a bit more careful with types of parameters to scsi_do_mode_sense, using u_int32_t instead of int. No functional change.
2005-05-25Introduce safer, more general mode sense capability. Transparently useKenneth R Westerback
both 10 byte and 6 byte MODE SENSE commands and just return error checked values. Convert sd_scsi.c to use new mechanism for non-optical drives. USB umass devices will now display actual mode sense info if it is available via a 10 byte MODE SENSE. Which may mean 0 heads, etc. is shown until cosmetics are finalized. ok marco@ 'that is pretty cool' deraadt@
2005-05-24When processing the flex_geometry page, don't use a reduced_geometryKenneth R Westerback
field to get the blocksize. ok marco@
2005-05-23Don't bzero() data before calling scsi_mode_sense[_big]() sinceKenneth R Westerback
scsi_mode_sense[_big] bzero()'s it.
2005-05-14Add scsi_mode_[sense|select]_big() and use it instead ofKenneth R Westerback
atapi_mode_[sense|select](). This will allow the removal of atapi_base.c and atapi_all.h files, and sets the stage for better usb mode sense handling amoung other things. Remove cd_scsibus_[get|set]_mode() and sd_scsibus_mode_sense() shims in favour of scsi_mode_[sense|select](). Add zero'ing of reserved length field in scsi_mode_select(). Change some uchar * type parameters to scsi_mode_header *. No functional changes. Mostly from NetBSD. ok dlg@.
2005-05-07Eliminate 'mode sense (n) returned nonsense' and 'could not mode senseKenneth R Westerback
(4/5)' messages in favour of a single SC_DEBUG() message about the mode sense error. Less useless verbiage. As this eliminates the only SDEV_NOMODESENSE use in scsi/*, eliminate all quirks table entries that used only SDEV_NOMODESENSE. Iomega Zip tested by miod@ to ensure this did not break something. Finally, only fake a geometry if scsi_size() can determine a disk size to fake from.
2005-04-05Factor out scsi_mode_sense() and scsi_mode_select() like NetBSD does.Kenneth R Westerback
Eliminate some duplicate structures and defines along the way. SCSI CD drives will now pay attention to the 'flags' parameter for MODE SENSE and MODE SELECT commands. No other functional change. ok tdeval@
2003-06-25Avoid a divide by zero byKenneth R Westerback
1) Ensuring that both sd_scsi.c and sd_atapi.c report a device as offline when its disksize cannot be determined. 2) Ensuring blksize is always non-zero, with a default value of 512. 3) Eliminating a couple of unneeded 'sectors' variables, which makes the code easier for me to read if nothing else. The bug was introduced when sd_atapi.c was changed to allow 'incomplete' implementations to be reported as online. REALLY incomplete implementations (i.e. not even the disksize can be determined) would be reported online with a blksize of zero. Also fix a couple of knf nits in Mickey's last commit, and add another check for an rpm of 0. ok (pre-Mickey diffs) tdeval@ marc@ frantzen@
2003-06-24try to devise drive's rpm and default to 3600 should we fail miserably.Michael Shalayeff
derived from pr2815 from Marco Peereboom krw@ deraadt@ ok
2002-09-04Add support for RBC (simplified direct) devices.Thierry Deval
ok costa@, krw@
2002-03-14First round of __P removal in sysTodd C. Miller
2000-08-05remove staticsNiklas Hallqvist
1999-07-25Merge sd stuff from NetBSD-current. Helps with LS-120, ZIPConstantine Sapuntzakis
More SCSI logic from NetBSD-current Some tape fixes. ATAPI tapes do not work yet for most operations.