summaryrefslogtreecommitdiffstats
path: root/sys/cam/scsi
Commit message (Collapse)AuthorAgeFilesLines
* Add a quirk entry for ARCHIVE Python 06408.non2001-06-011-0/+4
| | | | Approved by: mjacob
* Print out the asc/ascq and description even when both the asc and ascqken2001-05-271-4/+2
| | | | | are zero. This is so that users will see the "no addtional sense" printout and know that they have the full sense information.
* Exploit recent improvements in the disk minilayer to simplify errorphk2001-05-085-75/+39
| | | | | | | | handling a bit. Dogmatic lingupurists can celebrate that a number of gotos got removed. Reviewed by: mjacob, ken
* Actually biofinish(struct bio *, struct devstat *, int error) is more generalphk2001-05-064-32/+12
| | | | | | than the bioerror(). Most of this patch is generated by scripts.
* Add q quirk for the old SONY SMO drive i've been sitting upon in myjoerg2001-05-051-0/+16
| | | | | private tree for too long now. This (pre SCSI-2) drive returns a mystic code when the medium is inserted but not spun up.
* Fix up unit attention and selection timeout handling in various peripheralken2001-05-013-14/+8
| | | | | | | | | | | | drivers. - change daprevent() to set CAM_RETRY_SELTO and SF_RETRY_UA when it calls cam_periph_runccb(). - change the pt(4) driver to ignore unit attentions - change the targ(4) driver to retry selection timeouts - clean up a few formatting glitches in the targ(4) driver Reviewed by: gibbs
* Add sense key table entries for DATA PROTECT and BLANK CHECK. This willken2001-04-301-0/+2
| | | | | | | prevent scsi_sense_desc() from deferencing a NULL pointer when a drive happens to return one of these sense keys. Reported by: Michael Samuel <michael@miknet.net>
* Fix an errant search and replace that broke SCSI start unit commands.ken2001-04-301-1/+1
| | | | This should fix automatic spinups as well as 'camcontrol start'.
* Fix the `tape drive spinning indefinately upon mt stat' problem.joerg2001-04-221-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the recent changes in the CAM error handling, some problems in the error handling of sa(4) have been uncovered. Basically, a number of conditions that are not actually errors have been mistreated as genuine errors. In particular: . Trying to read in variable length mode with a mismatched blocksize between the on-tape (virtual) blocks and the read(2) supplied buffer size, causing an ILI SCSI condition, have caused an attempt to retry the supposedly `errored' transfer, causing the tape to be read continuously until it eventually hit EOM. Since by default any simple mt(1) operation does an initial test read, an `mt stat' was sufficient to trigger this bug. Note that it's Justin's opinion that treating a NO SENSE as an EIO is another bug in CAM. I feel not authorized to fix cam_periph.c without another confirmation that i'm on the right track, however. . Hitting a filemark caused the read(2) syscall to return EIO, instead of returning a `short read'. Note that the current fix only solves this problem in variable length mode. Fixed length mode uses a different code path, and since i didn't grok all the intentions behind that handling, i did not touch it (IOW: it's still broken, and you get an EIO upon hitting a filemark). The solution is to keep track of those conditions inside saerror(), and upon completion to not call cam_periph_error() in that case. We need to make sure that the device gets unfrozen if needed though (in case of actual errors, cam_periph_error() does this on our behalf). Not objected by: mjacob (who currently doesn't have the time to review the patch)
* Last commit was broken.. It always prints '[CTRL-C to abort]'.ps2001-03-281-16/+3
| | | | | | | Move duplicate code for printing the status of the dump and checking for abort into a separate function. Pointy hat to: me
* Change the dump routines to only abort if control-c is pressed.ps2001-03-271-1/+3
| | | | | | | If any other key is pressed, print a message stating that control-c is how to abort. Reviewed by: peter
* Rewrite of the CAM error recovery code.ken2001-03-2710-1369/+1074
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the major changes include: - The SCSI error handling portion of cam_periph_error() has been broken out into a number of subfunctions to better modularize the code that handles the hierarchy of SCSI errors. As a result, the code is now much easier to read. - String handling and error printing has been significantly revamped. We now use sbufs to do string formatting instead of using printfs (for the kernel) and snprintf/strncat (for userland) as before. There is a new catchall error printing routine, cam_error_print() and its string-based counterpart, cam_error_string() that allow the kernel and userland applications to pass in a CCB and have errors printed out properly, whether or not they're SCSI errors. Among other things, this helped eliminate a fair amount of duplicate code in camcontrol. We now print out more information than before, including the CAM status and SCSI status and the error recovery action taken to remedy the problem. - sbufs are now available in userland, via libsbuf. This change was necessary since most of the error printing code is shared between libcam and the kernel. - A new transfer settings interface is included in this checkin. This code is #ifdef'ed out, and is primarily intended to aid discussion with HBA driver authors on the final form the interface should take. There is example code in the ahc(4) driver that implements the HBA driver side of the new interface. The new transfer settings code won't be enabled until we're ready to switch all HBA drivers over to the new interface. src/Makefile.inc1, lib/Makefile: Add libsbuf. It must be built before libcam, since libcam uses sbuf routines. libcam/Makefile: libcam now depends on libsbuf. libsbuf/Makefile: Add a makefile for libsbuf. This pulls in the sbuf sources from sys/kern. bsd.libnames.mk: Add LIBSBUF. camcontrol/Makefile: Add -lsbuf. Since camcontrol is statically linked, we can't depend on the dynamic linker to pull in libsbuf. camcontrol.c: Use cam_error_print() instead of checking for CAM_SCSI_STATUS_ERROR on every failed CCB. sbuf.9: Change the prototypes for sbuf_cat() and sbuf_cpy() so that the source string is now a const char *. This is more in line wth the standard system string functions, and helps eliminate warnings when dealing with a const source buffer. Fix a typo. cam.c: Add description strings for the various CAM error status values, as well as routines to look up those strings. Add new cam_error_string() and cam_error_print() routines for userland and the kernel. cam.h: Add a new CAM flag, CAM_RETRY_SELTO. Add enumerated types for the various options available with cam_error_print() and cam_error_string(). cam_ccb.h: Add new transfer negotiation structures/types. Change inq_len in the ccb_getdev structure to be "reserved". This field has never been filled in, and will be removed when we next bump the CAM version. cam_debug.h: Fix typo. cam_periph.c: Modularize cam_periph_error(). The SCSI error handling part of cam_periph_error() is now in camperiphscsistatuserror() and camperiphscsisenseerror(). In cam_periph_lock(), increase the reference count on the periph while we wait for our lock attempt to succeed so that the periph won't go away while we're sleeping. cam_xpt.c: Add new transfer negotiation code. (ifdefed out) Add a new function, xpt_path_string(). This is a string/sbuf analog to xpt_print_path(). scsi_all.c: Revamp string handing and error printing code. We now use sbufs for much of the string formatting code. More of that code is shared between userland the kernel. scsi_all.h: Get rid of SS_TURSTART, it wasn't terribly useful in the first place. Add a new error action, SS_REQSENSE. (Send a request sense and then retry the command.) This is useful when the controller hasn't performed autosense for some reason. Change the default actions around a bit. scsi_cd.c, scsi_da.c, scsi_pt.c, scsi_ses.c: SF_RETRY_SELTO -> CAM_RETRY_SELTO. Selection timeouts shouldn't be covered by a sense flag. scsi_pass.[ch]: SF_RETRY_SELTO -> CAM_RETRY_SELTO. Get rid of the last vestiges of a read/write interface. libkern/bsearch.c, sys/libkern.h, conf/files: Add bsearch.c, which is needed for some of the new table lookup routines. aic7xxx_freebsd.c: Define AHC_NEW_TRAN_SETTINGS if CAM_NEW_TRAN_CODE is defined. sbuf.h, subr_sbuf.c: Add the appropriate #ifdefs so sbufs can compile and run in userland. Change sbuf_printf() to use vsnprintf() instead of kvprintf(), which is only available in the kernel. Change the source string for sbuf_cpy() and sbuf_cat() to be a const char *. Add __BEGIN_DECLS and __END_DECLS around function prototypes since they're now exported to userland. kdump/mkioctls: Include stdio.h before cam.h since cam.h now includes a function with a FILE * argument. Submitted by: gibbs (mostly) Reviewed by: jdp, marcel (libsbuf makefile changes) Reviewed by: des (sbuf changes) Reviewed by: ken
* Send the remains (such as I have located) of "block major numbers" tophk2001-03-268-10/+0
| | | | the bit-bucket.
* Fix inquiry length detection for the ses(4) driver. It was using theken2001-03-161-4/+4
| | | | | | | | | | | inq_len member of the ccb_getdev structure, but we've never filled that value in.. So we now get the length from the inquiry data returned by the drive. (Since we will fetch as much inquiry data as the drive claims to support.) Reviewed by: mjacob Reported by: Andrzej Tobola <san@iem.pw.edu.pl>
* o Support AUTO SENSE correctly.non2001-02-252-80/+82
| | | | | | | | | | | o Offset and period in synch messages and width negotiation should be done for per target not per lun. Move these from *lun_info to *targ_info. o Change in handling XPT_RESET_DEV and XPT_GET_TRAN_SETTINGS . o Change CAM_* xpt_done return values. o Busy loop did not timeout. Change this to timeout as original NetBSD/pc98. Reviewed by: bsd-nomads ML
* In the SCSI_NO_SENSE_STRINGS case, properly fill the table with thegibbs2001-02-241-1/+1
| | | | | | | asc and ascq pair rather than asc, asc. PR: 25291 Submitted by: Stephen Ferrari <sferrari@yahoo.com>
* Restore a print_sense=FALSE that got nuked by accident in last delta.mjacob2001-02-221-0/+1
| | | | Noticed by: Dan Nelson <dnelson@emsphone.com>
* Use the correct device names (now that we have devfs to embarrass us).mjacob2001-02-211-7/+7
| | | | PR: 25254
* 1. The key SSD_KEY_RECOVERED_ERROR is not an error at all and shouldmjacob2001-02-111-7/+15
| | | | | | | | | | | | | | | | | | | | not be retried. It is an indication that there was an error that was corrected during the execution of the command. This is per ANSI SCSI2 spec. It's possible that these should also be noted to the console (as indicative, perhaps, of growing media defect lists in drives), but the default of printing errors out if bootverbose in this case is probably enough. Also, there'd been a missing ERESTART for that clause anyway. 2. If you have an ABORTED COMMAND, it's almost invariably a SCSI parity error. You should never be silent about these since users should do something about this if it occurs (moving that power cord *away* from the SCSI cable is always a good first start). This should print irrespective of bootverbose because it's an actual real error even if we retry a transmission. Reviewed by: audit@freebsd.org, gibbs@freebsd.org
* Change the peripheral driver list from a linker set to module drivenpeter2001-02-079-9/+9
| | | | | driver registration. This should allow things like da, sa, cd etc to be in seperate KLD's to the cam core and make them preloadable.
* Another round of the <sys/queue.h> FOREACH transmogriffer.phk2001-02-042-14/+7
| | | | | Created with: sed(1) Reviewed by: md5(1)
* Mechanical change to use <sys/queue.h> macro API instead ofphk2001-02-045-28/+25
| | | | | | | fondling implementation details. Created with: sed(1) Reviewed by: md5(1)
* Fix region code reporting.ken2001-01-281-4/+3
| | | | Reported by: Andrew Gordon <arg@arg1.demon.co.uk>
* #ifdef a local variable only used in debugging code.jhb2001-01-241-1/+4
| | | | Reviewed by: -scsi
* "Rejected with status" is better than "Rejected for status".mjacob2001-01-241-1/+1
|
* Make some attempt to accomodate kern/24221- propate residual to mt_residmjacob2001-01-191-0/+41
| | | | | | | even if it might overflow. If we do a read or set of hardware or logical block position, we also clear Tape Frozen status.
* Use the residual from a spacing operation to try and figure out wheremjacob2001-01-161-10/+38
| | | | | | | | | | | | | | | | we *really* are. It should be noted that there is a degenerate case where soft tape location will be lost (not causing a frozen state- but causing the loss of reporting fileno/blockno)- that's where you backspace over a filemark- you stop backspacing as soon as you cross the filemark, but you have no idea what the record number now is because you have no idea how many records you are into the file you just backed into. Such is life. While I'm at it, also pick up residuals from writing filemarks. PR: 24222
* Get rid of those pesky "driver mistake" messages... destroy the create_d dev_tmjacob2001-01-161-1/+5
| | | | | | when you take down the device. Reviewed by: audit@freebsd.org (Warner, Justin)
* Fix PR 24220 by using the periph private field0 for a CCB for notmjacob2001-01-151-40/+50
| | | | | | | | | | | | | | only CCB type but also extra flags- one of which can be "position updated". In other changes: Add in a SA_QUIRK_NO_CPAGE quirk so that it's possible to avoid using a (broken) device's implementation of he DEVICE COMPRESSION page. Also do a couple of printout cleanups. As per some discussion on FreeBSD-scsi, skip doing tape flushing if we're reading tape logical block location (MTIOCRDSPOS).
* Check __i386__, not i386.nyan2001-01-131-1/+1
|
* Spell declarations correctly.steve2001-01-122-2/+2
|
* select() DKI is defined in <sys/selinfo.h> now.wollman2001-01-091-1/+1
|
* Add the 'No 6 byte commands' quirk for the Yano ATAPI USB bridge.n_hibma2001-01-081-0/+4
| | | | Submitted by: Iwasa Kazmi <kzmi@ca2.so-net.ne.jp>
* Generalize quirk for Sony Memory Sticks. Any device that starts withimp2000-12-141-1/+5
| | | | | | | | | | | MS will be treated as having this quirk. In the event that we falsely identify one that doesn't need it, no harm will be done. Ken suggested that we make this more generic since there may be more needed in the future. Reported by: TERAMOTO Masahiro <teramoto@comm.eng.osaka-u.ac.jp> PR: kern/23378 Reviewed by: ken
* Move `#include <sys/devicestat.h>' into #ifdef/#endif to keepnon2000-12-131-1/+1
| | | | comaptibility with NetBSD/pc98.
* Add needed include of <sys/devicestat.h>phk2000-12-071-0/+1
|
* Turn off the load_eject bit in cdstartunit(). It causes an `Invalidjoerg2000-12-041-1/+1
| | | | | | | | | | | | field in CDB' error when attempting to start a caddy-type CD drive, since those drives apparently in general refuse to load a medium. Since we never advertised the feature to load the medium upon calling cdstartunit() (i. e. upon receipt of a CDIOCSTART ioctl command), nobody should have relied on it. Besides, nobody noticed so far at all that this command is failing for caddy-type drives... Only few applications seem to use it at all (among them is workman, which made me notice it). Reviewed by: ken
* Add special quirk for this ancient Viper drive. This is all creepingmjacob2000-11-081-0/+5
| | | | | | | driver bloat -I really *have* to do a quirk table that can be loaded by the loader. Submitted by: Hellmuth Michaelis <hm@kts.org>
* Fix a problem with the previous revision (1.42) that showed up with audioken2000-11-041-0/+93
| | | | | | | | | | | | | | | | | | CDs. With audio CDs, you can't just do a READ(10) call on most drives without first setting the blocksize with a mode select command. The disklabel code does a read of the first sector of the media to find a label if it exists. This caused drives to return an error when an audio CD was in the drive, due to the problem described above. The solution is to read the table of contents on the CD, and only attempt to read the disklabel if the first track is a data track. This works on all the various CD and DVD media I have tried, but further testing (especially with Video CDs and other mode 2 media) will be needed to determine if this is a universal solution.
* 1. Oops on last commit: note a few SCSI-3 items for data compression page.mjacob2000-10-311-1/+1
| | | | | 2. Change copyright to me- per practive of scsi_sa.c that Justin had me do a while back.
* scsi_sa.hmjacob2000-10-312-11/+36
|
* 0x03F -> 0x3F for consistancy with the rest of the file.gibbs2000-10-311-1/+1
|
* Remove unused #includes.non2000-10-302-16/+6
| | | | Submitted by: phk@FreeBSD.ORG
* Remove unused #includesphk2000-10-303-6/+0
| | | | Reviewed by: ken
* Write support for the cd(4) driver.ken2000-10-301-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows writing to DVD-RAM, PD and similar drives that probe as CD devices. Note that these are randomly writeable devices, not sequential-only devices like CD-R drives, which are supported by cdrecord. Add a new flag value for dsopen(), DSO_COMPATLABEL. The cd(4) driver now uses this flag instead of the DSO_NOLABELS flag. The DSO_NOLABELS always used a "fake" disklabel for the entire disk, provided by the caller. With the DSO_COMPATLABEL flag, dsopen() will first search the media for a label, and if it finds a label, it will use that label. Otherwise it will use the fake disklabel provided by the caller. This provides backwards compatibility, since we will still have labels for ISO9660 media. It also provides new functionality, since you can now have a regular BSD disklabel on read-only media, or on writeable media (e.g. DVD-RAM). Bruce and I both think that we should eventually (in a few years) get away from using disklabels for ISO9660 media, and just use the whole disk device (/dev/cd0). At that point disklabel handling in the cd(4) driver could follow the "normal" model, as used in the da(4) driver. Also, clean up the path in a couple of places in cdregister(). (Thanks to Nick Hibma for catching that bug.) Reviewed by: bde
* Add the use of M_ZERO to some malloc calls.dwmalone2000-10-292-15/+6
| | | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net> Approved by: gibbs
* Remove unneeded #include <sys/proc.h> lines.phk2000-10-291-1/+0
|
* Changed not to use struct isa_device in the argument of scsi_low_activate().non2000-10-292-3/+4
| | | | | You will not need COMPAT_OLDISA in config file. This interface may have to change in future.
* Add a quirk entry for Nakamichi MJ-* changers. The changer in question isken2000-10-281-0/+4
| | | | | | a <NAKAMICH MJ-5.16S 1.06>. Submitted by: Kevin Van Maren <vanmaren@fast.cs.utah.edu>
* Add usage of M_ZERO to malloc calls where the result was just bzeroed.mjacob2000-10-271-7/+4
| | | | | PR: 22186 Submitted (partially) by: josh@zipperup.org
OpenPOWER on IntegriCloud