One basic struct, a function to setup a queue with a specific strategy and
three macros to put buf's into the queue, get and remove the next buf or
get the next buf without removal.
The BUFQ_XXX interface will be removed in the future.
The B_ORDERED flag is not longer supported.
Approved by: Jason R. Thorpe <thorpej@wasabisystems.com>
on disks in a generic way. Implement these ioctls for SCSI disks.
This is not fully fleshed-out yet, but it allows people to experiment
with disk caches more easily.
Add SD_IO_TIMEOUT (an option in opt_scsi.h) also, which defaults to the
normal 60 * 1000 timeout for normal read/write commamds. This allows you
to shorten or lengthen the timeout as needed.
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
with XS_CTL_ASYNC if the failed command was called with XS_CTL_ASYNC.
Add a SDF_RESTART flag to keep state, cleared in sddone().
A mounted disk can now spin down, it will propely spin up at the next access.
-store printable product ID in cd's and sd's softc, use it as "typename"
-for this, add a "destination buffer length" argument to scsipi_strvis()
-return ATAPI device type for ATAPI devices
operation with address 0 length 0, which, according to the SCSI-2 spec, should
be interpreted as "synchronize all remaining blocks beginning at address 0".
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.