Commit Graph

55 Commits

Author SHA1 Message Date
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
mycroft b76a328caa Redo the `wait for spin up' code. The Mach 3 method clearly doesn't work.
Also, rearrange the first open sequences a bit; SDEV_OPEN is no longer magic.
1995-01-26 11:56:51 +00:00
mycroft 4a1e51751b Trivial simplification. 1995-01-16 21:34:10 +00:00
mycroft 28775a6a5d Add a DIAGNOSTIC check. 1995-01-13 14:38:13 +00:00
mycroft bfd9901daf Fix some oversights in the debugging code. 1994-12-30 05:33:06 +00:00
mycroft 5d3bd57538 Fix a couple of things in the sense printing code. 1994-12-29 13:49:57 +00:00
mycroft 8fd135209c Numerous changes. Many bugs fixed, better autoconfig, a few new features. 1994-12-28 19:42:47 +00:00
mycroft 1b372b7e96 Remove some redundant code. 1994-12-01 13:07:28 +00:00
mycroft 0109779d43 Remove unneeded override of SCSI_NOSLEEP. 1994-12-01 12:45:25 +00:00
mycroft 1066219897 Uncomment call to scsi_user_done(), and remove a duplicate biodone() (and
another si_free()).
1994-12-01 12:04:43 +00:00
deraadt 0c36dd6762 C botch repair from bostic 1994-11-22 00:05:36 +00:00
mycroft fd32202948 Replace dev_unit with device_softc in scsi_link. Change argument to foostart()
to void*.
1994-11-21 10:39:09 +00:00
deraadt 5aa2f1e6bb remove an un-aligned access 1994-08-30 17:01:57 +00:00
deraadt fd7c79353e knf 1994-06-29 23:32:42 +00:00
cgd fccfa11af5 New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD' 1994-06-29 06:39:25 +00:00
chopps 95faa87c60 remove union's from sense_data struct, conditionaly define RAW_PART 1994-05-09 07:40:47 +00:00
mycroft df873c8545 Maintain the xs free list with LIST_*(). 1994-04-20 22:13:33 +00:00
mycroft c01cb5c454 Fix various types. Remove some outdated flags. Actually sleep a bit if
there are too many commands pending on the controller.
1994-04-11 03:53:45 +00:00
mycroft 8b10b2cd18 Combine scsi_start_unit() and scsi_stop_unit(), and increase the start
timeout (again).
1994-04-11 02:23:41 +00:00
mycroft 2e5a28159f New SCSI system, based on Julian's more recent work. 1994-03-29 04:29:20 +00:00
mycroft 4335fa14b3 Increase the timeout for start_unit. 1994-02-16 00:47:35 +00:00
mycroft 94b2718bd1 PARANOID --> DIAGNOSTIC for inexpensive tests. 1994-02-14 21:43:33 +00:00
mycroft 4ecdacf90d Add scsi_stop_unit(), from Mac code. Other minor nits. 1994-02-01 20:05:19 +00:00