Commit Graph

8884 Commits

Author SHA1 Message Date
Poul-Henning Kamp
182a9f7455 Make nokqfilter() return the correct return value.
Ditch the D_KQFILTER flag which was used to prevent calling NULL pointers.
2003-03-03 16:24:47 +00:00
Hidetoshi Shimokawa
46ce9fefe5 Simplify ORB queue management.
Don't send doorbell and send ORB pointer only if it's necessary.
This reduces bus traffic and interrupts much.
2003-03-03 15:27:29 +00:00
Poul-Henning Kamp
ebe789d61c Add a "-S sectorsize" option to enable Kirk to find a bug :-) 2003-03-03 13:05:00 +00:00
Poul-Henning Kamp
a8b182112d Don't initialize d_kqfilter to 0. 2003-03-03 12:48:14 +00:00
Poul-Henning Kamp
7ac40f5f59 Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by:    re(scottl)
2003-03-03 12:15:54 +00:00
Søren Schmidt
3cb179a848 Minor cleanup of the Promise code. 2003-03-03 11:51:08 +00:00
Søren Schmidt
c55607ce1f Always set the setmode funcptr. 2003-03-03 11:15:32 +00:00
Hidetoshi Shimokawa
dcae7539cb Defer allowing async. requests after self ID's have received.
This should fix some problem of SBP2 device probing.

Prior to rev 1.41, we keep writing the register while bus reset phase.
But in rev 1.41, we ignore successive bus reset events and some chips seem to
clear the register after we write to it.

Tested by: Michael Reifenberger <root@nihil.reifenberger.com>
2003-03-03 04:10:56 +00:00
Poul-Henning Kamp
dd7a14618b Spell noread() and nowrite() correctly (ie: not "NULL") 2003-03-02 19:23:31 +00:00
Poul-Henning Kamp
a36ef7f365 Don't use evil casts in cdevsw initialization. 2003-03-02 19:17:51 +00:00
Poul-Henning Kamp
95e4359c8e Use canonical format for cdevsw initialization. 2003-03-02 18:51:46 +00:00
Poul-Henning Kamp
bbaba62872 Use canonical format for cdevsw initilization. 2003-03-02 18:50:21 +00:00
Poul-Henning Kamp
7e5b777f98 Use canonical name for cdevsw initialization. 2003-03-02 18:49:26 +00:00
Poul-Henning Kamp
6fee404efa Use canonical form for cdevsw initialization. 2003-03-02 18:47:38 +00:00
Dag-Erling Smørgrav
521f364b80 More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9). 2003-03-02 16:54:40 +00:00
Poul-Henning Kamp
715b1e0ab0 Put cdevsw initialization on canonical format. 2003-03-02 16:50:09 +00:00
Poul-Henning Kamp
3dc3dda55b Fix cdevsw initialization commit to follow canonical format. 2003-03-02 16:44:46 +00:00
Poul-Henning Kamp
78b7591cc5 Format the cdevsw like all other drivers do it for improved grepability. 2003-03-02 15:32:03 +00:00
Poul-Henning Kamp
e8e018a984 NO_GEOM cleanup:
Remove cdevsw->d_psize() implementation.  It is no longer needed.
2003-03-02 14:42:52 +00:00
Poul-Henning Kamp
9a283f91c0 NO_GEOM cleanup:
mcdsize() is not a cdevsw->d_psize function (any more ?) so rename it,
give it a better prototype to avoid misusing d_psize_t.
2003-03-02 14:30:54 +00:00
Scott Long
1a3a935b84 Fix 'bulk in' and 'bulk out' being reversed in a couple of error messages. 2003-03-02 02:35:00 +00:00
Hidetoshi Shimokawa
37413f0a0f Don't reset agent before processing OCB has done. 2003-03-01 16:50:40 +00:00
Søren Schmidt
638914f17d Fix support for HPT controllers they where always left in PIO mode.
Amazing what a ';' can do :/
2003-03-01 09:33:35 +00:00
Stefan Eßer
1fa4dd2f14 Make /dev/pci use MAJOR_AUTO. 2003-03-01 08:57:16 +00:00
Scott Long
9e2e96d803 The aac driver has evolved enough over the last few months that it no
longer resembles the 4.x version very much.  Garbage collect the legacy
bits.
2003-03-01 05:07:19 +00:00
John Hay
11229bf39e Implement outgoing interrupt pipes. It is part of the USB 1.1 spec.
The Lego Infrared Tower use it.
2003-02-28 19:28:29 +00:00
Orion Hodson
19921b23b5 o Move vendor ids into separate table.
o Add assorted vendor and codec ids.
2003-02-28 18:04:52 +00:00
Warner Losh
56dd04580a ufm doesn't care what major it uses. 2003-02-28 13:23:31 +00:00
Warner Losh
cfb14e7100 These appear to work as cardbus cards too 2003-02-28 13:21:17 +00:00
Poul-Henning Kamp
3e7b60db4b NO_GEOM cleanup:
Convert to "struct disk *" centric API.

