summaryrefslogtreecommitdiff
path: root/sys/scsi/scsiconf.c
AgeCommit message (Collapse)Author
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-10-01whitespace tweaksDavid Gwynne
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-09-21when we probe and find devices on the scsibus, we allocate a scsi_linkDavid Gwynne
struct for it and keep it in the midlayer. however, this struct was never free'd on detach. since we only do hotplugging of controllers (and the scsibus and devices get hotplugged as a matter of course), we now walk the list of scsi_link structs and free them on detach of scsibus. ok marco@
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-22Allocate enough, and only enough, scsi_link pointers for the number ofKenneth R Westerback
LUNs the driver says targets could have. Don't unconditionally allocate 8. USB and ATAPI devices have fewer. Fibre Channel devices can have more.
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-14Don't keep a special copy of the INQUIRY data for LUN 0 anymore. ThereKenneth R Westerback
is now a copy in the scsi_link structure so just use that one. 'looks reasonable' beck@ ok dlg@
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-11knf and ansi. no binary change.David Gwynne
2006-07-11remove an if 0 chunk thats been with us forever, but never used and neverDavid Gwynne
will be.
2006-05-13And the fallout from Manuel Pata's USB reader rumbles on ...Kenneth R Westerback
Fix the display of the device info for umass devices at lun 0 by passing the correct inquiry data to config_attach. i.e. not the inquiry data for lun 1, which we gratuitously probe to prevent USB card readers from 'helpfully' lying about who is where, but the inquiry data for lun 0 we have saved in sc_link->inqdata.
2006-05-11Zap trailing whitespace.Kenneth R Westerback
2006-01-21Invoke disk_detach() and related cleanup work in detach(), rather thanMiod Vallat
zeroref() - just to be on the safe side, should we mess up our ref count.
2006-01-18Don't index before the start of the sc_link array if scsi_probe_bus()Kenneth R Westerback
is called with a target of -1 and a valid lun. Spotted by Miod. ok miod@
2005-11-13Use SCSI_DELAY only once. Document it. Default to no delay.Kenneth R Westerback
Fixes two second system 'freeze' when umass device plugged in. Speeds up boot by not waiting for a minimum of 2 seconds at each scsi bus. ok jmc@ pedro@ deraadt@
2005-10-10Make some panic messages more useful.Kenneth R Westerback
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-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-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@.
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-05-09Remove some #ifndef __OpenBSD__/#endif sections that were intended toKenneth R Westerback
make sync'ing with NetBSD easier. NetBSD has moved on, most of these sections have not. ok marco@ deraadt@ grange@ csapuntz@
2004-05-07Set value for rslt before trying to display it. 'Bad LUN ...' messsageKenneth R Westerback
will now display correct error value. Spotted in SCSIDEBUG output from Adrian Close's bizarre USB device. ok millert@ deraadt@ marco@.
2004-05-07Remove mvme88k workaround for ssh(4) bugs.Miod Vallat
2004-04-18Restore siop's (and possibly others) ability to negotiate tags/wide/sync byKenneth R Westerback
reverting to a single (short) INQUIRY command during probe. Compensate in siop by trying PPR on all targets on SCSI-3 buses and falling back to WDTR/SDTR if PPR rejected. Problem found by mickey@. Tested on a wide variety of devices by Marco. ok marco@ deraadt@.
2004-03-10Simplify new LUN scanning logic, add diagnostic messages for allKenneth R Westerback
instances of bad LUNs and add SCSIFORCELUN_BUSES and SCSIFORCELUN_TARGETS options. ok miod@ deraadt@. Tested in the Marco Peereboom torture chamber.
2004-02-21Eliminate the quirks SDEV_NOSTARTUNIT, UMASS_QUIRK_NO_START_STOP, andKenneth R Westerback
UMASS_QUIRK_FORCE_SHORT_INQUIRY. Fixes a bunch of USB devices. Based on work by Mycroft in NetBSD. ok tdeval@ deraadt@.
2004-02-07If scsi_probe_bus() is called with a particular lun, ensure that lun 0Kenneth R Westerback
information is available to make the new lun validation logic work. i.e. don't find phantom luns just because the user asks about them. Also ensure the lun value given does not exceed the maximum valid lun for a bus, rather than assuming the maximum valid lun is 7. ok tdeval@ deraadt@.
2004-01-30Backout until we have a better implementation...Thierry Deval
2004-01-29"And you definitely don't want to use p_priority. Use PRIBIO"Thierry Deval
From art@
2004-01-29Avoid an annoying freeze during attach of live "scsibus" devices.Thierry Deval
looks ok deraadt@, mickey@, krw@ and art@(but I hate it)
2004-01-25Allow restriction of SCSIDEBUG output to particular scsi buses inKenneth R Westerback
addition to device targets and luns. ok deraadt@.
2004-01-24ugly #ifdef to be deleted laterTheo de Raadt
must still do TUR on mvme68k & mvme88k ssh(4) driver ok miod krw
2004-01-23Don't probe impossible luns. If lun 0 is non-existant, or if the device showsKenneth R Westerback
it doesn't grok luns then stop probing. Speeds up the probe of an empty scsi bus by approx. 30 seconds. From Marco Peereboom. Tested by Marco Peereboom, millert@, miod@, Diana Eichart, and a host of anonymous snapshot users. ok deraadt@.
2004-01-17Use SC_DEBUG() to display debug messages. Makes SCSIDEBUG output better.Kenneth R Westerback
ok tdeval@.
2004-01-14Nuke SDEV_NOLUNS, SDEV_FORCELUNS, and PQUIRK_FORCELUNS quirks. AlsoKenneth R Westerback
moreluns field in scsi_link structure. Instead, treat an INQUIRY result that duplicates the INQUIRY result of LUN 0 as proof the LUN does not exist. Compensate for lack of SDEV_NOLUNS where necessary by setting sc_link->luns to 1, which has the same effect. From Marco Peereboom. Don't issue Test Unit Ready command before INQUIRY command - not necessary and potentially harmful to devices with ADEV_NOTUR quirk since quirks have not been set yet. From mycroft@NetBSD ok deraadt@, mvme* changes by miod@.
2004-01-07Some code cleanup and fixes inspired by NetBSD changes from mycroft@Kenneth R Westerback
and pointed out by Nate@. Fixes some <, , > displays for devices that were not filling the INQUIRY data in correctly. Silences INQUIRY commands that fail during probe. Treats SID_QUAL_LU_OFFLINE results the same as SID_QUAL_BAD_LU. Eliminate special treatment for DEC TK30 and DEC TK50 devices. ok tdeval@.
2003-10-27atlas does indeed support tagging and only the siop was brokenMichael Shalayeff
2003-09-30quantum atlas iv 9 wls lies about tagsMichael Shalayeff
2003-05-18constify the quirck tables and fix the scsi_inqmatch() proto accordingly; ↵Michael Shalayeff
krw@ ok
2003-05-17dale's camera has a usb quirk nowNathan Binkert
2003-05-16Provide most if not all the support required for the usb changes NateKenneth R Westerback
is trying to bring in. 1) Change name of SDEV_NOCDB6 to SDEV_ONLYBIG to align it with the same quirk in NetBSD, and make it more clear what it is trying to do. i.e. force the use of READ_BIG/WRITE_BIG commands, not suppress all use of 6 byte CDB's. 2) Check SDEV_ONLYBIG in cd.c as well as sd.c. i.e. both places where a choice is made to use the 6 or 10 byte versions of READ/WRITE. 3) Actually make use of the ADEV_NOTUR (No TEST UNIT READY) quirk to suppress the emission of TEST UNIT READY commands. 4) Add some explanatory comments from NetBSD to scsiconf.h so that the use of the quirks is made clear. ok miod@ tdeval@ nate@
2002-12-30Add new parameter to scsi_test_unit_ready(): retries number.Alexander Yurchenko
Use increased retries number and don't ignore SCSI_IGNORE_NOT_READY when call scsi_test_unit_ready() for cd-rom, this makes system wait if drive is loading media. Tested by millert@ and fgsch@; some input and ok from krw@. Problem reported by The lord of the CD-writers Igor Grabin <violent@death.kiev.ua>.
2002-09-04Write sentences.Thierry Deval
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