summaryrefslogtreecommitdiff
path: root/sys/scsi
AgeCommit message (Collapse)Author
2005-06-05Fix scsi_mode_select() and scsi_mode_select_big() to send just theKenneth R Westerback
required number of bytes, rather than a full scsi_mode_sense_buf. Some devices (e.g. my HP SureStore DAT/24) decline to accept such oversized transfers. Instead, force callers to fill in the data_length field in the header and use that information to set the size of the transfer.
2005-06-05Revert ss_mustek use of new scsi_mode_select(). Further developmentKenneth R Westerback
revealed it is doing it's own weird stuff not reproduced in new functions. e.g. it doesn't use mode sense headers. Rather than try to fix it or figure it out at this time ...
2005-06-04Make scsi_do_mode_sense() aware of the difference between the 8 byteKenneth R Westerback
general block descriptor and the 8 byte direct block descriptor, and return the correct values for density, block_count and block_size based on the type of the device. First cut has T_SEQUENTIAL (i.e. tape devices) as the only device type using general block descriptors, so the behaviour change is minimal.
2005-06-03No longer used.Kenneth R Westerback
2005-06-03Move definitions of struct cd_softc{} and CDRETRIES from cdvar.h intoKenneth R Westerback
cd.h. Remove include of cdvar.h from cd.c. cdvar.h becomes expendable. No functional change.
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-06-03Cache a copy of the INQUIRY data obtained during device attachment inKenneth R Westerback
the scsi_link structure. This is a more general solution than the current inconsistant copying of fields into _softc structures. The redundant fields in _softc's will be cleaned up later. The device field will be used immediately to finish up the new mode sense code. ok marco@
2005-06-02Fix pasto - use correct pointer to extract block count from 8 byteKenneth R Westerback
block descriptors. Not that we actually use this information anywhere.
2005-05-31Remove unused sc_err1() parameter 'async'. Lint.Kenneth R Westerback
2005-05-28Sprinkle some /* FALLTHROUGH */'s as suggested by lint.Kenneth R Westerback
2005-05-28'openings' is u_int16_t, so 'openings <= 0' is wrong. Lint.Kenneth R Westerback
2005-05-28Forgot to specify parameter type. Lint.Kenneth R Westerback
2005-05-28snprintf returns int not size_t. Thank you lint.Kenneth R Westerback
2005-05-28Kill extra semi-colon. Amazing what lint can find ...Kenneth R Westerback
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-28Handle XS_SHORTSENSE error codes in ioctl situations. From NetBSD.Kenneth R Westerback
Fixes spurious error messages from cdparanoia when using ATAPI CDROM in USB enclosure. ok pascoe@.
2005-05-27Don't bother issuing a MODE SELECT in cd_set_pa_immed() if we aren'tKenneth R Westerback
going to change anything. From NetBSD. Fixes playing music cd in ATAPI drive in USB enclosure pascoe@ is using. ok pascoe@.
2005-05-27No longer used after merge of atapi/scsi cd code.Kenneth R Westerback
2005-05-27Convert cd code to new mode sense framework. Merge cd_scsi andKenneth R Westerback
cd_atapi into cd since code is now almost identical, and only affects volume adjusting ioctl's. Minor side effect of allowing cd_load_unload() attempts to scsi cd's as NetBSD does.
2005-05-27Reduce size of scsi_mode_sense_buf to 255 characters from 256. FixesKenneth R Westerback
Lexar Jumpdrive and probably others. Use better structure declaration idiom, as suggested by drahn@.
2005-05-26Use new mode sense mechanism for atapi disks. Make sure that fakeKenneth R Westerback
geometry is set even if (as for some USB devices) the MODE SENSE works but zero values are returned for cylinders/heads/sectors. This fixes my USB floppy which returns 0/0/0.
2005-05-25With PQUIK_NOMODESENSE gone, SDEV_NOMODESENSE can go too.Kenneth R Westerback
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-23Remove superfluous and confusing define and use correct field namesKenneth R Westerback
instead.
2005-05-23Don't bzero() data before calling scsi_mode_sense[_big]() sinceKenneth R Westerback
scsi_mode_sense[_big] bzero()'s it.
2005-05-23Remove more superfluous structures, etc. No functional change.Kenneth R Westerback
2005-05-22Remove some superfluous structures, etc. No functional change.Kenneth R Westerback
2005-05-22Check if the scsi_request has been released in the COMPLETE case asKenneth R Westerback
was already done in the SUCCESSFULLY_QUEUED case. Shouldn't happen, but better safe than sorry if some driver completes it's io immediately. Also don't recompute saved flags if the request is retried. ok marco@
2005-05-14Unused after last scsi commit.Kenneth R Westerback
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-05-03sdstrategy() shouldn't use values in disklabel until SDEV_MEDIA_LOADEDKenneth R Westerback
is checked. Fixes crash during boot when a device has no media loaded. e.g. a usb card reader with empty slots. From NetBSD. Problem was introduced by last commit to allow RAW_PART+S_IFCHAR opens to always succeed. ok millert@ marco@
2005-05-01Allow RAW_PART+S_IFCHR device opens to succeed even if media notKenneth R Westerback
present. A successful open is required for ioctl's to work. Mostly from NetBSD, partly correcting previous code cleanup error. From deraadt@, treat MTIOCTOP+MTRETEN as CDIOCCLOSE for cd devices (i.e. close the cd drawer). ok deraadt@.
2005-04-28more snprintf error checking. ok krw@Moritz Jodeit
2005-04-28Some really braindead usb devices such as x-in-1 card reader/writersKenneth R Westerback
try to help equally braindead os's by presenting any inserted media as LUN 0 until another LUN is used in a command. Trick them by issuing a gratuitous/harmless INQUIRY to LUN 1 after issuing the LUN 0 INQUIRY but before any other command. Only umass scsi devices with >1 lun are affected. Fixes dlg's reader/writer for one. Lots of diagnosis and testing by dlg@, ok dlg@, ok marco@.
2005-04-27Add SDEV_UMASS flag, analogous to SDEV_ATAPI, and use it to force aKenneth R Westerback
full LUN scan on UMASS SCSI targets. UMASS provides reliable max lun information so we shouldn't waste time. Fixes many x-in-1 card reader/writers that report identical INQUIRY information for every slot they provide. Lots of diagnosis and testing by dlg@, ok dlg@, 'I can live with this' marco@.
2005-04-17Fix typoTom Cosgrove
ok krw@
2005-04-16Nuke another unused structure.Kenneth R Westerback
2005-04-16Nuke unused/duplicate structures and defines in favour of scsi ones.Kenneth R Westerback
ok miod@
2005-04-12Add last pieces of ses crud to enable blink functionality.Marco Peereboom
This file is still a work in progress.
2005-04-09Add page 1 (configuration page) definitions. This is required to interpretMarco Peereboom
page 2 (enclosure control page).
2005-04-06Remove ses crud.Marco Peereboom
Requested and ok mickey@
2005-04-06Move ses crud into its own file.Marco Peereboom
Requested mickey@
2005-04-06Add status/receive ses structures and #defines.Marco Peereboom
2005-04-06De-register scsi.Kenneth R Westerback
2005-04-06Add control/send structures.Marco Peereboom
ok krw@
2005-04-06Remove obsolete file.Kenneth R Westerback
ok deraadt@ tdeval@ henning@ marco@
2005-04-06Add RECEIVE_DIAGNOSTIC & SEND_DIAGNOSTIC #defines for SES.Marco Peereboom
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@