the base address. This allows for a more flexible layout of buffers
in the Lance's memory.
- Add a new element 'sc_saved_csr0' to am7990_softc. It's value is or-ed
with the current csr0 value in the am7990_intr() function. This allowes
for a 'deferred' interrupt sceme.
to prepare for if_media, and to support EISA 3c59x cards:
* change epconfig() to take a short that encodes the chipset
type (3c509, or Demon/Vortex/Boomerang).
* add distinct 3c509 and Demon/Vortex/Boomerang media-sense
functions to back end.
* Add EISA match/attach support for the 3c592 and 3c597
(Demon) cards as well as the 3c509-comatibl EISA 3c509/3c579.
* Assume that ISA and ISA PnP cards are 3c509-style, until
proof to the contrary (e.g. large packet support).
Tested on 3c595, 3c590, and 3c509b. Not tested on 3c515 or Demon.
(RX_RESET, TX_RESET, GLOBAL_RESET).
Commands issued while a reset is in progress may be dropped. The driver
must wait until resets are complete; ep_complete_cmd() does so.
* Change RX_RESET, TX_RESET, GLOBAL_RESET to use ep_complete_cmd().
* Revert epconfig() to use inline RX_RESET, TX_RESET.
That avoids accidentally setting IFF_UP, which breaks both diskless boot,
and "halt" commands issued before the interface is brought up.
- if aal5 frame has a CRC error then the length field in the aal5 trailer
may not be valid, so we can not use it [and we must dump the frame]
[Yuhang Sun <sunyh@dworkin.wustl.edu> & chuck@ccrc.wustl.edu]
Newer boards (e.g., Vortex) take time to reset, and wedge on some machines.
Polling on S_COMMAND_IN_PROGRESS would be better, but that doesn't
work with xx_RESET commands on 3c509s.
CONFIG_CNTRL bits by making the "conn" argument to epconfig()
a u_int, not a u_int16_t, and by defining 100mbit media
bits in the upper 16 bits.
A redesigned interface that fixes this properly is in the pipeline.
comments in pr port-i386/2358: "if_ep/3C590 no longer working"
* Only call Vortex media-config code on PCI-attached devices, until
we know if it works on ISA and EISA large-packet devices also.
* Fix typo in printf of MAC address
look for 100mbit Xcvrs, print their names, add to ep_connectors.
* Print 10baseT as 10baseT, since media name (utp) is no longer a unique
transceiver type.
* Redo FIFO memory size printing, also show Tx/Rx split (xxx isa 3c509?).
* Print MAC address on a separate line, with 100Mbit media and fifo-ram
info it no longer fits on the same line as media types.
* Comment the fact that the "connection" media-selection code just doesn't
grok 100Mbit media.
* add code to look for 3c59x/3c90x media-select and autoconfig bits, though
we don't yet dynamically probe media when the autoconfig bit is set
(see previous bullet).
* XXX the whole connector/media code should be redone, perhaps a' la
the BSDI ifmedia design.
For now, we really only need 8 bits of media type.
* Add bogus definitions for 100mbit transcievers, to be set in the
"conn" argument to ep_config(). Should really use the same bits
as in EP_W0_CONFIG_CTRL bits, but I don't know what bits the 3c515
&c use for 100mbit media.
* Define bitflags for 100Mbit transceiver options in ep_connectors.
* Add definitions of powerup/powerdown commands. for interfaces with
power management. Should send a powerup after APM resume?
* Add definition of fragment-busmaster (vortex) START_DMA command.
* Add definition of PCI configuration-space media-present bits.
(really just EP_W3_RESET_OPTIONS remapped into pci config space.)
* Add comments describing what the #define's above are used for.
For now, we really only need 8 bits of media type.
* Add bogus definitions for 100mbit transcievers, to be set in the
"conn" argument to ep_config(). Should really use the same bits
as in EP_W0_CONFIG_CTRL bits, but I don't know what bits the 3c515
&c use for 100mbit media.
* Define bitflags for 100Mbit transceiver options in ep_connectors.
* Add definitions of powerup/powerdown commands. for interfaces with
power management. Should send a powerup after APM resume?
* Add definition of fragment-busmaster (vortex) START_DMA command.
* Add definition of PCI configuration-space media-present bits.
(really just EP_W3_RESET_OPTIONS remapped into pci config space.)
* Add comments describing what the #define's above are used for.
bit from the extended setup inquiry and key off it to:
- Force synchronous negotiation on targs > 7.
- Read additional information returned by wide cards on inquire setup.
- Read sync period on targs > 7.
- Display sync period/offset on targs > 7.
- Set scsi_link.max_target to 15.
cvs: ----------------------------------------------------------------------
Add newline to `Interface disabled' printf and clean up formatting.
Change packet read/write code to align all reads and writes into
memory to an appropriate boundary for the I/O size. This also fixes
a bug where the trailing unaligned bytes (1-3 of them) would be
put in an additional mbuf even if there was enough space for them
in the one we were currently filling.
This has been tested on a 3c905 in an Alpha (32-bit I/O, alignment
required), a 3c905 in an i386 (32-bit I/O, alignment not required)
and a 3c509 in an i386 (16-bit I/O, alignment not required). It
should be tested on a 3c509 in an Alpha with an ISA bus, if somone
can manage to get the two items together.
There are still some bugs in the driver relating to initialisation;
on my Alpha with a 3c905 you need to do an `ifconfig ep0 down;
ifconfig ep0 up' after the initial ifconfig to make it start working.
Apparently there are also some problems with a 3c579 in an i386,
although a 3c905 in an i386 works just fine.
(e.g. from 0x3bc to 0x3bf, for example). Others may require more,
but until there's some special handling for them, 4 should be returned
so that on systems with I/O port accounting, the unit at 0x3bf can be
properly mapped, etc. (OK'd by mycroft.)
1. fix possible hang in en_txlaunch(). when attempting to extend
the length of an mbuf to avoid a flush we should extend it
by cnt [which is ((need - len) % 4)] rather than 4 - cnt.
also, add an EN_DEBUG printf() when we pad/FLUSH a buffer
to help with debugging/understanding what the driver is up to.
2. use interface packet counters
3. when turning off a recv VCI we recompute the new mode. make sure
we don't include the "in service" bit in the new mode, otherwise
a VCI may appear "hung" if you turn it off while a service
interrupt is pending.
4. when shutting down a VCI that is still receiving data, don't bother
going into "drain mode" if only the hardware in service bit is
set (otherwise the VCI may get "hung" in drain mode).
as a result of this we may get "unexpected rx interrupt" messages
which are not really an error, so put this printf in EN_DEBUG.
5. be sure to zero txspeed[lcv] when enabling a VCI (start at full
speed). (hooks for setting txspeed[] are currently not in
the driver, but we are playing with it locally).
credits:
#1: Detected by: Zdenek Salvet <salvet@horn.ics.muni.cz>, fix by me.
#2: Contributed by: Zdenek Salvet <salvet@horn.ics.muni.cz>
#3,#4,#5: Detected by: Milind M. Buddhikot <milind@dworkin.wustl.edu>,
fixed by me.
* Add a slot in the softc, ep_pktlenshift, to indicate that
a board implements ``large packets'' (FDDI-sized frames) and
therefore implicitly shifts the argument to packet-length commands
by two bits to fit a 13-bit length in an 11-bit command argument field.
* Change the reset of station-mask filterto be independent of bus-type
(e.g.,. for 3c515)
* Replace the "2044" constant used to disable TX threshold interrupts
on 3c509-generation cards with a #define. Use 2047 instead,
since that works on the large-packet cards (Vortex, Demon, Boomerang)
and 2044 doesn't.
* Add code to epconfing to probe for large-packet support,
set the softc appropriately, and shift packet sizes in commands
by ep_pktlenshift to compensate for the implicit shift.
* Tweak the epconfig() code to avoid hanging on startup.
Set the Tx threshold to interrupt when there's space for
a maximal-sized ether frame, then do epinit() then epstop(),
instead of just the Tx and Rx reset. Required on at least a 3c595.
Tested on a 3c595, but not on 3c509-generation hardware.
ISA-compatible port space of PCI buslogic cards.
* Add call to bha_pci.c to disable the ISA-compatible ports of a PCI
device. The ISA-compatible ports are enabled by default, which
causes the card to be autoconfigured a second time as an ISA device,
which appears to deadlock the card.
* Change bha_cmd() to return the number of bytes it actually received
in response to a command, or -1 on error.
* Use heuristics (checking for bha-only registers, and checking the size
of the response to BHA_INQURE_EXTENDED) to bha_find, to make sure the
bha driver never matches an aha (Adaptec 1542 or compatible) device.
A single kernel should now boot on either Adaptec or BusLogic controllers,
provided we always probe for BusLogic devices before Adaptec devices,
but this has not yet been verified.
- 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.)