summaryrefslogtreecommitdiffstats
path: root/sys/cam
Commit message (Collapse)AuthorAgeFilesLines
* Fix warnings:peter2001-06-151-4/+4
| | | | | 1267: warning: suggest parentheses around comparison in operand of & 2087: warning: unused variable `li'
* Hints overhaul:peter2001-06-122-19/+20
| | | | | | | | | - Replace some very poorly thought out API hacks that should have been fixed a long while ago. - Provide some much more flexible search functions (resource_find_*()) - Use strings for storage instead of an outgrowth of the rather inconvenient temporary ioconf table from config(). We already had a fallback to using strings before malloc/vm was running anyway.
* Sorry, an "ARCHIVE Python 06408" does not need SA_QUIRK_NOCOMP.non2001-06-061-1/+1
|
* first blush at some FC path inquiry settingsmjacob2001-06-041-0/+20
|
* Do NOLUNS dance for oddball Exabyte. We *really* need to do this as hints.mjacob2001-06-041-1/+12
| | | | | | | Correct match for A5000 SES instance. PR: 19887 MFC after: 2 weeks
* first blush at some FC path inquiry settingsmjacob2001-06-041-0/+9
|
* 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.
* Remove unneeded includes of sys/ipl.h and machine/ipl.h.jhb2001-05-151-2/+0
|
* 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>
* In camperiphscsisenseerror(), don't return an error when the error actionken2001-04-301-0/+3
| | | | | | is SS_NOP. Submitted by: joerg
* 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)
* Fix an off-by-2 error in periphdriver_register(). The read side of theken2001-04-161-1/+1
| | | | | | | | bcopy would go off the end of the array by two elements, which sometimes causes a panic if it happens to cross into a page that isn't mapped. Submitted by: gibbs Reviewed by: peter
* If we have and error and are booting verbosely, don't be complainingmjacob2001-04-041-1/+7
| | | | | if this was a non-retryable selection timeout- wading through 256 targets worth of Fibre Channel 'selection timeouts' is tedious at best.
* comment typo: subsytem -> subsystemmurray2001-03-311-1/+1
| | | | | PR: 26219 Submitted by: Andre <andre@akademie3000.de>, chern@osd.bsdi.com
* Catch up to header include changes:jhb2001-03-281-0/+2
| | | | | - <sys/mutex.h> now requires <sys/systm.h> - <sys/mutex.h> and <sys/sx.h> now require <sys/lock.h>
* 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-2717-1885/+2537
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-269-11/+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>
* In xpt_set_transfer_settings(), force async if either the period or theken2001-03-131-10/+12
| | | | | | | | | | | offset is set to 0. Re-arrange the DT limiting code so that we don't end up setting the period to 0xa if the user really wants async. The previous behavior seemed to confuse the aic(4) driver. PR: kern/22733 Reviewed by: gibbs
* 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
* - Catch up to the new swi API changes:jhb2001-02-091-8/+6
| | | | | | | - Use swi_* function names. - Use void * to hold cookies to handlers instead of struct intrhand *. - In sio.c, use 'driver_name' instead of "sio" as the name of the driver lock to minimize diffs with cy(4).
* Change the peripheral driver list from a linker set to module drivenpeter2001-02-0712-26/+65
| | | | | 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-043-16/+8
| | | | | Created with: sed(1) Reviewed by: md5(1)
* Mechanical change to use <sys/queue.h> macro API instead ofphk2001-02-047-38/+35
| | | | | | | fondling implementation details. Created with: sed(1) Reviewed by: md5(1)
* Back out rev 1.102. The IBM DNES drives work fine for me, jedgar and otherken2001-01-291-11/+0
| | | | | | | | | | folks. My guess is that reducing the number of tags is just masking the real problem for the PR submitter. I'll re-open the PR and see if I can work with the submitter to diagnose the problem. PR: 21139
* 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
* Const'ify cam_sim.sim_name to quiet warnings.jhb2001-01-242-9/+9
| | | | Reviewed by: -scsi
* "Rejected with status" is better than "Rejected for status".mjacob2001-01-241-1/+1
|
* Mark the (ancient) MaxOptix Tahiti 1 drive as a known rogue that wouldjoerg2001-01-231-0/+10
| | | | | | respond to all LUNs. Reviewed by: ken
* 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.
* Add tags quirk for IBM DNES drives.mjacob2001-01-161-0/+11
| | | | | PR: 21139 Obtained from: campt@miralink.com
* 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
|
OpenPOWER on IntegriCloud