summaryrefslogtreecommitdiff
path: root/sys/scsi/scsiconf.h
AgeCommit message (Collapse)Author
2008-06-21fgsch@ points out my last commit changed the retry limit for CD capacityKenneth R Westerback
commands. Bump limit back to the standard 4, and at the same time eliminate SDRETRIES and CDRETRIES (both defined to 4) in favour of a new define, SCSI_RETRIES, also defined to 4.
2008-06-14Nuke ADEV_NOTUR, always issue TEST UNIT READY to clear out power-upKenneth R Westerback
errors before issuing INQUIRY. Fixes Sony YE-Data floppy drive and probably other devices at the cost of possibly breaking some 10 year old CD-ROM drives. Un-special cases mvme68k which was forcing these initial TURs. Now wait for the inevitable weird USB device that breaks to surface. ok marco@ deraadt@
2008-06-13Merge show_scsi_xs() and show_scsi_cmd() and move invocation so theKenneth R Westerback
debug output shows the xs/command before it's issued rather than displaying it on command completion. Some commands don't come back and it would be nice to see their details. While here nuke invocations of scsi_show* in umass. If you want SCSI debug output use SCSI debug options. Only affects SCSI debug output. ok marco@
2007-12-29the scsi layer always had function pointers for asking the hba about aDavid Gwynne
device before issuing scsi commands to it, but it was never implemented, never used, and no hba actually filled them in. i came along and added another two function pointers for the same thing. this cleans up the extra pointers. ok krw@ marco@ miod@ deraadt@
2007-11-26let scsibus ask the adapter about a device before probing it. also allowDavid Gwynne
the adapter to be notified when a device goes away so it can free any state it maintains about that device. ok deraadt@ marco@
2007-11-25dont use the adapter_softc member of scsi_link as a softc anymore. theDavid Gwynne
"adapter_softc" is simply a way for the adapter to determine what scsibus it is now dealing with, not a pointer back to the adapters device struct. ok deraadt@ marco@
2007-06-23Implement disk sizes > 2^32-1. Code modelled on NetBSD.Kenneth R Westerback
Tested, tweaked and ok otto@
2007-05-31ckuethe found i missed a file in the workq update. my badTed Unangst
2007-05-31remove the scsi task thread, and replace it with the system workq.David Gwynne
"just :wq and do it" tedu@
2007-04-10``it's'' -> ``its'' when the grammar gods require this change.Miod Vallat
2007-04-03add a wrapper for querying vpd inquiry pagesDavid Gwynne
2006-12-12Give the SCSI layer the ability to requeue i/o's rejected by a driverKenneth R Westerback
using the new NO_CCB result. Currently a no-op since no driver produces that result. ok dlg@ marco@ deraadt@
2006-11-28give scsi controllers a real attach args to fill in when attaching scsibus.David Gwynne
ok miod@ marco@ deraadt@
2006-11-28rename scsibus_attach_args to scsi_attach_args. this can help avoidDavid Gwynne
confusing when trying to attach scsibus to a hba, since it is really meant for attaching scsi devices to scsibus. ok deraadt@ marco@
2006-11-28remove a comment that was describing a behaviour that was changed over nineDavid Gwynne
years ago.
2006-11-26no argument names in prototypes plsDavid Gwynne
2006-11-26provide scsi_detach_bus, _target, and _lun to wrap up config_detach forDavid Gwynne
scsi devices. the midlayer keeps some state for each device that is attached which needs to be cleaned up on detach, hence this wrapper.
2006-10-21rework the bus scanning code by splitting it out into separate functionsDavid Gwynne
for walking the bus and targets, and probing the luns. this removes the need to use magic numbers to wildcard each of these, which in turn makes the code a lot easier to read. as a bonus we get some more space to work in (80 chars isnt that much somtimes). note that this code wont probe high luns if lun 0 doesnt exist. ok krw@
2006-10-07make cd-roms retry forever while the device indicates that it isBob Beck
"becoming ready" - this is done in the exact same way that it was done for tape in st.c. This commit adds a cd specific interpret_sense routine to cd.c that will catch the becoming ready case and handle it. This also removes the need to use crazy timeouts to catch this case. ok krw@
2006-10-02get rid of a boolean typedef. this is c, we have ints, deal with it.David Gwynne
ok marco@ krw@
2006-09-22implement a kernel thread that can be used by the midlayer or scsi driversDavid Gwynne
when they need a process context to do something. the most obvious task that springs to mind is attaches and detaches of devices on scsibus. ok krw@ marco@ deraadt@
2006-07-29The version field of scsi_inquiry_data is not a simple numeric valueKenneth R Westerback
that specifies the version of SCSI being supported. Even the ANSI part that we use is complex. 4 means 2, 5 means 3 and 6 means 4. Translate and use the value correctly. Fixes SCSI5 and SCSI6 in dmesg. And properly protects SCSI2 devices from getting SCSI3 commands. "seems like an elegant solution to me" millert@ ok dlg@ marco@
2006-07-23Use REPORT LUNS to get the list of LUNs to probe. If such a list isKenneth R Westerback
obtained probe the LUNs given without checking for duplicate INQUIRY data. For non-USB, non-ATAPI, devices claiming to be SCSI-3 compliant. And the target must have something attached at LUN 0. If REPORT LUNS can't be used or isn't supported, the old scan process is used. Fixes Fibre Channel and SCSI enclosure devices that provide identical INQUIRY data for all LUNs and were thus being misprobed as having only LUN 0. Tested by Bob Kitella, dlg@, beck@. Suggestions from deraadt@. ok dlg@ beck@
2006-07-22Nuke SCSIFORCELUN* and friends. These were introduced as a safetyKenneth R Westerback
valve in case our duplicate LUN checks had to be circumvented. Since no one has found a need for them, and they were just one more place trying to shift a bit 255 places to the left could be induced, remove them. "i don't think any options like that are worthwhile" deraadt@
2006-07-13Eliminate scsi_link field 'scsi_version' and just use the INQUIRY dataKenneth R Westerback
stored in scsi_link. That's where the value came from anyway. Move 'luns' field to where 'scsi_version' used to be to preserve alignment. ok dlg@
2006-07-11the scsi_link structure contained a copy of the inquiry flags and the wholeDavid Gwynne
inquiry. this removes the flags member and makes all its users refer to the whole inquiry now. ok miod@ krw@
2006-07-06add a flag to sc_link to be used by a hba to mark the target as virtual.David Gwynne
grudging ok from deraadt@ so i can move forward. this should be revisited one day though.
2006-06-20pack wwn fields into struct better; ok marco krwTheo de Raadt
2006-05-31add a place to store the PortWWN and NodeWWN for fibre channel stuffs.Jason Wright
2006-05-11Zap trailing whitespace.Kenneth R Westerback
2005-12-02Remove one tab that cause a line to overflow. No functional change.Marco Peereboom
2005-11-13Use scsi_delay() instead of delay() when waiting for scsi disk toKenneth R Westerback
become ready. Make verbiage SC_DEBUG(). ok dlg@
2005-09-11Simplify code by changing struct scsi_mode_sense_buf{ union {}Kenneth R Westerback
headers; } to just union scsi_mode_sense_buf {}. No functional change. ok marco@
2005-06-24Fix botch introduced in r1.12. reduced_geometry.sectors is a 5 byteKenneth R Westerback
field, with reduced_geometry.sectors[0] not being sectors/track. Add _5btol() to correctly parse entire field. From NetBSD.
2005-06-23Don't discard the blocksize information provided by the READ CAPACITYKenneth R Westerback
command. Return it in a new parameter to scsi_size.
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-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-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-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-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-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-06De-register scsi.Kenneth R Westerback
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@
2004-11-30No longer require write permission for read-only SCSI commandsKenneth R Westerback
submitted via ioctl. Eliminate scsi_do_safeioctl(), thus permitting ch, ss and st devices to submit SCSI commands. Return EPERM rather than EBADF when permissions are inadequate. Allows more programs to run with fewer permissions. Problem diagnosed by Nikolay Sturm in mplayer port. Tested by Nikolay, ok deraadt@.
2004-07-31Remove scsi_change_def() and related command structure. Its only useKenneth R Westerback
in the tree is #ifdef'd out and is fundamentally wrong anyway - it tries to force *all* devices to SCSI-2. Also recent SCSI specs seem to have marked the command as obsolete. Bonus - eliminates another undocumented option (SCSI_2_DEF). Found in a list of unused kernel functions posted to tech-kern@netbsd by Krister Walfridsson in 2002. ok marco@ tdeval@
2004-06-22Add additional retries in TUR to allow for tape devices to settle after a reset.Marco Peereboom
More informative failure message and silence "already open" message. ok krw@
2004-05-17Elminate SCSIRET_* synonyms for EJUSTRETURN and ERESTART by usingKenneth R Westerback
EJUSTRETURN and ERESTART instead. Delete unused SCSIRET_RETRY define. From NetBSD. ok marco@
2004-05-09Eliminate verbosity parameter to scsi_print_sense and the associatedKenneth R Westerback
chunk of code. It was never executed unless you were debugging a mvmex8k 'vs' device. ok miod@ (mvmex8k bits) marco@ deraadt@