Commit Graph

77 Commits

Author SHA1 Message Date
lukem 2565646230 don't need <sys/types.h> when including <sys/param.h> 2001-11-15 09:47:59 +00:00
lukem 7ba10b3532 add RCSIDs 2001-11-13 06:54:32 +00:00
thorpej 03746a443a bzero -> memset 2001-07-18 18:21:04 +00:00
bouyer 937a7a3ed9 Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
  ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
  to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
  peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
  recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
  scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
  (no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
  set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
  the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
  will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
2001-04-25 17:53:04 +00:00
enami c560e9a77b When killing pending xfers on device detach, we can't expect scsipi_done
to remove all xfers from the pending queue.  It removes only xfers for
asynchronous transactions.  So, simply loop over all pending xfers
with calling scsipi_done and wait xfers to drain.  Addresses PR#9703.
2000-04-03 03:37:33 +00:00
soren 11bd453515 scsiprint() is needed even without scsibus'es, so move it to scsi_base.c . 2000-03-17 11:45:49 +00:00
bouyer e51ae5d23a Use SCSIPIRETRIES instead of hard-coded value '2' for number of retries in
common routines. Define SCSIPIRETRIES as 4, so that the command will finally
succeed after several consecutive downgrades from UDMA2 to PIO4.
2000-01-17 17:59:48 +00:00
enami a2369d8e97 Cancel active transfers on aic/wdc detach.
Also makes LS-120 drive works for me again.
1999-10-20 15:22:24 +00:00
thorpej 16a9d90e17 Cleanup the scsipi_xfer flags:
- `flags' is now gone, replaced with `xs_control' and `xs_status'.
- Massive cleanup of the control flags.  Now we explicitly say that
  a job is to complete asynchronously, rather than relying on side-effects,
  and use a new flag to now that device discovery is being performed.
- Do SCSI device discovery interrupt-driven.
1999-09-30 22:57:52 +00:00
thorpej 61f3c9356e If scsipi_make_xs() fails, make sure to flag the buffer as error'd,
if provided, and biodone() it.  Callers of scsipi_command() expect
this to be done.
1999-08-28 22:28:35 +00:00
pk 5b4a75d281 scsipi_free_xs() wants to be called at splbio; do it. 1999-06-12 11:19:00 +00:00
bouyer 00d93f776b Rename scsi_interpret_sense() to scsipi_interpret_sense() and move it from
scsi_base.c to scsipi_base.c. Rename the functions from scsi_verbose.c
too, and rename the file itself. Cleaup includes too (scsi_*.h should not
be #included in scsipi_*.h files, which are supposed to be
common to atapi and scsi).
1998-11-17 14:38:42 +00:00
mycroft 6dc903202f Assign my copyrights to TNF. 1998-08-15 10:10:47 +00:00
mjacob 4205ca3d2a opt_scsiverbose.h now is opt_scsi.h and contains the defopted
SCSIVERBOSE and the new ST_ENABLE_EARLYWARN.
1998-07-30 00:49:19 +00:00
mjacob bf29f419e7 part of fix for kern/3835: use of enumerated returns from target sense handlers 1998-07-15 20:13:30 +00:00
mjacob 0978d23cc4 Clarify that Sense Key 1 is a "RECOVERED ERROR"- not just an error. 1998-07-11 00:52:09 +00:00
mjacob 6aa030f90b Use new Sense Key defines (for clarity) 1998-07-01 17:16:46 +00:00
christos e0436952f0 Split out the verbose printing of scsi messages, so that user programs
can use the printing routines.
1998-03-28 21:57:08 +00:00
mrg 1a8c7604f4 initial import of the new virtual memory system, UVM, into -current.
UVM was written by chuck cranor <chuck@maria.wustl.edu>, with some
minor portions derived from the old Mach code.  i provided some help
getting swap and paging working, and other bug fixes/ideas.  chuck
silvers <chuq@chuq.com> also provided some other fixes.

this is the rest of the MI portion changes.

this will be KNF'd shortly.  :-)
1998-02-05 07:59:28 +00:00
cgd 3b207eaf83 add support for an ATAPI attachment for 'sd'.
fix 'cd' driver's NCD_SCSI bogosity (was using testing wrong macro!)
clean up in various ways:
* make common atapi_mode_{sense,select}() functions.
* put ATAPI data structures in more sensible headers, split up by
  device type.
* include headers a bit more carefully.
* pass flags to attachment-specific cd functions, and use them.
* get rid of SCSI bits in scsipi_base.h's scsipi_make_xs(), move
  them into the correct place in scsi_base.c.
* fix minor typo in struct name in scsipiconf.h (which was apparently
  never used except in a #define later in the same file).
* use __attribute__ to force 4-byte alignment for xs command store,
  so that architectures trying to bus_space_write_multi_N() (where
  N > 1) that data to a controller won't lose.
* clean up a few comments in typos, and make a few #defines easier to
  understand/maintain.
* rename cd_link.h to cdvar.h (via repository copy).  This is exactly
  what a 'var' file is supposed to be.
1998-01-15 02:21:27 +00:00
is d5ad660623 EACCESS->EROFS, for the write on readonly medium error. 1997-12-30 21:36:51 +00:00
enami 85792e35df Remove newline after printing FRU CODE instead of removing
newline before printing SKSV information.
1997-11-23 05:49:59 +00:00
thorpej 75e554c27d Implement two macros, scsipi_command() and scsipi_command_direct(), and
use them to hide the structure of the function pointers we jump through
to issue a command.
1997-10-18 19:50:51 +00:00
mjacob 8d35f4cdeb Slight formatting change. 1997-10-08 21:39:25 +00:00
mjacob f63551893b The bit pointer field is a 3 bit value- not 4. 1997-10-08 17:17:09 +00:00
mjacob 284a78edc2 kern/3022: make sure that printing sense info in SCSIDEBUG case starts at
the right place and contains the right number of bytes.
1997-10-02 16:03:42 +00:00
mjacob 78e5dc866c Silly boy.... don't print out sense info if the command was marked SCSI_SILENT,
and print the opcode with a leading 0x if you're printing in hex.
1997-10-01 18:47:01 +00:00
enami d7d845c3d2 Cosmetic changes to keep coding style consistency in this directory;
- Indent with tab of width 8.
- Use four column to indent continuation line.
- Fold long line if possible.
- Use return (xx) instead of return xx.
- Compare pointer against NULL instead of testing like boolean.
- Delete whitespace at the end of line.
- Delete whitespace in front of function call operator.
- Delete whitespace after cast.
- Dereference a pointer to function explicitly.
- Add an empty line after local variable declaration.
- Use NULL instead of (char *)0.
- Dont use block for single statement.
1997-10-01 01:18:38 +00:00
enami 4d15bd0b78 Declare SCSIVERBOSE by defopt in files.scsipi. Include opt_scsiverbose.h
in scsi_base.c and st.c.
1997-09-13 08:51:15 +00:00
bouyer 5d5b3c641f Restore indentation of SCSIVERBOSE output. 1997-09-05 08:36:40 +00:00
bouyer 6f3bab1f59 Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
1997-08-27 11:22:52 +00:00
mjacob e919735e35 Add in (enabled by SCSIVERBOSE option since it adds a fair amount of string
gup to the kernel) more detailed SCSI error printing, based off of final
SCSI-2 specification. This will also print out things like progress indicator
errors, and will also dump out additional sense bytes that haven't been decoded.

Also, turned the error message 'DELAYED' to 'DEFERRED' since that's more
accurate.
1997-08-20 18:19:12 +00:00
fair cc7e70b188 %x -> 0x%x 1997-08-04 06:55:22 +00:00
matthias 8033e010bd In case of a SCSI-error print the extended sense information and not
some sort of random garbage.
1997-06-09 19:36:56 +00:00
mycroft aca1dae3c4 Push the buffer cleanup code into scsi_done(), and split it so that biodone()
is called *after* the driver `done' routine.  This fixes disk I/O statistics
on SCSI devices.

Also, calling the `done' routine with a `complete' argument of 0 and actually
having it do anything meaningful loses in at least 3 ways, so just nuke the
argument altogether and don't call it this way.  If the driver needs to do
some error handling, that's what `err_handler' is for.
1997-04-02 02:29:30 +00:00
thorpej 21c7befacf Back out part of the previous patch - not only does stuffing a sizeof()
into 8 bits generate (bogus) warnings on some architectures, but the
change to pad on "scsi inquiry" is no longer needed, apparently.
Thanks to Matthias Pfaller for pointing the latter out to me.
1997-03-20 07:13:07 +00:00
thorpej 8c465535e7 Two changes from Ian Dall <ian.dall@dsto.defence.gov.au>:
- Deal with devices that ignore the length specified in the
  inquiry command.
- Allow asynchronous requests without using a buf (key off NOSLEEP instead).
1997-03-18 01:28:10 +00:00
christos 9a2c8cf28c revert previous kprintf change 1996-10-12 23:23:13 +00:00
christos 9beb92aad7 printf -> kprintf, sprintf -> ksprintf 1996-10-10 23:32:59 +00:00
thorpej f60341a382 Store the SCSI version in the scsi_link, and set the LUN in the CDB
if the version is <= SCSI-2.  This should help some older SCSI
devices that previously needed the "NOLUNS" quirk.  While this is
not strictly necessary on SCSI-2 devices, the spec allows it,
so we set it for SCSI-2 devices "just in case".  See section 7.2.2 of
Draft X3T9.2 Rev 10L for details.
1996-09-03 18:20:31 +00:00
christos 7e1c82f6f4 - Apply PR/2535: Add support for flex scsi disks.
- Add a quirk called SCSI_NOMODESENSE for drives like the iomega jaz,
  that don't support mode sense.
1996-07-05 16:19:02 +00:00
christos 88c3808921 - SCSIDEBUG printf() fixes. 1996-05-03 19:48:20 +00:00
christos ffd5576439 remove include of <sys/cpu.h> 1996-04-22 01:44:31 +00:00
mycroft e819063285 Define a full set of [234][bl]tol() and lto[234][bl]() conversion functions,
inlined.
Use sized types in protocol structures.
Make the definition of scsi_sense_data less ugly.
1996-03-19 03:05:15 +00:00
christos 0bc63f486d scsi prototypes 1996-02-14 21:46:52 +00:00
briggs e5ece749b2 Handle COMMAND ABORTED by forcing a retry. PR#2003, but with some more
diagnostic info.
1996-01-31 15:16:06 +00:00
thorpej 8068d9eeb2 Handle cases like the following:
- controller calls scsi_done() with error XS_TIMEOUT
	- scsi_done() calls sddone()
	- sddone() calls disk_unbusy()
	- scsi_done() calls controller to retry command (missing the
	  call to disk_busy())
	- controller calls scsi_done()
	- scsi_done() calls sddone()
	- sddone() calls disk_busy(), which panics because of the imbalance.
Bug noticed by Leo Weppleman, who also suggested this fix; pass an additional
boolean argument ("complete") to the device's "done" routine, with a
value of `0' passed from the previous call to "done", and add an additional
call to "done" when the xfer resources are freed.
1996-01-12 22:43:26 +00:00
thorpej 249cddaaa7 Don't declare Debugger(). It's handled in <sys/systm.h>.
#include <sys/systm.h> where necessary, as suggested by Jonathan Stone.
Fixes PR #1511.
1995-09-26 19:26:48 +00:00
mycroft 1d2f0bce2a Make the byte-shifting code consistent. 1995-05-03 19:38:45 +00:00
mycroft 1611df6ae0 Update copyrights. 1995-01-26 12:05:49 +00:00