summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam_xpt.c
Commit message (Collapse)AuthorAgeFilesLines
* Centralize the devstat handling for all GEOM disk device driversphk2003-03-081-1/+0
| | | | | | | | in geom_disk.c. As a side effect this makes a lot of #include <sys/devicestat.h> lines not needed and some biofinish() calls can be reduced to biodone() again.
* Gigacommit to improve device-driver source compatibility betweenphk2003-03-031-13/+5
| | | | | | | | | | | | | branches: Initialize struct cdevsw using C99 sparse initializtion and remove all initializations to default values. This patch is automatically generated and has been tested by compiling LINT with all the fields in struct cdevsw in reverse order on alpha, sparc64 and i386. Approved by: re(scottl)
* Back out M_* changes, per decision of the TRB.imp2003-02-191-2/+2
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-2/+2
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Note that the large Hitachi's are also CAM_QUIRK_HILUNSmjacob2002-09-231-0/+8
|
* Make SCSI_DELAY setable at boot time and runtime via thebrooks2002-09-021-3/+3
| | | | | | kern.cam.scsi_delay tunable/sysctl. Reviewed by: mdodd, njl
* Add \n to various printfs. grep shows these should be the last ones.njl2002-08-271-3/+3
|
* Replace various spelling with FALLTHROUGH which is lint()ablecharnier2002-08-251-2/+2
|
* Make Veritas Storage Appliance a HILUNS device.mjacob2002-04-241-0/+5
| | | | MFC after: 1 day
* Maxtor Personal Storage 3000XT (Firewire) hangs uponsimokawa2002-03-241-0/+11
| | | | | | serial number probing. MFC after: 1 week
* Define the kern.cam sysctl in the cam layer, rather than multiply in severalmsmith2002-01-091-2/+2
| | | | | | | peripheral drivers. Remove Ken's comment to the effect that this needed to be done. Staticise camnet_ih and cambio_ih.
* Change the preemption code for software interrupt thread schedules andjhb2002-01-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mutex releases to not require flags for the cases when preemption is not allowed: The purpose of the MTX_NOSWITCH and SWI_NOSWITCH flags is to prevent switching to a higher priority thread on mutex releease and swi schedule, respectively when that switch is not safe. Now that the critical section API maintains a per-thread nesting count, the kernel can easily check whether or not it should switch without relying on flags from the programmer. This fixes a few bugs in that all current callers of swi_sched() used SWI_NOSWITCH, when in fact, only the ones called from fast interrupt handlers and the swi_sched of softclock needed this flag. Note that to ensure that swi_sched()'s in clock and fast interrupt handlers do not switch, these handlers have to be explicitly wrapped in critical_enter/exit pairs. Presently, just wrapping the handlers is sufficient, but in the future with the fully preemptive kernel, the interrupt must be EOI'd before critical_exit() is called. (critical_exit() can switch due to a deferred preemption in a fully preemptive kernel.) I've tested the changes to the interrupt code on i386 and alpha. I have not tested ia64, but the interrupt code is almost identical to the alpha code, so I expect it will work fine. PowerPC and ARM do not yet have interrupt code in the tree so they shouldn't be broken. Sparc64 is broken, but that's been ok'd by jake and tmm who will be fixing the interrupt code for sparc64 shortly. Reviewed by: peter Tested on: i386, alpha
* Bring the probe inquiry code in line with the SCSI spec.ken2001-11-271-43/+35
| | | | | | | | | | It is legal to have a device with device type 0x1f, that just means that the device is of unknown type. Instead, only check the peripheral qualifier when deciding whether or not to reject a device based on its inquiry information. Tested by: julian MFC after: 3 weeks
* Disabled tagged commands for Hitachi Jura-C series with J8A8 firmware.dg2001-11-191-0/+10
| | | | | PR: 23536 Submitted by: amagai@nue.org
* Back out revision 1.117; the correct solution is to upgrade theiedowse2001-11-191-9/+0
| | | | | | | firmware on the drive in question. The pattern also matched far too many Hitachi drives. Spotted by: dg
* Hitachi DK32 disks have problems with tagged queuing under load.iedowse2001-11-191-0/+9
| | | | | | PR: kern/23536 Submitted by: Y.Amagai <amagai@nue.org> MFC after: 1 week
* KSE Milestone 2julian2001-09-121-3/+3
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* 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)
OpenPOWER on IntegriCloud