- No more distinction between i/o-mapped and memory-mapped
devices. It's all "bus space" now, and space tags
differentiate the space with finer grain than the
bus chipset tag.
- Add memory barrier methods.
- Implement space alloc/free methods.
- Implement region read/write methods (like memcpy to/from
bus space).
This interface provides a better abstraction for dealing with
machine-independent chipset drivers.
- No more distinction between i/o-mapped and memory-mapped
devices. It's all "bus space" now, and space tags
differentiate the space with finer grain than the
bus chipset tag.
- Add memory barrier methods.
- Implement space alloc/free methods.
- Implement region read/write methods (like memcpy to/from
bus space).
This interface provides a better abstraction for dealing with
machine-independent chipset drivers.
prototypes, and suppress a bogus "might be used uninitialized" warning.
It's clear from reading the logic of the function that produces the
warning that the variable will not be used uninitialized, but the
compiler just isn't smart enough, I guess. Marked XXX for future reference.
restart if we get multiple status interrupts before the softintr()
routine gets a chance to run. The fix is to determine and accumulate
status line changes at the H/W interrupt level, and then check and zero
the accumulated changes when the softint() finally runs. Many thanks
to Bill Studenmund <wrstuden@loki.stanford.edu> for finding and fixing.
dev/microcode/aic7xxx_seq.h,
dev/ic/aic7xxxreg.h:
Remove intrinsic knowledge about SDTR and WDTR messages and replace it
with a generic message system that allows the kernel driver to handle
SDTR, WDTR and any other type of extended message it chooses too. This
makes the sequencer code much simpler, makes extended message handling
debuggable since the bulk of the work is in the kernel driver, and saves
lots of instruction space.
Regen microcode header file.
dev/ic/aic7xxx.c, dev/ic/aic7xxxvar.h:
Add code to handle WDTR and SDTR negotiation in light of the changes in
the message interface to the sequencer. Don't reject targets that
negotiate async by sending an SDTR with a 0 offset. Use an sdtr message
with 0,0 to negotiate async when a target suggests a period that is too
long for us to handle. Some tape and cdrom drives don't like us doing
the message reject that we did in the past.
Fix a problem with handing the QUEUE FULL condition.
Fix a race condition (most likely the cause of the SCB paging problems) that
might allow the sequencer to get unpaused before the condition that caused
it to be paused (a SEQINT) was handled.
Race condition pointed out by Doug Ledford <dledford@dialnet.net> and
by "Dan Willis" <dan@plutotech.com>.
dev/pci/ahc_pci.c:
Add support for the 2940AU, an aic7860 based controller.
dev/pci/pcidevs.h, dev/pci/pcidevs_data.h:
Add product IDs for the 2940AU, aic7860 and aic7855.
Regen data file.
scsi/scsi_message.h:
Add MSG_EXT_SDTR_LEN and MSG_EXT_WDTR_LEN - the length of bytes in these
extended messages.
Thanks to Chuck Cranor <chuck@maria.wustl.edu> for testing these changes
out for me.
multi-channel driver), or to SCSI_CHANNEL_ONLY_ONE if a
single-channel driver.
(2) use scsiprint() rather than a locally-defined autoconfig print
function, and kill any locally-defined print function.
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
- adjust txhiwat and mindma params a bit
- fixed a couple of incorrectly labeled panic calls
- the "location" was being calculated incorrectly in some cases (forgot
to subtract off MID_RAMBASE). this only caused problem when trying
to change the size of the tx/rx buffers (e.g. to 64KB).
- fixed possible non-aligned DMA burst in the starting byte burst case.
(e.g. if we could DMA 3 bytes, but only have 2 it is not legal
for us to use MIDDMA_BYTE2 mode).
- opt: on tx: try and avoid flushing the internal buffer by padding out the
length of the last mbuf a bit (if possible)
- merged multiple DRQ/DTQ ADD macros into a single DRQ and a single DTQ
macro with a uniform interface to make the code simpler and easier to read.
- en_start: only update atm_flags if EN_MBUF_OPT is enabled (which it
should be)
- for alburst: make sure we don't DMA more bytes than we need (on both
tx and rx). if the alburst is larger than we need, drop to
MIDDMA_WORD mode.
- major change: enable the use of byte and 2 byte DMA on the trasmit side.
this allows us to DMA from non-word sized/aligned mbufs directly.
[the old code would always call en_mfix which would copy (or move) the
data in order to ensure proper alignment... it turns out TCP gives
us non-word sized/aligned mbufs when it is retransmitting, so we needed
to handle this case more efficiently.] the following functions
were changed to make this work:
- en_dqneed: add an arg to let us know if we are transmitting or not.
if we are TX, then we must take into account byte DMAs when
estimating the number of DTQs we will need for a buffer
- en_start: only mfix mbufs if DMA is disabled
- en_txdma: only set launch.nodma if we have en_mfix'd the mbuf chain
also, we may need a DTQ to flush the chip's internal byte buffer
- en_txlaunch: only attempt a copy if we have the proper alignment.
add byte dma code for the front and end of the buffer.
make sure the internal dma buffer is flushed out.
- stats: keep track of how many times we have to use byte sized DMA
midwayreg:
- add byte/2byte DMA defines
midwayvar:
- add new stat counter to monitor less-than-word lengthed DMA
- en_mfix shouldn't touch M_EXT mbufs. change to avoid this [at
the expense of allocating a new cluster mbuf to copy to].
XXX: en_mfix is getting called more often than I hoped it would
(seems to happen when TCP retransmits... we get all sorts of odd
sized, odd lengthed data mbufs, yuck). i may revise the xmit
DMA code to use non-word sized dma.
- don't try and add a PDU trailer (or TBD for that matter) to an M_EXT
mbuf. when M_EXT is set, the data area of the mbuf can be shared
with other mbufs (see m_copym()), and writing to one M_EXT mbuf may
invalidate another M_EXT mbuf (saw this with PDU trailers).
- be sure to validate the length value from the PDU trailer so that it
doesn't throw us out of sync with the chip (fixes yet another source
of the dread "en_service: id mismatch" panic).
- on recv, don't bother allocating an mbuf if mlen is zero since we are
only going to toss the data anyway.
function is called when carrier is lost in lieu of a console message.
This is used by the sparc port to switch media types on Sun4m machines
if the appropriate link flags are set by ifconfig (see following commit
message). Should not affect ports that do not use sc_nocarrier().
to ignore inbound data sizes less than the threshold. otherwise,
when connected to a video aal0 input the driver gives us a massive
stream of 56 byte mbufs each with one aal0 cell in it and the
system just can't keep up with it, especially if the socket buffer
size is large [it hangs until you turn off the video source].
fixes: when turning off a vc, try and check the freshest copy of the mode
when seeing if we need to enter the "drain" state. also, don't
panic if we get unexpected rx interrupt on a VCI (instead make sure
the VC is off, print a warning, and move on!).
- change rxso into a void handle ... no need to know details at this low
level.
fix:
- forgot to init "vci" during ENOTHER_DRAIN case of RX DMA interrupt
[could cause a vm_fault on native mode connection close depending
on needing to drain out the VC and also the random value of vci]
- more stat counters (rxmbufout -- mbufs, ttrash -- trashed RBD)
- add swsl_size to keep track of size of software slist
- revise when we call en_service
- fix handling of circular lists (was getting full vs empty confused in
extreem cases...)
- native mode atm: remove sbappend code: can't do it here since
socket buffer is protected only by splsoftnet and that doesn't
mask enintr off. forces us to switch to a two level interrupt
scheme. revise call to atm_input to reflect that.
[1] rxslot "cur" pointer wasn't updated if we copied all data and
didn't have any fill. this could cause a service id mismatch
panic under load.
[2] recv of aal0 forgot to include the cell header in the data length
calc [add cell header length to midwayreg.h]
[3] fix control info "chop" for raw mode and aal0
[4] handle rxsb better for native atm connections
(XXX: still working on this ... not complete and needs revision)
to the ring (or silo). This eliminates ring overrun with crtscts.
Also handle deferred register changes earlier, and misc. cleanup.
Give credit to: Bill Studenmund and Ian Dall (Thanks!)
bits that tell the driver not to expect parity from those targets.
XXX: For now, it is up to MD code to set this mask. Eventually,
XXX: we should identify targets first (without demanding parity)
XXX: and then use a new "SCSI quirk" to set the right bit.
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_reset)()
to take a struct ifnet *, rather than a unit number.
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_start)()
to take a struct ifnet *, rather than a unit number.
naming conflicts between bus attachments on ports that can have
multiple instances of the LANCE.
Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_start)()
to take a struct ifnet *, rather than a unit number.
(and only tested on) Intel Etherexpress PRO. Should work on any i82595 ISA
board which uses an EEPROM for config information; NETBLKID not yet supported.
TODO: change to BUS interface, add multicast support.
bus-independent core driver. Tested on all three bus types, including
an isa 3c509 masquerading as an eisa device (use ep* at eisa? slot ? in
your kernel config file to catch this one).
XXX Driver still needs to be converted to <machine/bus.h>
remove their 'integrate' (usually defined to be 'static') keywords.
when lance drivers are split up by attachment, more than one file will
reference the copy/zero functions (i.e. not just the file that pulls in
am7990.c... and eventually inclusion of am7990.c should go away entirely).
'cflag' for the console. Normally set to TTYDEF_CFLAG, may be
overridden by machine-dependent console attachment code, as necessary.
(Alpha uses it to set cs8 -parenb.) Files including comvar.h now
need to include <sys/termios.h>, because comconscflag is of type
tcflag_t.
* Add an ACB_RESET flag, so that a BUS DEVICE RESET can be queued within the
driver.
* If ACB_ABORT or ACB_RESET is set during reselection, schedule a message and
assert ATN.
* Optimize aic_datain_pio(), aic_dataout_pio() and aicintr() somewhat.
* Schedule a timeout only when we select the target, so that commands can't
time out prematurely.
1) If we get an unexpected disconnect, issue a REQUEST SENSE, as recommended
by the SCSI-2 spec. If the target created a contingent allegiance condition,
this will clear it. Also, if it happened while sending a SDTR or WDTR message,
disable negotiation for that target.
2) Since some lame devices still don't deal correctly, make sure we deassert
ATN if our last message out is interrupted. If we get a MESSAGE PARITY ERROR,
we'll reassert ATN anyway. This should ensure that we never have to send a
MESSAGE NO OPERATION.
3) Set AIC_ABORTING only when actually sending a BUS DEVICE RESET or ABORT,
so we get better error detection.
4) Other internal reorganization of no consequence.
the "Fast Assembler Version of the copy loop)
- Yet another sanity check included: initialize unused receive buffers to
zero sender id; and test for sender hardware id of zero in the receiver.
Gives us better error messages in case flaky hardware causes spurious
receive interupts.
only include the relevant code in the probe & attach functions. Still
one probe and one attach function, with #ifdefs, but this is a step
in the right direction and saves a few hundred bytes (ooh, ahh!).
- split softc size and match/attach out from cfdriver into
a new struct cfattach.
- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
- split softc size and match/attach out from cfdriver into
a new struct cfattach.
- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
- split softc size and match/attach out from cfdriver into
a new struct cfattach.
- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
substantial reworking of the multi-port drivers, as they need to frob
bits in the io-port spaces of their children. As a result, the
commulti->com attachment interface is substantially more complex.
(This may be fixable in the future by making some of the code common,
but as long as io-port allocation checking is planned, it's necessary.)
detatch everywhere else. Reverted to the english spelling.
Also fixed the rest of the prototype warnings while I was at it.
ic/ncr5380sbc.c: Don't declare Debugger()... I have to clean this
everywhere :-(
if the CPP symbols LE_TINT_HOOK and LE_RINT_HOOK are defined, respectively.
The hooks are called by jumping though the sc_tint_hook and sc_rint_hook
members of the softc, and take the softc as an argument. Only ports which
need these hooks need to declare them in the softc.
and for the PCI attachment of said chipset ("if_fpa"), also from Matt Thomas.
Arguably, pdq* doesn't belong in sys/dev/ic, but it's going to be shared by
various bus attachment devices at some point in the future, and there's no
other place that seems to fit as well.
latter would lead to undefined symbols if DDB not defined.
(2) check for break on console, and therefore debugger entry (if ddb
in kernel) earlier, so that the device doesn't need to be open.
(3) return immediately after breaking into the debugger in comeint().
(4) only do the normal character input routine in comintr if receive
mask yeilds _EXACLTY_ LSR_RXRDY. if there's only a receive
error, or there's a receive error _and_ a received character,
do comeint().
(former two by me. latter two from Bob Baron <rvb@cs.cmu.edu>.)
changes by me:
* Make autoconfiguration work correctly for more models of AT1700.
* Make the debugging code more robust and complete.
* Tweak the output routine for better performance, and to eliminate an ugly
kluge.
Various other style cleanup. Needs more work.
* Make synchronous negotiation work.
* Use the bitbucket when the target requests too much data.
* Loop in aicintr() until we get to a state where we have to wait.
* Always enable disconnection.
* Add some more per-controller variables: initiator ID, clock frequency,
min and max sync period.
* Correct sync period calculations.
* Remove sc_progress.
* Move most of the reselection handling into a separate function.
* Remove some outdated comments.
* Remove message bytes from FIFO even when dropping them on the floor.
* Some cosmetic cleanup.
round: moving the drivers into a machine-independent directory.
Some drivers (e.g. fd.c) not moved because they use other pc features (e.g.
CMOS settings), and none of the non-driver files moved, because they're
still pretty much PC specific. eventually (when other ports with ISA
busses really start using this code), more 'high-level' ISA support will
live here.
message outs should now work correctly (including retransmissions).
Multiple messages ins should be more efficient. Missing REQ after
reselection phase should now (correctly) cause a wait with ENREQINIT
set.
* Abstract out the reselection out sequence, and use it directly to
get sense info. (This is somewhat faster than the generic done/sched
sequence.)
* If there are no ACBs available, wait interruptibly for one.
* Leave the interrupt registers alone during message in/out; just
watch for phase change. Don't (incorrectly) reenable interrupts
during data in/out; defer that to aicintr().
* Handle command pointer per SCSI 2 spec.
* Other minor coding improvements.