- It is now possible to handle devices that want "looping" DMA,
e.g. the SoundBlaster correctly. The WSS and SB drivers use this.
To do this several new methods were introduced in audio_hw_if.
- Different silence handling (forced by previous change).
- The audio driver can now be mmap()-ed, but due to problems in
the VM system only for writing for now.
- The OSS (Linux) audio emulation takes advantage of some of the
new features.
zero. We use this later when the COMPLETE message comes in to set the
final residual count to zero. The flag is reset if the target resumes
a data phase. This obsoletes the `AUTOSAVE' quirk (for this driver).
Also, avoid overwriting the residual count if a SENSE was appended to
the current transaction.
'inline' as well as static. mark prototypes for static inline functions
as possibly unused (with __attribute__ ((unused))), to avoid generating
warnings when compiling without optimization but with most ports'
default warning flags. Clean up prototype list spacing, and make it more
consistent.
connect to their 1-wire bus like the DS2404 "EconoRAM Time Chip"
- and -
* Interface function definitions for this kind of chips. Currently only
low-level byte_read and _write, implenented as inline functions.
This functions take a struct ds_handle * (also defined here), which contains
pointers to bit-read/write and reset functions.
Eventually, prototypes for memory-access functions should go here, and the
1-wire bus should be made a BSD auto-configuration bus.
(a) The interrupt is a RESEL interrupt, and
(b) our state is SELECTING.
This condition can occur in perfectly normal operation if we are using
DMA to select the target and we are interrupted by another target
reselecting us. Per discussion with Paul Krannenburg.
Every ccb locks 64k of memory for dma buffers.
Instead of AHA_CCB_MAX ccbs using 1MByte only sc_link.openings ccbs
per device are allocated. Thus we now use only 128KByte per device present.
clock rate for this board on Alpha/PCI systems. Under x86/PCI, the
board f/w will correctly tell you "I'm running at 60Mhz", so the code
that preserved that across a board reset (which would drop the chip
back to 40Mhz) worked fine. On the 8200, the chip was saying "I'm 40Mhz"-
which wasn't true. This turned out to be okay as long as you didn't have
any FAST or UltraFast targets- In fact, setting the chip to 40Mhz allowed
you to run up to 8Mhz SCSI. Unfortunately you die bigtime on the devices
that go faster than that. The fix here is to only use what the chip tells
you the clock rate is in the cases you don't really know (sbus is the
only case where this could be different, although with 66Mhz PCI coming up,
this may change).
(1) fix a printf format (%x to print int, not %lx).
(2) fix probe of 4th chip/16th channel (used to tell whether or not the
board is a 16- or 32-port board) by removing an incorrect offset so
that the code matched its comments. (!!!)
(3) fix storage of chip number in per-channel structure so that it actually
stores the chip number, rather than the chip offset. This allows the
driver to work with more than the first four channels (i.e. with chips
other than chip number 0, which happens to have an offset of zero). (!!!)
MESSAGE_REJECT in response to SDTR or WDTR. Because of this, the
printfs that indicate refusal of sync/wide negotiation are unneeded
in normal operation. In the __NetBSD__ case, disable them by default.
They, like the other extra-verbose ahc driver boot messages, may be
reenabled with "options DEBUG". The behavior in the !__NetBSD__ case
is unchanged.
Set the encoding parameters slightly differently.
Remove the SW encoding/decodinf functions from this interface
and move them to the audio_parameter struct; this is both more efficient
and flexible.
This allows the front end to override the default DCR (byte-wide DMA,
x86 byte order, 8-byte FIFO) with different transfer size, byte order, DMA
parameters, and FIFO threshhold. If the loopback select bit is not set for
normal operation, the default is used instead.
Inspired by thoughts from Bernd Ernesti.
* epinit() had both explicit xcvr selection for 3c589 and a call
to epsetmedia(). The first is redundant; delete it, and EP_COAX_DEFAULT.
* Update comments to reflect 3c589 and 3c509B fixes. Fix typos.
this code makes equal sense for memory and I/O space, prefer to map
the PCI front end via memory space (conditionalized on a patchable kernel
variable), and do a bit of other random NetBSD-specific cleanup. (These
changes were sent to Justin Gibbs on March 28.)
in reset. If none there, try and get from the bus/platform specific code.
If a nonzero value for either, set the clock rate. This is why the PCI
card versions weren't working- they need to be set at 60MHZ, rather than
the default 40MHZ (which worked fine for the internal ISP chips on the
Alpha 8X00).
B) If a isp_poll returns failure (command never completed) to the caller
and no error is set in the xs struct, set XS_SELTIMEOUT. And then call...
C) Added isp_lostcmd function to try and ask the ISP chip about it's current
state as well as the state of commands for a particular target/lun. This is
going along to try and figure out why the very first command to the ISP always
seems to get swallowed up.
byte comparisons. Compare the ethernet addresses backwards on the
assumption that address number byte 6 has the most random distribution,
so packets not for us spend the least time in here.
we return from the driver expecting to come back due to an
interrupt, because the interrupt might not happen...
Do the untimeout in ncr53c9x_done instead of just before
almost every call to ncr53c9x_done as was done previously.
Make ncr53c9x_sense schedule its own timeout for the new
command it is starting (request sense), separate from the
timeout for the command that just completed.
- new MD variable: sc_initmodemedia, 79c960 cards can select
between two ports, but this needs to be done in the MI init mode page
- new defines for PCnet-ISA cards (79c960)
- new MD variable: sc_initmodemedia, 79c960 cards can select
between two ports, but this needs to be done in the MI init mode page
- new defines for PCnet-ISA cards (79c960)
- new MD variable: sc_initmodemedia, 79c960 cards can select
between two ports, but this needs to be done in the MI init mode page
- new defines for PCnet-ISA cards (79c960)
particularly older ones, don't do a SAVE DATA POINTER before disconnecting.
When the driver reconnects, it does an implicit RESTORE POINTERS, and
restores the data pointer from *before* the last transfer. If the driver
calculates the residual using the data pointer and doesn't account for
this, the residual will be wrong.
What we do is test for the SDEV_AUTOSAVE quirk when we see a disconnect
message, falling through to do a SAVE DATA POINTER if the quirk applies
to this target.
The workaround was suggested by Mycroft, who also provided the explanation
of the problem. Actual code was (mostly) ripped off from the 53C9x driver.
Anne Hutton <hutton@isi.edu>]:
- add support for Adaptec 155 PCI ATM cards (e.g. ANA-5940)
- add sc->is_adaptec to handle differences between cards.
- break out MID_MK_TXQ/MID_MK_RXQ seperate macros to handle
the new Adaptec format TXQ/RXQ.
- adjust en_dqneed to return 1 on ADP (since the Adaptec can
DMA anything in one DRQ/DTQ!)
- add hook for a bus specific reset function (adaptec has
a seperate reset register that needs to be hit when
resettting the midway).
- adjust DMA test to not worry about burst sizes on the
adaptec (since it handles it all for us!) and to handle
the new DTQ/DRQ format.
- add Adaptec DMA support to en_txlaunch() and en_service()
BUG FIXES:
- fixed receiver panic under heavy load ("lost mbuf in slot 0!").
when the reassembly buffer overflows, the T-bit is set in
the RDB and the data field is empty. en_service() sets up
a 4-byte (RDB size) dummy DMA without IF_ENQUEUE. but the
recv intr handling in en_intr() always does IF_DEQUEUE.
as a result, a successive recv intr loses its mbuf and
leads to a panic. the solution is to only IF_DEQUEUE if
the interrupt has non-zero length (indicating that there
is an mbuf to get). in order for this to work, EN_DQ_MK
must always be non-zero. we do this by or'ing in an unused
bit (0x80000).
reported by: Kenjiro Cho <kjc@csl.sony.co.jp>
- fix setting of transmit channel when txspeed[] is non-zero
(e.g. traffic shaping). the old scheme didn't work
properly (it allowed the same VCI to use multiple tx channels
thus defeating the txspeed[] parameter). the new scheme
statically assigns a VC to a channel when txspeed[] is set.
[note that the code to set txspeed[] isn't in the driver right
now since a MI interface to do this hasn't been made yet]
we add sc->txvc2slot[] and sc->txslot[n].nref for this.
reported by: Kenjiro Cho <kjc@csl.sony.co.jp>,
Milind M Buddihikot <milind@ccrc.wustl.edu>,
Dong Lin <dong@eecs.harvard.edu>
- when doing SRAM copies, be sure to round up the length to the next
largest word (otherwise the driver will try to do a byte clean
up DMA and then get an ID error interrupt).
MINOR CLEANUPS:
- clean up loops in DMA test
contributed by: Kenjiro Cho <kjc@csl.sony.co.jp>
- restructure and cleanup of en_read/en_write macros/inlines
- clean up some byte ordering stuff so that we are consistant throughout
the driver
Thanks to Michael Smith for reporting, Jason Thorpe for pointing to the
report, doing a quick workaround which pointed me to the right code part and
for testing the final fix.
does not supply media types, default to the "manual" type.
- Clean up the ETHER_CMP stuff slightly.
- Keep track of our carrier status, for media status requests.
Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.
For the detailed change history, look at the commit log entries for
the is-newarp branch.
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).