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
saves about 2.2MB under /usr/include/dev/. Discussed on tech-kern@
recently.
I HOPE to get the list right. The headers I left in are ones
used for MI tools and those whose usage I discovered by grep over tree sources.
Feel free to put needed includes back in if you encounter anything which
should not be removed from lists.
the number of partitions is > OLDMAXPARTITIONS. This is better
than silently truncating the label (don't want to silently throw
away partitions when using an old disklabel binary on a label with
> 8 partitions). From Enami Tsugutomo.
we have it.
* st_unmount(): reset density to the device default. This prevents using
stale density values after changing to a medium with different density.
Section 9.3.3 of the SCSI specs states that a device shall return the
density value specified in the last succesfull MODE SELECT after an
unload operation, in case it is not able to automatically determine
the density of the new medium.
after all, probing the device for acceptable parameters.
* In st_loadquirks(), copy mode-specific quirks from the quirk table
to `st_softc'; otherwise all such quirks save ST_Q_FORCE_BLKSIZE are ignored.
it when considering whether to attach devices. This is to facilitate
`non-SCSI' RAID controller drivers that want to provide SCSI pass-through
services to the kernel.
to be obeying the original spec as to what the numeric value means.
Temperature flags are unaffected- these are still the 'pseudo-thermometers'
and overtemp/undertemp warnings will be caught and translated to SES objects
here.
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.
it to determine the boot device: mvme68k, pc532, macppc, ofppc. Those
platforms should be changed to use device_register(). In the mean time,
those ports defined __BROKEN_DK_ESTABLISH.
Remove "???" from T_IT8_1/2. They actually are pre-press devices for graphic arts as described by ASC IT8
Zeros and blanks scsipi_inquiry_data from byte 58 to byte 74 if additional_length is less than 58
statically. Since this function may called for another luns immediately,
allocating it statically doesn't make sense and may cause race condition
as pointed out by PR#9749.
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.
if an IRQ was not detected, unless the force flag was given. Use this to
detect if the IRQ was for us (closer to shared IRQ for controllers which
don't have their own IRQ handler in pciide.c) and to poll for DMA xfer.
Also makes the timeout recovery code simpler.
- ATAPI cleanup: don't call controller-specific functions from atapiconf.c
(wdc_*), so that it's possible to attach an atapibus to something else
than a wdc/pciide (Hi Lennart :).
Overload struct scsi_adapter with struct atapi_adapter, defined
as struct scsi_adapter + atapi-specific callbacks. scsipi_link still points
to an scsi_adapter, atapi code casts it to atapi_adapter if needed.
Move atapi_softc to atapiconf.h so that it can be used by the underlying
controller code (e.g. atapi_wdc.c).
Add an atapi-specific callback *atapi_probedev(), which probe a drive
in a controller-specific way, allocate the sc_link and fills in the
ataparams if needed. It then calls atapi_probedev() (from atapiconf.c)
to do the generic initialisations and attach the device.
- While I'm there merge and centralise the state definitions in atavar.h.
It should now be possible to use a common ata/atapi routine to set the
drive's modes (will do later).
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.
The old timeout()/untimeout() API has been removed from the kernel.
a historical leftover, and very few drivers actually look at it. But the
PCI `ncr' driver does, and if this field is not initialized to its default
value, that driver will fall over flat on its face when it attempts to get
sense data from a target.
- If UDMA 2 is failing try UDMA 1 first, it helps in some cases
- downgrade if we get an error in the first 4000 xfers, or if we get
4 errors in 4000 xfers if the first 4000 went without troubles.
While I'm there commit a local change I have since some time to get my CD
probed: issue a "blanck" IDENTIFY before the one used to detect slave ghosts,
with my drive the first IDENTIFY following a controller reset fails with an
aborted command ...
This is an attempt to allow people to change the default configuration
to try harder at 'mounting' a tape. This allows you to specify, in
seconds, the amount of time a non-control unit open will retry
(once per second) the scsipi_test_unit_ready when it tries to mount
the tape. It also turns off the over-verbose error reporting at
this time unless SCSIDEBUG is set.
The reason this is not enabled as a default is that it's a large change
of behaviour. I find it useful to 'try harder' at mounting a tape in
the tape driver, particularly when loaded via a media changer device
rather than specifying the delays in the backup program.
succeeds, note that we now are valid.
- Don't attempt to try and run initialize element status from interrupt level-
we don't really support that yet. Also, key more correctly off of ASC/ASCQ
instead of just the sense key.
- Make the practice of doing an INITIALIZE ELEMENT STATUS automatically when
we get params (from chopen time even) a policy decision that is not the
default for now- this can be a dangerous practice as well as time consuming.
It's dangerous in that you can have a hung open when all you really want
to do is do a read of parameters- and parameters, including slot status,
are perfectly fine to read even before an INITIALIZE ELEMENT STATUS is
done- all the elements whos status your read are going to be marked with
an exception- so leave it up to the application to decide how important
this is.
LiViD DVD player. (See forthcoming mail to current-users.)
XXX NOTE: We should do something to probe capabilities, rather than allowing
these ioctls on any device.
- `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.