summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam_xpt.c
Commit message (Collapse)AuthorAgeFilesLines
* cleanup some of the XPORT_FC codemjacob2001-06-241-24/+18
|
* Hints overhaul:peter2001-06-121-5/+5
| | | | | | | | | - 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.
* 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
* Remove unneeded includes of sys/ipl.h and machine/ipl.h.jhb2001-05-151-2/+0
|
* Rewrite of the CAM error recovery code.ken2001-03-271-28/+608
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-261-1/+0
| | | | the bit-bucket.
* 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
* - 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-071-10/+6
| | | | | 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.
* Mechanical change to use <sys/queue.h> macro API instead ofphk2001-02-041-6/+6
| | | | | | | 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
* Mark the (ancient) MaxOptix Tahiti 1 drive as a known rogue that wouldjoerg2001-01-231-0/+10
| | | | | | respond to all LUNs. Reviewed by: ken
* Add tags quirk for IBM DNES drives.mjacob2001-01-161-0/+11
| | | | | PR: 21139 Obtained from: campt@miralink.com
* Fix async notifications for listners registered to wildcard nodes. Forgibbs2000-11-061-55/+77
| | | | | | | example, a client registered to receive specific events for bus 0, target *, lun *, was not receiving notifications. Reviewed by: ken@FreeBSD.org
* Treat engine inquiry the same as path inquiry in xptioctl().gibbs2000-10-311-5/+3
| | | | | | | | Return ENOTSUP for any opcode that is not supported by the XPT device. Add back a missing local declaration that seems to have been deleted by my last commit.
* Allow async transfer negotiation updates to modify tagging behavior.gibbs2000-10-311-3/+1
| | | | | | | | | | The XPT uses this to prevent tags from being used on parallel SCSI interfaces immediately after a bus reset or BDR so that controllers have an oportunity to renegotiate without tag messages in the way. Somehow this got disabled... the functionality has been here for quite some time. Noticed by: my SCSI bus analyzer
* Allow XPT_PATH_INQ to be performed on the XPT device, as per the CAM spec.scottl2000-10-301-1/+7
| | | | | | | Return ENOTSUP for XPT_ENG_INQ and XPT_ENG_EXEC when performed on the XPT device. Reviewed by: gibbs
* Add the use of M_ZERO to some malloc calls.dwmalone2000-10-291-4/+3
| | | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net> Approved by: gibbs
* - Overhaul the software interrupt code to use interrupt threads for eachjhb2000-10-251-29/+17
| | | | | | | | | | | | | | | | | | | type of software interrupt. Roughly, what used to be a bit in spending now maps to a swi thread. Each thread can have multiple handlers, just like a hardware interrupt thread. - Instead of using a bitmask of pending interrupts, we schedule the specific software interrupt thread to run, so spending, NSWI, and the shandlers array are no longer needed. We can now have an arbitrary number of software interrupt threads. When you register a software interrupt thread via sinthand_add(), you get back a struct intrhand that you pass to sched_swi() when you wish to schedule your swi thread to run. - Convert the name of 'struct intrec' to 'struct intrhand' as it is a bit more intuitive. Also, prefix all the members of struct intrhand with 'ih_'. - Make swi_net() a MI function since there is now no point in it being MD. Submitted by: cp
* Remove unneeded #include <machine/clock.h>phk2000-10-151-1/+0
|
* Slight cleanup - this is logically equivalent code but means one lesspeter2000-10-151-6/+6
| | | | use of the evil resource_locate() function.
* - Heavyweight interrupt threads on the alpha for device I/O interrupts.jhb2000-10-051-1/+1
| | | | | | | | | | | - Make softinterrupts (SWI's) almost completely MI, and divorce them completely from the x86 hardware interrupt code. - The ihandlers array is now gone. Instead, there is a MI shandlers array that just contains SWI handlers. - Most of the former machine/ipl.h files have moved to a new sys/ipl.h. - Stub out all the spl*() functions on all architectures. Submitted by: dfr
* - Remove the inthand2_t type and use the equivalent driver_intr_t type fromjhb2000-09-131-1/+1
| | | | | | | | | | | | | newbus for referencing device interrupt handlers. - Move the 'struct intrec' type which describes interrupt sources into sys/interrupt.h instead of making it just be a x86 structure. - Don't create 'ithd' and 'intrec' typedefs, instead, just use 'struct ithd' and 'struct intrec' - Move the code to translate new-bus interrupt flags into an interrupt thread priority out of the x86 nexus code and into a MI ithread_priority() function in sys/kern/kern_intr.c. - Remove now-uneeded x86-specific headers from sys/dev/ata/ata-all.c and sys/pci/pci_compat.c.
* CAM, the module: scbus, da, cd, and st wrapped in one module.n_hibma2000-08-131-1/+24
| | | | | | | Make the umass driver depend on this module. Makes it possible to compile the kernel without SCSI support and load it when for example a USB floppy is conencted.
* The Yamaha CDR100 doesn't seem to like multi-LUN probing.ken2000-08-081-0/+4
| | | | | PR: kern/20347 Submitted by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
* cam_ccb.h:gibbs2000-07-181-0/+9
| | | | | | | | | | | | | Bring back the CAM_NEGOTIATE ccb flag. This flag indicates that SPI transfer negotiation should occur concurrently with the execution of this CCB. The flag is not yet used by the XPT but is required for proper support of multi-initiator configurations where topology scans cannot rely on a bus reset to invalidate prior negotiations. cam_xpt.c: Don't allow DT transmission rates to be specified for devices that don't have the DT feature listed in their inquiry data.
* Whoops- forgot to commit this other pearl from Justin- only set ormjacob2000-07-171-8/+12
| | | | | | clear CAM_TAG_ACTION_VALID if this is an XPT_SCSI_IO CCB (otherwise, the peripheral driver knows best...).. Obtained from:gibbs@freebsd.org
* Quirk entry for TeraSolutions TRC-22 RAID controller to keep mintagsdg2000-07-131-0/+5
| | | | from dropping below 55 due to temporary resource shortages.
* Disable multi-lun probing on Hitachi DK31* drives.ken2000-06-041-0/+12
| | | | | PR: misc/18793 Submitted by: Paul Haddad <paul@pth.com>
* Back out the previous change to the queue(3) interface.jake2000-05-261-16/+15
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-231-15/+16
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* *sigh* I must have been on something that night. Make xpt_periph ann_hibma2000-05-071-0/+2
| | | | | extern with the original in cam_xpt.c instead of replicating xpt_periph in all the sources using it (and hence not initialising it)
* Add a hack to cam that makes the cam_xpt available to the rest of then_hibma2000-04-031-2/+0
| | | | | | | | | | | | | | | | | | | | | | | kernel. Justin agress that there is no other reasonable alternative to do automatic rescans on connect. The problem is that when a new device attaches to a SIM (SCSI host controller) we need to send a XPT_SCAN_BUS command to the SIM using xpt_action. This requires however that there is a peripheral available to take the command (otherwise xpt_done and later bomb). The RESCAN ioctl uses the same periph. This enables a USB mass storage drive to do an automatic rescan on connection of the drive. The automatic dropping of a CAM entry on disconnection was already working (asynchronous event). The next thing to do is find someone to commit a change to vpo to do the same thing. Just port umass_cam_rescan and friends across to that driver. Approved by: gibbs
* Various typo's.n_hibma2000-03-151-1/+1
| | | | One minor nit. The speed was displayed wrong when below 1Mb/s.
* Redo the SHORT INQUIRY length stuff to be a bit cleaner.mjacob2000-01-251-32/+27
| | | | Obtained from:gibbs@freebsd.org
* A minimal update to the device wiring code so that it looks at thepeter2000-01-231-38/+32
| | | | | | dynamic resource tables rather than relying on a duplicated cam-specific table generated by config(8) in ioconf.c. This was a major holdup to getting loader / userconfig driven configuration of scsi wiring.
* Remove garbage collected tags from their usage in the ccb_getdevmjacob2000-01-171-12/+39
| | | | | | | | | | | | | | | | | | structure. Remove usage of the (now gone) pd_type tag of same. Add an extra probing state such that if we successfully run an initial inquiry (36 bytes), rerun another one with a longer data size as informed by the 'additional length' field in the first returned inquiry data (making sure not to get bigger than the actual scsi_inquiry_data structure- which has also been modified- see separate checkin of scsi_all.h). This allows devices such as SAF-TE devices (which have identifying marks in offsets 48-53 in inquiry data) to be successfully found without special case inquiry commands. There are also a lot of other things such as version codes that are coming in in the SPC2 specification that it would be useful to get our hands on. Reviewed by: gibbs@freebsd.org, ken@freebsd.org
* Clean up the xpt_sim creation to mirror how HBA drivers perform this task.gibbs2000-01-141-73/+126
| | | | | | | | | | | | | | Clean up node creation in the EDT so that initialization follows member declaration. Sort registered paths by pathid so that we probe busses in order of ascending pathid. This makes hardwiring of busses without wiring individual targets do what the user expects. (submitted by tegge@FreeBSD.org) Fix an EDT node leak. Target nodes would never go away. Implement xpt_bus_deregister(). (prodded by some patches from T. Ichinoseki, but implemented differently.)
* Make sure we don't look at an edt entry that could go away when we trymjacob1999-12-201-7/+15
| | | | | and figure out whether to probe higher than logical unit 7. Obtained from:gibbs@freebsd.org
* minor comment updatemjacob1999-12-131-0/+1
|
* Convert the xpt, pass, pt and target drivers to use the newken1999-11-171-1/+1
| | | | make_dev()/destroy_dev() interface.
* Fix Bus Device Resets from userland, and specifically from camcontrol.ken1999-10-311-1/+1
| | | | | | | | | | | camcontrol was setup to use the old scheme of going through the xpt(4) device, which never worked properly (and has been disabled for a while). camcontrol now sends BDRs through the pass(4) device, and XPT_RESET_DEV CCBs are put on the device queue in the transport layer, as they should be. Submitted by: luoqi Reviewed by: ken
* Protect xpt_run_dev_sendq in xpt_release_devq_device with splsoftcam. Thismjacob1999-10-161-3/+5
| | | | | | seems to handle the case of timeouts firing during probe but after a device has gone away. It really does help. Obtained from:gibbs@freebsd.org
* Removal of sys/device.hn_hibma1999-10-051-1/+0
| | | | | | | | | | | | | - Move intrhook stuff into kernel.h - Remove all occurrences of #device <device.h> - Add kernel.h were necessary (nowhere) - delete device.h This file contained the structures for cfdata (old style config) and is no longer used. It was included by most drivers. It confuses the remote debugger as the definition of 'struct device' in device.h is found before the one in bus_private.h.
* Remove five now unused fields from struct cdevsw. They should neverphk1999-09-251-5/+0
| | | | | | | | have been there in the first place. A GENERIC kernel shrinks almost 1k. Add a slightly different safetybelt under nostop for tty drivers. Add some missing FreeBSD tags
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Convert DEVFS hooks in (most) drivers to make_dev().phk1999-08-231-5/+1
| | | | | | | | | | | | | | | | Diskslice/label code not yet handled. Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers) Add the correct hook for devfs to kern_conf.c The net result of this excercise is that a lot less files depends on DEVFS, and devtoname() gets more sensible output in many cases. A few drivers had minor additional cleanups performed relating to cdevsw registration. A few drivers don't register a cdevsw{} anymore, but only use make_dev().
* Implement the guts of the XPT_ABORT function code.gibbs1999-08-161-31/+111
| | | | | | | | | | | | | | | | Clear residuals for XPT_TARGET_IO/XPT_CONT_TARGET_IO calls just as we do for XPT_SCSI_IO calls. Make xpt_release_devq a proper reciprocal of xpt_freeze_devq by allowing the caller to decrement the count more than once per call. Change the semantics of xpt_path_cmp to return 1 for a match with a wildcard from path1 and 2 for a match with wildcards from path2. This change doesn't affect most callers as they only check for >=0 (exact match or one containing a wildcard). When cleaning up a device node, ensure that there are no timeouts outstanding that reference it.
* Put in a limit (8) for lun width- do not exceed probing this unless a devicemjacob1999-08-161-3/+9
| | | | | | | is quirked for allowing it. This will allow SCSI cards to specify their true correct lun width (32 for Qlogic SCSI, 16 or 65536 for Qlogic Fibre Channel) without crippling the system because of f/w breakage of a lot of drives. Reviewed by: gibbs@freebsd.org
OpenPOWER on IntegriCloud