Commit Graph

696 Commits

Author SHA1 Message Date
marc 5c17882e45 move pcic_wait_ready from i82365var.h to i82365.c 1998-02-01 23:36:23 +00:00
marc 63f5e2bbc3 move pcic_wait_ready to i82365.c 1998-02-01 23:33:51 +00:00
marc 1d4b77e754 split com_attach_subr into attach stuff and per-open initialization stuff
add timeouts to all splserial() while loops so bugs elsewhere don't cause
the com driver to wedge the machine
 add power management support
1998-02-01 23:33:01 +00:00
marc a71698f108 add power management hooks to softc 1998-02-01 23:30:49 +00:00
kleink fa75c2d647 Fix two harmless typographical errors in a comment. 1998-02-01 19:25:44 +00:00
pk f3ee364e31 * Make sure the `ECB_NEXUS' flag accurately reflects the existence of
an initiator/target nexus and thus mark the correct queue (if any) a
  command is on.

* If a disconnected command times out, just leave it on the nexus queue
  and do nothing (for now). I need yet to decide on the strategy to
  follow in this case.  Note: we used to move the command to the `ready'
  queue and then do nothing, which is worse.
1998-01-31 23:37:51 +00:00
thorpej 78650a8398 Use offsetof() from libkern.h 1998-01-30 01:26:51 +00:00
thorpej a7bc6bd92c In the NE2000 case, if we encounter an unaligned mbuf, copy it to an
aligned buffer so that we can do 16-bit PIO to the device without causing
an unaligned access fault.
1998-01-29 00:59:33 +00:00
mjacob 99139bc35a Fix for port-alpha/4903- always download f/w unless config flags say
no or we have no firmware to download.
1998-01-28 19:09:24 +00:00
thorpej 2538ed1062 Use offsetof() from libkern.h 1998-01-28 02:23:04 +00:00
thorpej cdec42b6a0 Fudge the start of the data pointer of the first mbuf in the chain when
reading a packet, ensuring that the data after the Ethernet header will
be aligned.  Part of PR #4595, from Andreas Johansson <ajo@wopr.campus.luth.se>
1998-01-27 23:26:21 +00:00
thorpej 243c218061 Update copyright. 1998-01-26 20:30:06 +00:00
thorpej 044add4253 If we're using these devices on a big-endian CPU, byte swap the "count"
field in the dp8390's packet header (because the dp8390 runs in little-endian
mode in these cases).  Inspired by an e-mail from Kazuki Sakamoto.
1998-01-26 19:21:36 +00:00
pk 09559070f7 * Do not remove ATN from the scsi bus if we have no messages queued but
the target still is in MSG OUT phase. We still send a message (a NO_OP)
  in this case and the chip will remove ATN at the appropriate time.
  Using the RSTATN command here induces a "illegal command" in some
  chip revisions.

  This situation only occurs if the target rejects a previous (multi-byte)
  message early (by switching to MESSAGE IN and sending a MESSAGE REJECT)
  before the chip has completed the entire MSG OUT transfer. ATN will
  remain asserted, and the target returns to MESSAGE OUT phase.

* Account for the events above when reporting "DMA not completed"
  diagnostic messages.

* Stream-line the selection code a bit, and make the DMA setup code
  more like the MSG OUT & DATA XFER setup.
1998-01-24 15:33:35 +00:00
mycroft 753e4909bb Assume a newline has already been printed in wdcattach(). 1998-01-23 01:06:45 +00:00
drochner 94343e637a define offsets into "register window" instead of absolute ISA addresses
for better use in a bus-ified environment
1998-01-19 11:38:00 +00:00
drochner 2562f77567 Don't define absolute ISA addresses here but offsets into the
"controller window".
1998-01-18 14:41:37 +00:00
pk 94072e56f6 Move "async command" state in here. 1998-01-15 16:08:32 +00:00
pk 47505a3b6f Elaborate on "receiver not ready" conditions; we don't need a full reset
in most cases.

