summaryrefslogtreecommitdiff
path: root/sys/scsi
AgeCommit message (Collapse)Author
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-14Last pre-3.5 tweak: restore bus scanning to full speed by not performingKenneth R Westerback
double INQURY commands on LUNs that will be skipped anyway. From Marco Peereboom. ok 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-21Fix a race. scsi_done() can free a scsi_xfer, so relying on the valuesKenneth R Westerback
of fields in the scsi_xfer after scsi_done() could have been called is bad. cdrecord can now safely burn cd's at high speeds. Found by grange@, original diff by costa@, cleaned up by grange@ and further polished by me following input from deraadt@. ok grange@ costa@ deraadt@.
2004-02-17bzero scsi_xfer's as they come out of the pool to ensure there is noKenneth R Westerback
leakage from one use to the next. There is no such thing as too much paranoia. ok deraadt@.
2004-02-15new arg to disk_unbusy, to record separate read/write statistics.Ted Unangst
looked at by various, testing henning@ mcbride@ dan weeks mostly from netbsd via Pedro Martelletto <pbastos@rdc.puc-rio.br>
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-25Be less verbose in sdattach() by suppressing the display of detailedKenneth R Westerback
sense information when attempting to discover the disk size. USB 6-in-1 readers have a bunch of LUNs and otherwise produce many 'Medium Not Present' details everytime they are plugged in. Noticed by grange@. Requested by and ok deraadt@.
2004-01-25Use %lu to print u_long values, not %d or %ld. Fixes display ofKenneth R Westerback
negative number of sectors for very large (i.e. RAID) disks. Noticed by Marco Peereboom. ok deraadt@.
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-16Remove this farce.Miod Vallat
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-10Print sense info only for valid key; from NetBSD.Alexander Yurchenko
ok tdeval@ krw@
2004-01-08More sense message improvements from Marco Peereboom.Kenneth R Westerback
Clarify some logic and make type usage more consistant. ok tdeval@.
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@.
2004-01-05Don't issue PREVENT_ALLOW commands to disk devices during sdopen() orKenneth R Westerback
sdclose() unless they identified themselves as removable. ok deraadt@.
2004-01-04Rewrite scsi_decode_sense() to clean up code; eliminate many magicKenneth R Westerback
numbers; fix passing a NULL to %s under some circumstances; fix the bit index mask; etc. No change in output. ok deraadt@.
2004-01-03put an mi wrapper around stdarg.h/varargs.h. gcc3 moved stdarg/varargs macrosMarc Espie
to built-ins, so eventually we will have one version of these files. Special adjustments for the kernel to cope: machine/stdarg.h -> sys/stdarg.h and machine/ansi.h needs to have a _BSD_VA_LIST_ for syslog* prototypes. okay millert@, drahn@, miod@.
2004-01-03Make 'unknown error category' message more informative by including errorKenneth R Westerback
number. Same change as was made to scsi_base.c a few days ago. ok deraadt@.
2004-01-02Treat all commands returning a sense data ASC of 0x29 as havingKenneth R Westerback
suffered a reset condition. Newer devices return a variety of ASCQ values now (0x00 -> 0x07) rather than just 0x00. Such commands will now be retried rather than returning EIO. Started off when Marco Peereboom's SCSI analyzer saw some ASC/ASCQ results of 0x29/0x02. ok miod@.
2004-01-02Add in missing ASC/ASCQ descriptions for non-RAMDISK (i.e.Kenneth R Westerback
non-SCSITERSE) kernels. Brings the list up to SCSI-3. From Marco Peereboom (marco at peereboom dot us). ok deraadt@.
2003-12-24Make error message more informative by showing bad value that causedKenneth R Westerback
the error to be emitted. ok miod@.
2003-11-07adress -> address, and a few more; all from Jonathon Gray;Jason McIntyre
(mvme68k/mvme88k) vs.c and (vax) if_le.c ok miod@ isakmpd ones ok ho@
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-09-26Typos: defintion -> definition, proccess -> processMiod Vallat
There are more occurences hiding in binutils, lynx and afs but I am too lazy to report them upstream at the moment.
2003-08-06Remove some double semicolons (hmm, do two semis equal a maxi?).Todd C. Miller
I've skipped the GNU stuff for now. From Patrick Latifi.
2003-07-30reverse booleans so it's clear what we're looking for. ok krw@Ted Unangst
2003-06-26Simplify code a bit by eliminating a few early returns in the senseKenneth R Westerback
key case statement and let the common code after the case do the right thing. Return EINVAL for sense key SKEY_ILLEGAL_REQUEST whether SCSI_SILENT is set or not. ok tdeval@ nate@
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
2003-05-21Make sure that the first scsi command issued to a device duringKenneth R Westerback
sdattach() has the flag SCSI_IGNORE_MEDIA_CHANGE set. This was not true for devices with the quirk SDEV_NOSTARTUNIT, such as some umass devices. This fixes the display of the disk parameters for any loaded media. Previously the displayed parameters would show 0 size, 0 sectors and a faked number of cylinders, etc. By ignoring the error generated by devices trying to tell us the media may have changed since the last command the SCSI command completes correctly and valid values are obtained/displayed. We are interested in the current values and unconcerned about any previous ones. Tested by drahn@.
2003-05-18constify the quirck tables and fix the scsi_inqmatch() proto accordingly; ↵Michael Shalayeff
krw@ ok
2003-05-17READ_CD_CAPCITY -> READ_CD_CAPACITY in comment.Kenneth R Westerback
2003-05-17paramters -> parameters in comment.Kenneth R Westerback
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@
2003-05-13Don't report devices with incomplete implementations as OFFLINE.Kenneth R Westerback
Fixes frantzen@'s pentax digital camera. Suggested by Costa. ok csapuntz@ frantzen@.
2003-05-06String fixes. Scsi now strcpy/strcat/sprintf/strncat free. SomeKenneth R Westerback
strncpy still present for manipulating d_packname/d_typename. ok deraadt@.
2003-05-06sprintf -> snprintf. strncpy -> bcopy since d_packname is not really aKenneth R Westerback
string. Ensure that all of d_packname is used by not null-terminating string that is put in it. Suggestions and motivation to remove strncpy() from deraadt@. ok deraadt@ tedu@.
2003-05-03sprintf -> snprintf.Kenneth R Westerback
Almost identical to a previously submitted diff from tedu@. ok tedu@ tdeval@
2003-04-06The disklabel fields d_packname and d_typename are not null terminated stringsKenneth R Westerback
and should not be created or used as such. This fixes some instances of both behaviours, and sets the stage for some strcpy -> strncpy fixup. ok tdeval@ millert@ deraadt@
2003-03-28OCHIO* dies horrible death by dd; as per renaming done beforeMichael Shalayeff