freebsd-skq/sys/dev
Justin T. Gibbs 4164174aff aic79xx.c:
aic79xx.seq:
	Convert the COMPLETE_DMA_SCB list to an "stailq".  This allows us to
	safely keep the SCB that is currently being DMA'ed back the host on
	the head of the list while processing completions off of the bus.  The
	newly completed SCBs are appended to the tail of the queue.   In the
	past, we just dequeued the SCB that was in flight from the list, but
	this could result in a lost completion should the host perform certain
	types of error recovery that must cancel all in-flight SCB DMA operations.

	Switch from using a 16bit completion entry, holding just the tag and the
	completion valid bit, to a 64bit completion entry that also contains a
	"status packet valid" indicator.  This solves two problems:
	  o The SCB DMA engine on at least Rev B. silicon does not properly deal
	    with a PCI disconnect that occurs at a non-64bit aligned offset in the
	    chips "source buffer".  When the transfer is resumed, the DMA engine
	    continues at the correct offset, but may wrap to the head of the buffer
	    causing duplicate completions to be reported to the host.  By using a
	    completion buffer in host memory that is 64bit aligned and using 64bit
	    completion entries, such disconnects should only occur at aligned addresses.
	    This assumes that the host bridge will only disconnect on cache-line
	    boundaries and that cache-lines are multpiles of 64bits.

	  o By embedding the status information in the completion entry we can avoid
	    an extra memory reference to the HSCB for commands that complete without
	    error.

	Use the comparison of a "host freeze count" and a "sequencer freeze count"
	to allow the host to process most SCBs that complete with non-zero status
	without having to clear critical sections.  Instead the host can just pause the
	sequencer, performs any necessary cleanup in the waiting for selection list,
	increments its freeze count on the controller, and unpauses.  This is only
	possible because the sequencer defers completions of SCBs with bad status
	until after all pending selections have completed.  The sequencer then avoids
	referencing any data structures the host may touch during completion of the
	SCB until the freeze counts match.

aic79xx.c:
	Change the strategy for allocating our sentinal HSCB for the QINFIFO.  In
	the past, this allocation was tacked onto the QOUTFIFO allocation.  Now that
	the qoutfifo has grown to accomodate larger completion entries, the old
	approach will result in a 64byte allocation that costs an extra page of
	coherent memory.  We now do this extra allocation via ahd_alloc_scbs()
	where the "unused space" can be used to allocate "normal" HSCBs.

	In our packetized busfree handler, use the ENSELO bit to differentiate
	between packetized and non-packetized unexpected busfree events that
	occur just after selection, but before the sequencer has had the oportunity
	to service the selection.

	When cleaning out the waiting for selection list, use the SCSI mode
	instead of the command channel mode.  The SCB pointer in the command
	channel mode may be referenced by the SCB dma engine even while the
	sequencer is paused, whereas the SCSI mode SCB pointer is only accessed
	by the sequencer.

	Print the "complete on qfreeze" sequencer SCB completion list in
	ahd_dump_card_state().  This list holds all SCB completions that are deferred
	until a pending select-out qfreeze event has taken effect.

aic79xx.h:
	Add definitions and structures to handle the new SCB completion scheme.

	Add a controller flag that indicates if the controller is in HostRAID
	mode.

aic79xx.reg:
	Remove macros used for toggling from one data fifo mode to the other.
	They have not been in use for some time.

	Add scratch ram fields for our new qfreeze count scheme, converting
	the complete dma list into an "stailq", and providing for the "complete
	on qfreeze" SCB completion list.  Some other fields were moved to retain
	proper field alignment (alignment >= field size in bytes).

aic79xx.seq:
	Add code to our idle loop to:
	  o Process deferred completions once a qfreeze event has taken full
	    effect.
	  o Thaw the queue once the sequencer and host qfreeze counts match.

	Generate 64bit completion entries passing the SCB_SGPTR field as the
	"good status" indicator.  The first bit in this field is only set if
	we have a valid status packet to send to the host.

	Convert the COMPLETE_DMA_SCB list to an "stailq".

	When using "setjmp" to register an idle loop handler, do not combine
	the "ret" with the block move to pop the stack address in the same
	instruction.  At least on the A, this results in a return to the setjmp
	caller, not to the new address at the top of the stack.  Since we want
	the latter (we want the newly registered handler to only be invoked from
	the idle loop), we must use a separate ret instruction.

	Add a few missing critical sections.

	Close a race condition that can occur on Rev A. silicon.  If both FIFOs
	happen to be allocated before the sequencer has a chance to service the
	FIFO that was allocated first, we must take special care to service the
	FIFO that is not active on the SCSI bus first.  This guarantees that a
	FIFO will be freed to handle any snapshot requests for the FIFO that is
	still on the bus.  Chosing the incorrect FIFO will result in deadlock.

	Update comments.

aic79xx_inline.h
	Correct the offset calculation for the syncing of our qoutfifo.

	Update ahd_check_cmdcmpltqueues() for the larger completion entries.