OK'ed by:	sos
2003-02-28 09:53:36 +00:00
Jake Burkholder
3fb37429df Use MAJOR_AUTO. GC statically assigned majors. 2003-02-28 04:21:13 +00:00
Justin T. Gibbs
acae33b029 aic79xx.c:
Clear the LQICRC_NLQ status should it pop up after we have
	already handled the SCSIPERR.  During some streaming operations
	this status can be delayed until the stream ends.  Without this
	change, the driver would complain about a "Missing case in
	ahd_handle_scsiint".

	In the LQOBUSFREE handler...

		Don't return the LQOMGR back to the idle state until after
		we have cleaned up ENSELO and any status related to this
		selection.  The last thing we need is the LQO manager starting
		another select-out before we have updated the execution queue.
		It is not clear whether the LQOMGR would, or would not
		start a new selection early.

		Make sure ENSELO is off prior to clearing SELDO by flushing
		device writes.

		Move assignment of the next target SCB pointer inside of
		an if to make the code clearer.  The effect is the same.

	Dump card state in both "Unexpected PKT busfree" paths.

	In ahd_reset(), set the chip to SCSI mode before reading SXFRCTL1.
	That register only exists in the SCSI mode.  Also set the mode
	explicitly to the SCSI mode after chip reset due to paranoia.
	Re-arrange code so that SXFRCTL1 is restored as quickly after the
	chip reset as possible.

	S/G structurs must be 8byte aligned.  Make this official by saying
	so in our DMA tag.

	Disable CIO bus stretch on MDFFSTAT if SHVALID is about to come
	true.  This can cause a CIO bus lockup if a PCI or PCI-X error
	occurs while the stretch is occurring - the host cannot service
	the PCI-X error since the CIO bus is locked out and SHVALID will
	never resolve.  The stretch was added in the Rev B to simplify the
	wait for SHVALID to resolve, but the code to do this in the open
	source sequencer is so simple it was never removed.

	Consistently use MAX_OFFSET for the user max syncrate set from
	non-volatile storage.  This ensures that the offset does not
	conflict with AH?_OFFSET_UNKNOWN.

	Have ahd_pause_and_flushwork set the mode to ensure that it has
	access to the registers it checks.  Also modify the checking of
	intstat so that the check against 0xFF can actually succeed if
	the INT_PEND mask is something other than 0xFF.  Although there
	are no cardbus U320 controllers, this check may be needed to
	recover from a hot-plug PCI removal that occurs without informing
	the driver.

	Fix a typo.  sg_prefetch_cnt -> sg_prefetch_align.  This fixes
	an infinite loop at card initialization if the cacheline size is 0.

aic79xx.h:
	Add AHD_EARLY_REQ_BUG bug flag.

	Fix spelling errors.

	Include the CDB's length just after the CDB pointer in the DMA'ed
	CDB case.

	Change AH?_OFFSET_UNKNOWN to 0xFF.  This is a value that the
	curr->offset can never be, unlike '0' which we previously used.
	This fixes code that only checks for a non-zero offset to
	determine if a sync negotiation is required since it will fire
	in the unknown case even if the goal is async.

aic79xx.reg:
	Add comments for LQISTAT bits indicating their names in the 7902
	data book.  We use slightly different and more descriptive names
	in the firmware.

	Fix spelling errors.

	Include the CDB's length just after the CDB pointer in the DMA'ed
	CDB case.

