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
Also, if the so-called DMA operation is a write and ends without target-
complete set, count the data in the FIFO as residual and add that to the
amount in the counters. Hauke Fath reports that this passes early testing
on his Quantum Viking.
if it is 64k. TCL and TCM will be set properly if we just leave it alone.
Not only that, the ncr53c9x driver issues TRPAD or TRANS based on this
value. We do not want TRPAD in this case!
an ugly bit where we record the value of a2 while handling a "nofault" bus
error in locore.s in order to know how far the transaction got before a
disconnect (see esp.c comments for more details on this).
Also get rid of a loop (and delay()!) in the interrupt routine--hinted at
and researched by Chas Williams <chas@cmf.nrl.navy.mil>.
implement pseudo-DMA transfers with the SCSI controller. This caused our
match to fail when we couldn't map the entire DAFB register/control space
for our own use. Instead, we map only (about) what we will need in two
separate regions.
As a consequence we no longer do Turbo SCSI configuration here; indeed, it
may have caused us trouble later on if we actually changed the values
stored in those registers in the esp driver.
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".
Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
and scsipi_device respectively, with size reduction of ncr53c9x_softc.
Specifying NULL instructs the driver to use default adapter and default
device codes. Every target port has ncr53c9x_attach(sc, NULL, NULL) anyway.
change these from bp->b_un.b_addr to bp->b_data, as well. This also
allows us more flexibility to experiment with other data buffer types
hung off of struct buf.
* fix a typo in callout_stop() call
* prototype fd_mod_init(), fd_mod_free() to avoid warnings
* include iwm_mod.h
Fix sent in port-mac68k/9787 by Dave Huang.
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.
anything that might cause an interrupt (e.g. the SCSI bus reset in
ncr53c9x_attach()). If we don't do this, the initial interrupt is
lost, thus causing the state machine to never enter IDLE state, thus
causing SCSI commands to never be executed.
Fixes kern/8544, reported by Erik Bertelsen <erik@mediator.uni-c.dk>.
- Add initial IOP support. ADB doesn't work yet for me, but it's here so
that others will be encouraged to work on it. ADB_HW_IOP basically
is configured as a NOP so that serial consoles will continue to work.
- Roll via1_intr and via2_intr into the intr.c scheme--this also required
changing rtclock_intr to grovel the stack differently so that hardclock
gets the right arguments and softclock() doesn't get all reentrant.
- Make via1 interrupts parallel to via2 interrupts--handlers get a pass-
through pointer and we can register handlers. Register via1 interrupt
with intr_establish()--normally level 1, level 6 for A/UX scheme.
- Use intr_establish() to set real via2 interrupt handler instead of the
hacked function pointer.
- Reorganize adb-direct interrupts so that a function call is removed.
- Implement A/UX interrupts for all Quadras right now. We may need to
special case some Quadras, but Linux folks are reporting success on
several models.
- Fix intrnames to be accurate for the normal, PSC, and A/UX interrupt
configurations.
at levels 5 (sound) and 6 (via1) on the Q700.
Raise splhigh when reading and writing registers. It's ugly, but it's
possible that we could get an interrupt from a higher-level source,
causing a re-read of a memory location.
This is not good when, e.g., we are reading the interrupt register.
Ideally, we would just raise splhigh() in ncr53c9x_readregs(), but
that's m.i. code, and it may be expensive on other architectures.
controllers. Supports GCR-encoded disks only (400K and 800K); neither
of the 1.44M formats will work until someone figures out how to drive
the SWIM and its descendants.
This code was written by Hauke Fath, and had only minor touchup (mostly
KNF) by me.
- returned EOPNOTSUPP rather than -1.
- no check for negative offset.
many of these fix potential security problems in these drivers.
XXX XXX XXX
the d_mmap cdev routine should be changed to have a prototype like:
paddr_t (*d_mmap) __P((dev_t, off_t, int));
by someone!
struct scsipi_adapter; they were not used.
Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.
Inspired by PR #6090, from Matt Jacob.