Move "async command" state into the softc structure.
1998-01-15 16:07:34 +00:00
cgd 24972c51a4 #include a just-added scsipi header. 1998-01-15 02:23:43 +00:00
cgd 8540a31ee3 kill a couple of unnecessary #ifs 1998-01-15 01:26:13 +00:00
cgd aaede4d8d8 Various cleanups and bug fixes to the wdc/wd code:
* Fix bug in wdc that would overflow ATAPI transfer length.
* Improve wdc probe code so that 'wdc' is probed in if present
  even if there are no drives attached, and so that it works
  properly even if the only device is an ATAPI slave.
* bus_space-ify.
* split the ISA attachment from the wdc driver, and remove
  ISA dependencies from non-ISA files.
* claim that wd and wdc are now machine-independent (probably not
  completely true, but mostly so; they at least work on arm32 and
  i386).
* Various other minor fixups and cleanups, some of which were pointed
  out by Kazuki Sakamoto.
1998-01-14 23:41:59 +00:00
enami 4b62270f85 Don't include <machine/pio.h> and <dev/isa/isavar.h>. Instead,
include <machine/bus.h> directly.
1998-01-13 03:31:42 +00:00
thorpej 1adb4489a6 Update for changes to config. 1998-01-12 20:23:38 +00:00
thorpej 06ce220790 Update for config changes. 1998-01-12 09:39:57 +00:00
thorpej 095c4c092d Adjust for config changes. 1998-01-12 09:23:08 +00:00
pk 69487f1532 * Fix a train-load of bugs, mostly present in one of these categories:
- "out of resource" errors cause receive buffer chain corruption
	- resets can confuse the interrupt handler
	- multi-cast setup causes receive buffer chain corruption
	- shared memory setup incomplete

* Enhance effiency by avoiding unnecessary shared memory access,
  improved handling of receive frame & buffer descriptors, and
  introducing an `asynchronous' option when issuing 82586 commands.

* Exclusively use offsets relative to the bus handle representing the shared
  memory area to formulate accesses to the chip's data-structures.  The
  front-ends provide glue functions that cater to the chip's endian-
  sensitivity, to perform the actual device access (note: single-byte
  accesses are done here using `bus_space_{read,write}_1()').
  This concludes the transformation into a bus-independent driver module.
1998-01-10 02:35:31 +00:00
pk f041e52c7e * Rename a bunch of chip definitions for consistency.
* Abolish C structures to access chip data-structures; instead use macros
  that take indices and offsets relative to the bus handle representing
  the chip's resources.

* Include the old version of this file wholesale, until all drivers
  have been updated to use the MI 82586 code.
1998-01-10 01:46:32 +00:00
mikel c0d8293951 fix some typos in error messages & comments 1998-01-07 08:47:54 +00:00
perry 8a98e23a48 RCSID Police. 1998-01-06 04:55:52 +00:00
perry fff05a68ab RCSID Police. 1998-01-05 07:31:05 +00:00
fvdl ffb3eaa5ea Add extra delay after wdcreset() call in wdcprobe. Needed by at least
one controller, where registers otherwise will still be inaccesible
(even though the busy bit has been reset), making the probe fail.
1997-12-24 02:01:00 +00:00
mycroft f1170022ce Don't do anything in comparam() if the line speed and flags are the same. 1997-12-16 22:52:37 +00:00
pk a8c268918b Changes from Rafal Boni to accommodate ISA driver front-ends. 1997-12-13 21:18:01 +00:00
scottr dc89550a55 Fix typo in a trace message expression. 1997-12-12 22:44:26 +00:00
thorpej 0ac93f48ea Use malloc()/free(), not geteblk()/brelse(), for the device buffer. 1997-12-07 16:09:36 +00:00
chuck d76941843e fix mixer code that was clearly untested:
- allow get/set of enums SUNAUDIO_SOURCE and SUNAUDIO_OUTPUT rather
	than returning EINVAL
 - add missing SUNAUDIO_MONITOR_CLASS case in query_devinfo
 - convert SUNAUDIO_MONITOR case from a MIXER_CLASS to a MIXER_VALUE
	like it is supposed to be
 - the labels for outputs/record class were swapped: fix it

