identify sockaddr_dl abuse that remains in the kernel, especially
the potential for overwriting memory past the end of a sockaddr_dl
with, e.g., memcpy(LLADDR(), ...).
the host share them.
Before breaking out of the loop over descriptors in gem_rint(),
DMA-resynchronize the first Rx descriptor we found that does not
belong to the host. We must avoid a cached descriptor "covering"
a descriptor in RAM, because the cached descriptor may say that
the descriptor still belongs to the NIC, when that is not true,
and the driver will hang.
XXX I believe this driver only works by luck on hosts that both
XXX have a cacheline size greater than the size of a descriptor
XXX (16 bytes) and lack DMA/cache coherency. I need to add some
XXX trickery to make sure that we don't scribble over the NIC's
XXX changes to a descriptor when we flush a cached descriptor to
XXX RAM with bus_dmamap_sync(9).
- remove bogus multicast handling [pointed out by thorpej]
and don't reset the chip on ENETRESET; ENETRESET is a sign
that only the multicast filter needs changing.
- make a few functions static
- introduce gem_bitwait() to factor out some of the register wait code.
- add gem_stop() in attach
- some DEBUG should be GEM_DEBUG
- handle underrun, packet too long, and overflow errors by resetting the chip
- add handler in ioctl for add/del multi
- fix typo
Also:
- add a shadow sc_if_flags member so that we don't reset the chip if we
don't need to.
field of the IP header (ip->ip-len) indicates they should be. This handles
the case where an ethernet frame has been padded to meet the minimum ethernet
frame length or erroneously (my cisco switch unnecessarily adds 4 bytes to its
SYN). This padding will be included in the hardware checksum and may be
non-zero, thus making it incorrect.
Do a little mbuf rework while here. Change all uses of MGET*(*, M_WAIT, *)
to m_get*(M_WAIT, *). These are not performance critical and making them
call m_get saves considerable space. Add m_clget analogue of MCLGET and
make corresponding change for M_WAIT uses.
Modify netinet, gem, fxp, tulip, nfs to support MBUFTRACE.
Begin to change netstat to use sysctl.
autonegotiation to take place if IFM_AUTO is selected in mii_media_set.
Make the gem driver use it. (XXX hme probably should use it but I can't
test that).
- Fix one typo (instead of two disable_rx, one disable_rx and one disable_tx)
[The other bug fix isn't appropriate since the was OACTIVE is dealt with
has been changed in NetBSD.]
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
Fix receiver lockups. When writing the RX Kick register, we need back up
on descriptor since we advanced one in the for loop. That will be the
last descriptor we haven't processed which is what we should write.
switch back to MII mode. Keep a sliding window for TX segments and when it
gets > 2/3 full, request a TX interrupt (window gets reset when the h/w TX
queue is empty). Add dv_xname to a few printfs. With the above changes,
the gem driver will now work on Macintoshes, even in GigE mode. On a 733
PowerMac G4 it gets ~355Mb/s TX and ~280Mb/s RX to/from an Alpha XP1000.
XXX mii autoselect is still flakey.