aic79xx.seq:
	Update comments regarding rundown of the GSFIFO to reflect reality.

	Fix spelling errors.

	Since we use an 8byte address and 1 byte length, shorten the size
	of a block move for the legacy DMA'ed CDB case from 11 to 9 bytes.

	Remove code that, assuming the abort pending feature worked, would
	set MK_MESSAGE in the SCB's control byte on completion to catch
	invalid reselections.  Since we don't see interrupts for completed
	selections, this status update could occur prior to us noticing the
	SELDO.  The "select-out" queue logic will get confused by the
	MK_MESSAGE bit being set as this is used to catch packatized
	connections where we select-out with ATN.  Since the abort pending
	feature doesn't work on any released controllers yet, this code was
	never executed.

	Add support for the AHD_EARLY_REQ_BUG.  Don't ignore persistent REQ
	assertions just because they were asserted within the bus settle delay
	window.  This allows us to tolerate devices like the GEM318 that
	violate the SCSI spec.

	Remove unintentional settnig of SG_CACHE_AVAIL.  Writing this bit
	should have no effect, but who knows...

	On the Rev A, we must wait for HDMAENACK before loading additional
	segments to avoid clobbering the address of the first segment in
	the S/G FIFO.  This resolves data-corruption issues with certain
	IBM (now Hitachi) and Fujitsu U320 drives.

	Rearrange calc_residual to avoid an extra jmp instruction.

	On RevA Silicon, if the target returns us to data-out after we
	have already trained for data-out, it is possible for us to
	transition the free running clock to data-valid before the required
	100ns P1 setup time (8 P1 assertions in fast-160 mode).  This will
	only happen if this L-Q is a continuation of a data transfer for
	which we have already prefetched data into our FIFO (LQ/Data
	followed by LQ/Data for the same write transaction).  This can
	cause some target implementations to miss the first few data
	transfers on the bus.  We detect this situation by noticing that
	this is the first data transfer after an LQ (LQIWORKONLQ true),
	that the data transfer is a continuation of a transfer already
	setup in our FIFO (SAVEPTRS interrupt), and that the transaction
	is a write (DIRECTION set in DFCNTRL). The delay is performed by
	disabling SCSIEN until we see the first REQ from the target.

	Only compile in snapshot savepointers handler for RevA silicon
	where it is enabled.

	Handle the cfg4icmd packetized interrupt.  We just need to load
	the address and count, start the DMA, and CLRCHN once the transfer
	is complete.

	Fix an oversight in the overrun handler for packetized status
	operations.  We need to wait for either CTXTDONE or an overrun
	when checking for an overrun.  The previous code did not wait
	and thus could decide that no overrun had occurred even though
	an overrun will occur on the next data-valid req.  Add some
	comment to this section for clarity.

	Use LAST_SEG_DONE instead of LASTSDONE for testing transfer
	completion in the packetized status case.  LASTSDONE may come up
	more quickly since it only records completion on the SCSI side,
	but since LAST_SEG_DONE is used everywhere else (and needs to be),
	this is less confusing.

	Add a missing invalidation of the longjmp address in the non-pack
	handler.  This code needs additional review.

aic79xx_inline.h:
	Fix spelling error.

aic79xx_osm.c:
	Set the cdb length for CDBs dma'ed from host memory.

	Add a comment indicating that, should CAM start supporting cdbs
	larger than 16bytes, the driver could store the CDB in the status
	buffer.

aic79xx_pci.c:
	Add a table entry for the 39320A.

	Added a missing comma to an error string table.

	Fix spelling errors.
2003-02-27 23:23:16 +00:00
Poul-Henning Kamp
9fc954f139 NO_GEOM cleanup:
Move <sys/conf.h> before <sys/disk.h>.
No need for raidread()/raidwrite(), we have generic code for that.
Remove non-functional dump code.
Make raidinit() return the softc, not the dev_t.
Move to "struct disk*" centric API.
Fix printfs' to get name from struct disk instead of dev_t.

