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.
(2) in scsibusmatch, match channel as appropriate.
(3) add a scsiprint() function, to do the "scsibus at..."
and channel (if not SCSI_CHANNEL_ONLY_ONE) printing,
i.e. the common functionality that all SCSI drivers currently
should be doing.
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).
Fix so that resource wait queueing works.
Changed all functions to take a pointer to uba_softc instead of unit
number, except for ubareset(). This must be done later.
the lowest bit set. This isn't any more or less valid according to the PCI
spec, but it deals with lame devices that don't implement all of the top
bits.
a boot string for firmware that can do this, such as the SPARC and
the sun3 models. It is currently silently ignored on all other
hardware now, however. The MD function "boot()" has been changed to
also take a char *.
values, i.e. 0xfffffffe and 0xffffffff respectively. The changed
definitions were incorrect, according to the PCI Local Bus Specification
(Revision 2.0). Further rationale and a workaround for the broken
devices that instigated the change provided in a message to
current-users@netbsd.org, dated Mon, 05 Aug 1996 22:06:58 -0400,
message ID 16773.839297218@ux2.sp.cs.cmu.edu>.
- In egstart(), if the Send Packet command fails, m_freem()
the mbuf chain before dequeueing another one (memory leak).
- In egintr(), return 1 if a known interrupt was processed.
Would manifest itself as spurious interrupts.
- 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
2441, and part of 2600. 2436 is left open to remind me that Chris's
comments are probably correct. This file should be built statically and
committed to the tree, not built on a per-kernel basis.
string with 0xFF instead of 0x20. Shorten the compare to 6 bytes to
take care of this.
Fixes PR #2617 by myself, which is based on a private problem report
by Neil Brewitt.
- 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().
old config anymore, all devices should use new config by now.
Add structures to handle DMA devices using new config.
Fixed bug that caused unwanted ubareset's on 11/780.
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)
Enable reselections as soon as possible after a disconnect - prevents
losing a reselecting device.
Check for and ignore a spurious interrupt during a DMA input (from the
Mach driver).
Turbochannel as well as the IOASIC. It should now work on the 5000/200.
Removed the "aborts" which could leave the disk trashed when the abort
rebooted the system. Fix the data corruption problem by clearing the
FIFO before starting a data transfer.
all attempts to mode select, even if the attempted mode is supported.
Add the ST_Q_UNIMODAL quirk for the HP Colorado T4000s which exhibits
this behavior. (Someone please lob a tactical nuke in that direction.)
From David Rosenthal <dshr@vitria.com> on netbsd-bugs.
* Change MachEmptyWriteBuffer() to wbflush(). Should use TC mi names tc_mb(),
tc_wmb, tc_syncbus() but I'm not sure which each wbflush() should be.
* Add prototyped forward decl for asc_Dumplog() and add an explicit void
return type.
* Remove unused variables.
alpha. At some point in the future, those headers should be provided
on the pmax, but until then, things are #ifdef'd so that the old
headers and definitions are still used. Pass a bus_chipset_tag_t
to the TC bus attach code and to devices, on the alpha.
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!)
While I'm here, convert driver to use <machine/bus.h> and the new PCI
I/O space interface (the new PCI interrupt interface was already in-use).
Also, correct a "corrected" printf.
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.
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_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_reset)()
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.
Add a real PCI front-end for PCnet-PCI Ethernet cards.
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_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_reset)()
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.
Break up ISA LANCE driver into ISA and PCI front-ends.
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.
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.
Use the i/o handle for the `delay port' exported from the parent
ISA bus, rather than the totally bogus combination of [ioh, 0x84].
Also, fix a bug apparently introduced when the -Wall changes were checked
in which, under most circumstances, would cause a 16-bit WD8013EP to
be mis-identified as an 8-bit WD8003EP.
For the ISA probe, implement a way to keep track of which ISA busses
have been through an ep_isa probe; the static variable that was used
before didn't scale.
In elink_reset(), since some machines may have more than one ISA bus,
implement a way of keeping track of which ISA bus has received an
elink_reset(); The static variable which was used previously didn't
scale.
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).
chip-independent clock code. 'clock' has been renamed 'mcclock' 'clock'
has been renamed 'mcclock' (since it's a driver for that particular
clock, and since eventually there may be another clock chip driver),
and now attaches via seperate match/attach functions to both TC and ISA.
This removes a whole lot of #ifdefs...
'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.
tech-kern (?)), to get the IPL_* and IST_* types. pass the machine-dependent
cookie given at attach time on to sub-devices, so they can use it to access
the interrupt functions properly.
the isa_chipset_tag_t type, and to define or prototype:
isa_attach_hook()
isa_intr_establish()
isa_intr_disestablish()
i.e. the machine-dependent functions to be used my MI ISA code.
Remove prototypes for the latter two functions from this file.
the bus is configured, interrupts are handled, etc. machine-dependent
header (machine/eisa/eisa_machdep.h) defines eisa_chipset_tag_t and
eisa_intr_handle_t types, and the following functions:
eisa_attach_hook()
eisa_maxslots()
eisa_intr_map()
eisa_intr_string()
eisa_intr_establish()
eisa_intr_disestablish()
Don't define the interrupt establish/disestablish functions directly
in terms of the ISA functions any more (on some wacked out systems,
there can be a difference).
* 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.
influence from the old driver (written by Stefan Grefen) and from
an autochanger driver written by the Systems Programming Group at the
University of Utah Computer Science Department (currently residing
in src/sys/arch/hp300/dev/ac.c).
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.
- Remove unnecessary prototypes
- Fix ioctl arguments
- Don't use kprintf(...TO_LOG...); directly. This does not set the log
priority, and uses priority of the previous message. Use log() with %:
(soon to be documented on mailing lists; eventually in section 9 manual
pages), most importantly:
(1) support interrupt pin swizzling on non-i386 systems with
PCI-PCI bridges (per PPB spec; done, but meaningless, on i386).
(2) provide pci_{io,mem}_find(), to determine what I/O or memory
space is described by a given PCI configuration space
mapping register.
(3) provide pci_intr_map(), pci_intr_string(), and
pci_intr_{,dis}establish() to manipulate and print info about
PCI interrupts.
(4) make pci functions take as an argument a machine-dependent
cookie, to allow more flexibility in implementation.
(1) use pci_{io,mem}_find(), to determine what I/O or memory
space is described by a given PCI configuration space
mapping register, and bus_{io,mem}_map() to map it.
(2) use pci_intr_map(), pci_intr_string(), and
pci_intr_{,dis}establish() to manipulate and print info about
PCI interrupts.
(5) make pci functions take as an argument a machine-dependent
cookie, to allow more flexibility in implementation.
(1) make pci functions take as an argument a machine-dependent
cookie, to allow more flexibility in implementation.
(use of other PCI functions, etc., left unchanged.)
to {mainbus,tc,ioasic}_cd.
Change ioasic config name from "lance " to "lance". Correct for
pmaxes, perhaps not for Alphas.
Boots and runs under load on a 5000/200. Hangs during boot on an ioasic
decstation; pmax autoconfig needs fixing.
Add Decstation-3100 baseboard support (untested).
* Display as much revision info as we can get.
* Fix a race condition that could cause interrupts to be lost.
* Handle `out of mailbox' conditions (much) more gracefully.
* Schedule timeouts more safely.
* Add diagnostic code to (correctly) detect if a CCB times out before its
outgoing mailbox is emptied.
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.
change tc_submatch() to compile with the new device-attach scheme:
the TC bus uses a 'submatch' function which checks device locators
and then calls a match function.
Instead of calling cf->cf_driver->cd_match(), we now need to call
cf->cf_attach->ca_match().
Rename the extern declaration of `tccd' and `ioasiccd' in
src/sys/dev/tc/{tvar.h,ioasicvar.h", respectively, to be
`tc_cd' and `ioasic_cd', to match the 1.1B-style definitions.
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.
- 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.
they're base I/O ports, not really addresses. rather than using those
softc fields directly, assign local variables (asicbase, nicbase) to have
their values, and use those. (consistency, plus better optimization
potential in some cases.)
eventually. rename the probe functions for the various boards to 'find' for
consistency/correctness (but the generic8390 check is still a 'probe').
Add protos for ed_find(), ed_probe_generic8390(), ed_find_WD80x3(),
ed_find_3Com(), and ed_find_Novell(). Fix one minor space nit.
'flags 1' on the sb? kernel configuration file line (because it frobs a
noncontiguous IO port to configure the Jazz16 extensions).
Also, remove static sb_device structure and fill in user's buffer on
each request.
ends of lines, turn aligned blocks of eight spaces into tabs, name all
softc elements with the "sc_" prefix, and call the softc by the commonly
used name, "sc", when passing it around.