aic79xx_pci.c:
	Attach to HostRAID controllers by default.  In the future I may add a
	sysctl to modify the behavior, but since FreeBSD does not have any
	HostRAID drivers, failing to attach just results in more email and
	bug reports for the author.

MFC After: 1week
2004-02-04 16:38:38 +00:00
..
aac Take the plunge and make this driver be INTR_FAST. This re-arranges the 2004-01-30 07:04:39 +00:00
acpi_support Only remove the handler if we installed it. 2004-01-12 19:35:31 +00:00
acpica Notify the user (at kern.emerg) that the system will be shutting down if 2004-02-03 04:18:56 +00:00
adlink
advansys
agp - Disable AGP on ALI chipsets if aperture size is 0. 2003-11-11 21:49:18 +00:00
aha Save the device so we can do a device_printf. 2003-11-13 04:14:53 +00:00
ahb
aic
aic7xxx aic79xx.c: 2004-02-04 16:38:38 +00:00
amd Setting pccb->ccb_h.status to CAM_REQ_CMP one time is enough. 2004-01-21 10:49:42 +00:00
amr
an Remove the HACK section it breaks the older firmware and doesn't totally 2004-01-10 03:02:04 +00:00
ar Get rid of the last two uses of NG_NODELEN + 1 in the base system by 2004-01-26 16:41:21 +00:00
asr
ata Move the enabling of interrupt back to where it was some time ago. 2004-02-02 15:49:01 +00:00
ath When draining the tx queue reclaim any node references held in packets. 2004-01-07 19:16:49 +00:00
atkbdc Significantly reduce the "jitter" that is typical for PS/2 mice 2003-12-11 11:28:11 +00:00
awi Correct beacon (src/bssid) for hostap and adhoc mode. 2004-01-15 13:30:06 +00:00
bfe Drop the driver lock around calls to if_input to avoid a LOR when 2003-11-14 19:00:32 +00:00
bge Fix typo in a comment 2004-01-13 11:31:09 +00:00
bktr Use contigmalloc() instead of vm_page_alloc_contig(). 2004-01-14 00:52:53 +00:00
buslogic
cardbus
ciss Fixed a memory leak. 2004-01-18 16:55:01 +00:00
cm
cnw
cs
ct
cx Updated cx driver commit part 1: bring in the new kernel driver. 2003-12-03 07:29:38 +00:00
cy Fixed some minor indentation bugs. 2003-12-02 12:47:08 +00:00
dc Some integrated Davicom cards in sparc64 boxes have an all zeros 2004-01-08 19:08:27 +00:00
dcons Move post dmamap_load processes into the callback function. 2003-11-08 16:26:22 +00:00
de
dec
digi
dpt - Handle failure of cam_sim_alloc(). 2004-01-17 05:57:52 +00:00
drm Merge from DRI CVS. No longer maps the framebuffer into KVA on radeon, r128, 2004-01-06 04:34:53 +00:00
ed Added TDK LAK-CD031 (simple NE2000 device). 2003-12-31 04:25:00 +00:00
eisa
em Don't call em_stop() from the watchdog since it requires the controller 2003-12-07 06:50:04 +00:00
en Move the locking of the softc up to before the allocation of the 2003-12-17 10:01:46 +00:00
ep
ex
exca
fatm Fix 0 / NULL mixup (this module isn't in LINT!) 2003-12-24 05:24:24 +00:00
fb __powerpc__ conditional code for the syscons OpenFirmware/PPC framebuffer. 2004-01-21 05:08:51 +00:00
fdc
fe Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones. 2003-12-08 07:54:15 +00:00
firewire Add NEC uPD72873. 2004-01-30 14:30:19 +00:00
fxp Sometimes cardbus attachments don't attach, so while we track down 2003-11-28 05:28:29 +00:00
gem Add new Apple GEM PCI id. 2004-02-02 01:11:39 +00:00
gfb Catch a few places where NULL (pointer) was used where 0 (integer) was 2003-12-23 02:36:43 +00:00
gx Avoid overwriting capability bits marked earlier 2004-01-18 10:15:48 +00:00
harp
hatm change NULL to 0 to silence warning. 2003-12-24 18:23:02 +00:00
hfa
hifn Add CRD_F_KEY_EXPLICIT which allows the key to be changed per 2004-02-02 17:06:34 +00:00
hme
ic Add a header for the i8259A register definitions. This is based on 2004-01-06 18:59:37 +00:00
ichsmb
ida Add a per controller IOCTL interface. 2004-01-15 06:37:52 +00:00
idt Use contigmalloc() instead of vm_page_alloc_contig(). Pass M_ZERO to 2004-01-14 06:14:35 +00:00
ie
if_ndis Implement support for single packet sends. The Intel Centrino driver 2004-02-03 07:39:23 +00:00
iicbus o eliminate widespread on-stack mbuf use for bpf by introducing 2003-12-28 03:56:00 +00:00
iir
ips Fixed a memory leak. 2004-01-18 17:34:11 +00:00
isp Fix a bug where we never managed to include the sense data we wanted to send. 2004-01-29 06:36:30 +00:00
ispfw Update firmware sets for the 12160, 2200 and 2300 cards to the (more or 2004-01-14 18:38:03 +00:00
joy
kbd While USB keyboards attach as ukbd[0-9]+, the device node created by 2004-01-27 15:40:30 +00:00
led DUH! 2003-12-12 12:17:28 +00:00
lge Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones. 2003-12-08 07:54:15 +00:00
lnc Fix the PCI attach routine to properly setup the IRQ and port resource 2004-01-22 16:07:03 +00:00
matcd
mc146818
mca
mcd
md Allow specification of a geometry for vnode backed devices as well as 2004-01-12 10:52:00 +00:00
mii Make sure set the media type in the phy, we cannot trust it to have chosen 2004-01-17 10:44:39 +00:00
mk48txx
mlx
mly Fixed a memory leak. 2004-01-18 12:49:36 +00:00
mpt Catch a few places where NULL (pointer) was used where 0 (integer) was 2003-12-23 02:36:43 +00:00
mse - Implement selwakeuppri() which allows raising the priority of a 2003-11-09 09:17:26 +00:00
musycc
my Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones. 2003-12-08 07:54:15 +00:00
ncv
nge Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones. 2003-12-08 07:54:15 +00:00
nmdm - Implement selwakeuppri() which allows raising the priority of a 2003-11-09 09:17:26 +00:00
nsp
null
ofw - add an identify method, since the disk device used to be picked 2004-02-04 12:52:57 +00:00
owi Nursemaid: Fix compilation. 2003-12-10 15:09:38 +00:00
patm
pccard Sync to pccarddevs 1.81. 2004-01-21 16:03:40 +00:00
pccbb MFp4: 2004-01-04 22:10:00 +00:00
pcf
pci It appears that the changes in the resources allocated is causing much 2004-01-17 21:54:04 +00:00
pcic
pdq Use contigmalloc() and contigfree() instead of vm_page_alloc_contig() and 2004-01-13 20:36:03 +00:00
ppbus Apparently there's a good reason why M_WAITOK malloc() is done before 2004-01-18 13:09:38 +00:00
ppc
pst
puc Add support for an non-branded SUN1889-based 2 port PCI serial card. 2003-12-31 17:51:18 +00:00
raidframe Fixed another 0 (actually '\0') vs / NULL mixup. This completes 2003-12-25 11:17:01 +00:00
random Fix a major faux pas of mine. I was causing 2 very bad things to 2003-11-20 15:35:48 +00:00
ray fix warnings. NULL -> 0 2003-12-24 19:00:49 +00:00
rc
re Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones. 2003-12-08 07:54:15 +00:00
rndtest
rp
sab - Implement selwakeuppri() which allows raising the priority of a 2003-11-09 09:17:26 +00:00
safe
sbni
sbsh
scd
sf Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones. 2003-12-08 07:54:15 +00:00
si
sio Fixed a memory leak. 2004-01-18 12:26:33 +00:00
sk Fix multicast and promiscuous mode handling for Yukon devices. 2004-01-21 22:32:15 +00:00
smbus
sn Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones. 2003-12-08 07:54:15 +00:00
snc
snp - Implement selwakeuppri() which allows raising the priority of a 2003-11-09 09:17:26 +00:00
sound Add dependency to snd_via8233 2004-01-29 14:11:03 +00:00
speaker
sr Get rid of the last two uses of NG_NODELEN + 1 in the base system by 2004-01-26 16:41:21 +00:00
stg Fix some becuase -> because typos. 2003-12-17 16:12:01 +00:00
streams
sym unifdef old interface support out to prevent false positives. 2003-12-07 05:17:13 +00:00
syscons __powerpc__ conditional code for the syscons OpenFirmware/PPC framebuffer. 2004-01-21 05:08:51 +00:00
tdfx
tga
ti Drop the driver lock around calls to if_input to avoid a LOR when 2003-11-14 19:00:32 +00:00
trm Remove duplicate __FBSDID(). 2004-01-09 23:30:31 +00:00
twe After extensive QA cycles at 3ware, bring the driver in-line with all the 2003-12-02 07:57:20 +00:00
tx Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones. 2003-12-08 07:54:15 +00:00
txp
uart Sometimes cardbus attachments don't attach, so while we track down 2003-11-28 05:28:29 +00:00
ubsec
usb MFNetBSD: URL updates(rev.1.108) 2004-02-02 15:00:15 +00:00
utopia
vinum initsd: For striped and RAID-[45] plexes, don't restrict the I/O 2003-12-15 00:45:53 +00:00
vr Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones. 2003-12-08 07:54:15 +00:00
vx
wds
wi update radiotap support to reflect recent changes: 2003-12-28 06:58:52 +00:00
wl Drop the driver lock around calls to if_input to avoid a LOR when 2003-11-14 19:00:32 +00:00
xe Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones. 2003-12-08 07:54:15 +00:00
zs - Implement selwakeuppri() which allows raising the priority of a 2003-11-09 09:17:26 +00:00