OK'ed by:	scottl
2003-02-27 22:04:08 +00:00
Sam Leffler
e85eab7751 add 5801 and 5802 recognition (somehow lost in transition from openbsd)
Noticed by:	Larry Baird <lab@gta.com>
2003-02-27 21:10:20 +00:00
Nate Lawson
fdb8bf0997 Zero cpi->target_sprt since atapi-cam does not support target mode. This
gets rid of annoying messages when targbh tries to attach to the ATA bus
and gets rejected.

MFC after:	1 day
2003-02-27 20:56:56 +00:00
Bill Paul
c6d8cd1e00 Remember to set if_capenable when setting up checksum offload in fxp_attach().
Pointed out by: jlemon
2003-02-27 19:41:55 +00:00
Maxime Henrion
03ab197379 When DDB is in the kernel, unlock VTY switching so that we
don't end up freezing the box.  This makes VTY locking useless
in the DDB case but a box which is supposed to be physically
secure shouldn't compile DDB anyway.

Reviewed by:	silence on -audit
2003-02-27 18:24:06 +00:00
Mark Murray
ef8b020c73 Warns and lint fix. Nearly all trivial stuff. 2003-02-27 18:07:11 +00:00
Poul-Henning Kamp
c2b46fcca4 Add yet a patch for the patchwork quilt called sio(4):
Allow people set set flags on pci based SIO ports.
2003-02-27 14:09:36 +00:00
Poul-Henning Kamp
59c5c475f1 Typo, I must have hit xZZ in vi(1). 2003-02-27 12:53:21 +00:00
Hidetoshi Shimokawa
455454994f MFp4(simokawa_sbp branch)
Improve SBP device probeing:
- Wait 2 sec before issuing LOGIN ORB expecting the reconnection
	hold timer expires.
- Serialize management ORB and scanning LUN by CAM on each target.
	This should fix the problem for devices which have multiple LUNs.
	Test device is donated by: Jaye Mathisen <mrcpu@internetcds.com>
- Freeze SIM queue for 2 sec after BUS RESET.
- Retry with LOGIN rather than RECONNECT after LOGIN is not completed for
	BUS RESET.
- Use appropriate CAM status for BUS RESET and DEVICE RESET.
- Let CAM to scan targets after BUS REST.
- Implement CAM scan target function.
- Keep our own devq freeze count.
- Let CAM to know that SBP does tagged queuing.

These should be merged to RELENG_4 before 4.8-RELEASE.
2003-02-27 12:51:24 +00:00
Poul-Henning Kamp
6cec1852d4 Make flags bit 0x10000 mean that PPS timestamping should use the
CTS instead of the DCD pin.
2003-02-27 12:27:09 +00:00
Søren Schmidt
33c788a554 Only use function 1 not 0 on cypress chips. 2003-02-27 09:42:57 +00:00
Hartmut Brandt
dce4c82d8e When we have found a chunk of memory that is large enough and have computed
a correctly aligned address in this block we really want to check, that the
part of the chunk that starts at the aligned address is large enough with
regard to the original request. Comparing it to 0 makes no sense, because this
is always true except in the rare case, that the aligned address is just at
the end of the chunk.

Approved by:	jake (mentor)
2003-02-27 08:56:41 +00:00
Søren Schmidt
4f57804cd3 Fix UDMA modes setup on CMD chips. 2003-02-27 07:11:42 +00:00
Scott Long
4bc7efe837 Add the ID for the CS4205 codec found in Dell laptops. Obtained from
the CS4205 spec.
2003-02-27 03:51:43 +00:00
Bill Paul
c8bca6dc3d As previously threatened, add TCP/IP checksum offload support to
the fxp driver. This is enabled only for the 82550/82551 chips
(PCI revision code 12 or 13). RX and TX checksum offload are
both supported. Transmit offload is limited to TCP and UDP only
right now: there seems to be a problem with IP header checksumming
on transmit in some cases.

This chip has hardware VLAN support as well. I hope to enable
support for this eventually.
2003-02-26 22:12:04 +00:00
Poul-Henning Kamp
6d473442ca NODEVFS cleanup:
Don't call cdevsw_{add,remove}()
Bracket a more correct subset in "#if experimental"
2003-02-26 21:14:39 +00:00
Poul-Henning Kamp
f400e58886 msg 2003-02-26 21:01:26 +00:00
Poul-Henning Kamp
e4d0d8c84a msg 2003-02-26 20:53:28 +00:00