Also make the interrupt handler for older 3com cards look like the xl one.
I.e. don't ack the interrupt latch bit before checking if it is set.
At the same time, introduce constants for the watched interrupts, so that
we don't copy them all over the place.
interrupt priority, to avoid allocating additional mbufs on
splsched(). Move some other misc bits out of splched()-guarded
section. This should make the code a bit more friendly wrt e.g.
clock interrupts. Sligh performance improvement was observed with
this change (like 1-2% on slow machine), even.
This also fixes ancient kern/2478 by Bill Sommerfeld.
provided to me by David Brownlee (thanks!).
Performance of this card is quite poor on my PS/2 with 386DX, like 100KB/s
at best, but as low as 5KB/s when transferring bigger files due to
packet overruns. It would be good to revisit this later, probably by
teaching the ic code to use RX Early.
have _detach() functions:
Ensure that softc keeps state about whether the attach succeeded,
and make the detach function return immediately if the attach did
not complete.
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.
The old timeout()/untimeout() API has been removed from the kernel.
old data in pointer fields. NOTE: we'll extend m_pkthdr field soon.
Wondering: do mbuf pre-allocation code in elink3.c really buy us much
performance? it comes with code duplicate/synchronization problem with
sys/mbuf.h...
or memspace is unexpected, failed to map iospace or failed to configure
the controller properly.
- Disestablish an interrupt handler if failed to enable card.
- Be more conservative when resetting the interface after a transmit error.
It caused the interface to totally wedge on the (somewhat common) transmit
FIFO underrun condition.
the correct "read eeprom" opcode on the RoadRunner (which has a larger
EEPROM, and thus needs a different opcode to make room for the larger
offsets).
- Reset and enable the MII before probing for PHYs, and reset and enable
the MII in epinit().
- Be more conservative when resetting the interface after a transmit error.
Based on PR #8331, from Ryoji KATO.
Closer on 3c574, probably will work fine with the 3CCFEM556BI (which
won't have an older rev TDK Semi PHY, and which was tested by the author
of the PR).
directly, call the function pointer (*if_input)(ifp, m). The input routine
expects the packet header to be at the head of the packet, and will adjust
as necessary. Privatize the layer 2 input and output routines, allowing
*_ifattach() to set them up as appropriate.
per-packet discard of every received packet increases latency and
decrease throughput. INstead, Spin on S_COMMAND_IN_PROGESS for enough
iterations as the expected time to completion. Only do DELAY()/poll
loops (as suggested by Jason Thorpe) if spinning fails.
Take PCI as fastest case and compute worst-case estimate.
Shorten DELAY() in S_COMMAND_COMPLETE polling-loop up 10, loop-count
down. to speed up epreset() completion (m/c filter change, ifup/ipdown, etc).
* Clear the `enabled' bit in the softc so late hardware interrupts
(e.g., just after the full reset) done as part of shutdown) are dropped.
* Eliminate loops that poll forever on S_COMMAND_IN_PROGRESS to complete.
Add inline function with bounded loopcount plus small delay, to avoid
bugs in EISA hardware which never sets S_COMMAND_IN_PROGRESS.
Use for both TX_RESET/RX_RESET/GLOBAL_RESET cmds, and polling for
discard-Rx completion
Big-endian CPUs should use bus_space_{read,write}_multi_stream methods
to PIO packet data to NIC in 16-bit or 32-bit chunks.
Make it so.
Since we don't have stream methods on all ports yet (esp. i386), use
the bus_space_{read,write}_multi methods if the compile-time
stream-method feature-test macro is not set.
Originally from tsubai@netbsd.org, via HAYAKAWA koichi's cardbus patches.