this patch allows "mixerctl" to work properly on a sparc
1997-12-06 03:20:56 +00:00
mjacob 5ff1a34bba Add a new async notification, and also fix a bug where the queue entry
wasn't getting fully zeroed as it should be.
1997-12-05 19:41:49 +00:00
mjacob 62ac2ff851 new async code defined 1997-12-05 19:40:35 +00:00
pk 39879b883e Use a 1-character queue so polled console output can be deferred if
regular I/O has been scheduled.
1997-11-12 22:17:07 +00:00
bouyer f7c6e141e6 Various bug fixes for atapi part:
- clean up debug code
- Don't check ATAPI signature when probing ATA drives, ATAPI devices were
  detected before
- Reset controller after disks probes. The probe, with some combinations of
  ATA/ATAPI device keep it in a mostly working, but strange state (with busy
  led on)
- The WDCF_IRQ_WAIT flag is now cleared by wdc_ata_intr and wdc_atapi_intr
  when appropriate (helps recover from failure conditions)
- In wdcunwedge, send ATAPI_SOFT_RESET to non-ata drives
  (helps recover from failure conditions)
- in wdctimeout be a bit more verbose when we missed an interrupt
- Always Increment xfer->c_skip where it should be
- Set the ITSDONE flag when a polled command completed.
1997-11-05 22:19:07 +00:00
thorpej 1713a9fb07 is790 u_char -> int. 1997-11-05 07:15:42 +00:00
thorpej 03a0c2d900 Implement a simple queueing mechanism that makes these drivers much
more robust in resource shortage situations, basically identical to
code I added to the "ahc" driver some time ago.

Thanks to Brad Spencer for the testing help.
1997-11-04 05:58:22 +00:00
mycroft 47c2d7502f Actually use TIOCFLAG_CDTRCTS. 1997-11-03 16:30:54 +00:00
mycroft 0e16ca013b Always leave DCD_IE and CTS_IE on for now. Needs more work in zsparam() to
make the optimization actually work right.
1997-11-03 16:15:47 +00:00
mycroft 37e260f4a6 Leave the console running with or without DDB. 1997-11-03 15:35:42 +00:00
mycroft 13e9b38191 Slight optimization in soft input routine. 1997-11-03 08:20:35 +00:00
mycroft ce29cdf2e7 Set the ring size back to 2k. 1997-11-03 06:56:28 +00:00
mycroft 9b9cce6084 Mostly cosmetic and performance changes:
* Make the ring buffer size and water marks patchable, and allocate the buffer
  separately.
* Do the ttymalloc() at attach time.
* Reorganize the receive buffer so the status and data pair are next to each
  other.  This is slightly faster.
* Make sure we actually do turn off interrupts in comclose() if we have DDB
  configured and it's not the console.  (D'oh!!!!)
* When we exhaust the current transmit run, turn off transmit interrupts in
  comintr(), so we're fairly sure we don't get another one.
* Nuke the silly lsrmap[] idea; it's slower in the normal case.
* Cache the l_rint pointer in the soft interrupt routine.
1997-11-03 06:55:54 +00:00
mycroft 7d7ecb9200 Bug fixes:
* Carrier detect (TS_CARR_ON) is based on the actual DCD bit, even if it's
  being ignored.
* Set TS_WOPEN early on in zsopen().
* Don't disable interrupts on the console during close if we have DDB.

Inert changes:
* Don't handle ZS_HWFLAG_NO_DCD here; the frontend does it.
* Deprecate `register'.
* Use SET(), CLR(), and ISSET().

More performance changes:
* Rototill receive handling; use a backpressure mechanism to prevent livelock.
* Output silo/ibuf overflow warnings at most once per minute, from a callout.
* When we exhaust the current transmit run, turn off transmit interrupts in
  zstty_txint(), so we're fairly sure we don't get another one.
1997-11-03 06:16:43 +00:00