Home | History | Annotate | Download | only in ic
History log of /src/sys/dev/ic/elinkxl.c
RevisionDateAuthorComments
 1.140  29-Jun-2024  riastradh if_stats(9): Add ifp argument to if_stat..._ref.

This will enable us to pass the ifp through to a dtrace probe inside.

No functional change intended in this change, but this is an API
change visible to modules so it shouldn't be pulled up.

PR kern/58377
 1.139  29-May-2022  rin Audit unload/unmap v.s. free against DMA buffer for sys/dev;
make sure that bus_dmamap_unload(9) [or bus_dmamap_destroy(9)] or
bus_dmamem_unmap(9) are preceding to freeing DMA buffer, if it is
loaded or mapped, respectively.

This is mandatory for some archs. See, e.g.:

http://www.nerv.org/netbsd/?q=id:20210511T013030Z.013443cc790088147e4beed43f53dedabeaf9312
http://www.nerv.org/netbsd/?q=id:20220511T172220Z.561179f0b6fcc5b9cd73e274f69d74e2ce9e4c93

For some drivers, resource leaks for error paths are fixed at
the same time.

XXX XXX XXX
Compile test only (at least one arch per driver).
 1.138  12-Mar-2020  thorpej Add support for MBUFTRACE.
 1.137  10-Feb-2020  msaitoh Restore an register read for RX_FRAMES_OK which was removed in rev. 1.133.
All statistics registers should be read to ACK the interrupt. Fixes PR#54920.

XXX pullup-[89]
 1.136  07-Feb-2020  thorpej Use callout_setfunc() / callout_schedule().
 1.135  04-Feb-2020  thorpej Use ifmedia_fini().
 1.134  29-Jan-2020  thorpej Adopt <net/if_stats.h>.
 1.133  30-Oct-2019  msaitoh branches: 1.133.2;
if_percpuq(9) automatically increments if_ipackets, so don't add number of
RX frames from device's statistics counter to if_ipackets to avoid double
count.
 1.132  13-Sep-2019  msaitoh if_flags is neither int nor short. It's unsigned short.
 1.131  28-May-2019  msaitoh branches: 1.131.2;
Use ETHER_LOCK()/ETHER_UNLOCK() for all ethernet drivers to protect ec_multi*.
 1.130  23-May-2019  msaitoh Whitespace fix (mainly tabify).
 1.129  23-May-2019  msaitoh No functional change:
- Simplify MII structure initialization and reference.
- u_int*_t -> uint*_t.
- KNF
 1.128  22-Apr-2019  msaitoh On drivers which use MII(4) and have hook SIOC[GS]IFMEDIA which just pass to
ifmedia_ioctl(), the hook is not required because ether_ioctl has it
(if_ethersubr.c rev. 1.160). These drivers don't return ENETRESET in
ifmedia_ioctl(), so no functional change.
 1.127  05-Feb-2019  msaitoh Remove very old IFF_NOTRAILERS flag.
 1.126  22-Jan-2019  msaitoh Change MII PHY read/write API from:

int (*mii_readreg_t)(device_t, int, int);
void (*mii_writereg_t)(device_t, int, int, int);
to:

int (*mii_readreg_t)(device_t, int, int, uint16_t *);
int (*mii_writereg_t)(device_t, int, int, uint16_t);

Now we can test if a read/write operation failed or not by the return value.

In 802.3 spec says that the PHY shall not respond to read/write transaction
to the unimplemented register(22.2.4.3). Detecting timeout can be used to
check whether a register is implemented or not (if the register conforms to
the spec). ukphy(4) can be used this for MII_MMDACR and MII_MMDAADR.

Note that I noticed that the following code do infinite loop in the
read/wirte function. If it accesses unimplemented PHY register, it will hang.
It should be fixed:

arm/at91/at91emac.c
arm/ep93xx/epe.c
arm/omap/omapl1x_emac.c
mips/ralink/ralink_eth.c
arch/powerpc/booke/dev/pq3etsec.c(read)
dev/cadence/if_cemac.c <- hkenken
dev/ic/lan9118.c


Tested with the following device:

axe+ukphy
axe+rgephy
axen+rgephy (tested by Andrius V)
wm+atphy
wm+ukphy
wm+igphy
wm+ihphy
wm+makphy
sk+makphy
sk+brgphy
sk+gentbi
msk+makphy
sip+icsphy
sip+ukphy
re+rgephy
bge+brgphy
bnx+brgphy
gsip+gphyter
rtk+rlphy
fxp+inphy (tested by Andrius V)
tlp+acphy
ex+exphy
epic+qsphy
vge+ciphy (tested by Andrius V)
vr+ukphy (tested by Andrius V)
vte+ukphy (tested by Andrius V)

Not tested (MAC):
arm:at91emac
arm:cemac
arm:epe
arm:geminigmac
arm:enet
arm:cpsw
arm:emac(omac)
arm:emac(sunxi)
arm:npe
evbppc:temac
macppc:bm
macppc:gm
mips:aumac
mips:ae
mips:cnmac
mips:reth
mips:sbmac
playstation2:smap
powerpc:tsec
powerpc:emac(ibm4xx)
sgimips:mec
sparc:be
sf
ne(ax88190, dl10019)
awge
ep
gem
hme
smsh
mtd
sm
age
alc
ale
bce
cas
et
jme
lii
nfe
pcn
ste
stge
tl
xi
aue
mue
smsc
udav
url

Not tested (PHY):
amhphy
bmtphy
dmphy
etphy
glxtphy
ikphy
iophy
lxtphy
nsphyter
pnaphy
rdcphy
sqphy
tlphy
tqphy
urlphy
 1.125  03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.124  26-Jun-2018  msaitoh branches: 1.124.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.
 1.123  23-Jun-2018  maxv constify
 1.122  22-Jun-2018  msaitoh It's not required to include net/bpfdesc.h. Remove it.
 1.121  20-Feb-2017  ozaki-r branches: 1.121.6; 1.121.12;
Apply deferred if_start to more drivers
 1.120  15-Dec-2016  ozaki-r branches: 1.120.2;
Move bpf_mtap and if_ipackets++ on Rx of each driver to percpuq if_input

The benefits of the change are:
- We can reduce codes
- We can provide the same behavior between drivers
- Where/When if_ipackets is counted up
- Note that some drivers still update packet statistics in their own
way (periodical update)
- Moved bpf_mtap run in softint
- This makes it easy to MP-ify bpf

Proposed on tech-kern and tech-net
 1.119  10-Jun-2016  ozaki-r branches: 1.119.2;
Introduce m_set_rcvif and m_reset_rcvif

The API is used to set (or reset) a received interface of a mbuf.
They are counterpart of m_get_rcvif, which will come in another
commit, hide internal of rcvif operation, and reduce the diff of
the upcoming change.

No functional change.
 1.118  09-Feb-2016  ozaki-r Introduce softint-based if_input

This change intends to run the whole network stack in softint context
(or normal LWP), not hardware interrupt context. Note that the work is
still incomplete by this change; to that end, we also have to softint-ify
if_link_state_change (and bpf) which can still run in hardware interrupt.

This change softint-ifies at ifp->if_input that is called from
each device driver (and ieee80211_input) to ensure Layer 2 runs
in softint (e.g., ether_input and bridge_input). To this end,
we provide a framework (called percpuq) that utlizes softint(9)
and percpu ifqueues. With this patch, rxintr of most drivers just
queues received packets and schedules a softint, and the softint
dequeues packets and does rest packet processing.

To minimize changes to each driver, percpuq is allocated in struct
ifnet for now and that is initialized by default (in if_attach).
We probably have to move percpuq to softc of each driver, but it's
future work. At this point, only wm(4) has percpuq in its softc
as a reference implementation.

Additional information including performance numbers can be found
in the thread at tech-kern@ and tech-net@:
http://mail-index.netbsd.org/tech-kern/2016/01/14/msg019997.html

Acknowledgment: riastradh@ greatly helped this work.
Thank you very much!
 1.117  13-Apr-2015  riastradh Convert sys/dev to use <sys/rndsource.h>.
 1.116  10-Aug-2014  tls branches: 1.116.4;
Merge tls-earlyentropy branch into HEAD.
 1.115  22-Jul-2012  matt branches: 1.115.2; 1.115.12;
Fix mii_statchg to take a 'struct ifnet *' instead of device_t. This fixes
problem with a common MDIO bus used for multiple interfaces.
Some drivers converted to CFATTACL_DECL_NEW.
 1.114  02-Feb-2012  tls Entropy-pool implementation move and cleanup.

1) Move core entropy-pool code and source/sink/sample management code
to sys/kern from sys/dev.

2) Remove use of NRND as test for presence of entropy-pool code throughout
source tree.

3) Remove use of RND_ENABLED in device drivers as microoptimization to
avoid expensive operations on disabled entropy sources; make the
rnd_add calls do this directly so all callers benefit.

4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might
have lead to slight entropy overestimation for some sources.

5) Add new source types for environmental sensors, power sensors, VM
system events, and skew between clocks, with a sample implementation
for each.

ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files). Tested with release
builds on amd64 and evbarm and live testing on amd64.
 1.113  13-Nov-2010  uebayasi branches: 1.113.8; 1.113.12;
Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.
 1.112  05-Apr-2010  joerg Push the bpf_ops usage back into bpf.h. Push the common ifp->if_bpf
check into the inline functions as well the fourth argument for
bpf_attach.
 1.111  22-Mar-2010  dyoung Add a self-suspensor. It's not used, yet.

In ex_detach(), call ex_stop(), first. ex_stop() stops the callout.
Destroy the callout in ex_detach().
 1.110  19-Jan-2010  pooka branches: 1.110.2; 1.110.4;
Redefine bpf linkage through an always present op vector, i.e.
#if NBPFILTER is no longer required in the client. This change
doesn't yet add support for loading bpf as a module, since drivers
can register before bpf is attached. However, callers of bpf can
now be modularized.

Dynamically loadable bpf could probably be done fairly easily with
coordination from the stub driver and the real driver by registering
attachments in the stub before the real driver is loaded and doing
a handoff. ... and I'm not going to ponder the depths of unload
here.

Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.
 1.109  15-Sep-2009  dyoung Simplify activation routines: don't call mii_activate(), it's a
no-op. Don't block interrupts, if_deactivate() does it.
Compile-tested, only.
 1.108  05-Sep-2009  tsutsui Invert logic around nested pmf(9) registrations for readability.
 1.107  03-Dec-2008  tsutsui Fix typo in comment.
 1.106  07-Nov-2008  dyoung *** Summary ***

When a link-layer address changes (e.g., ifconfig ex0 link
02:de:ad:be:ef:02 active), send a gratuitous ARP and/or a Neighbor
Advertisement to update the network-/link-layer address bindings
on our LAN peers.

Refuse a change of ethernet address to the address 00:00:00:00:00:00
or to any multicast/broadcast address. (Thanks matt@.)

Reorder ifnet ioctl operations so that driver ioctls may inherit
the functions of their "class"---ether_ioctl(), fddi_ioctl(), et
cetera---and the class ioctls may inherit from the generic ioctl,
ifioctl_common(), but both driver- and class-ioctls may override
the generic behavior. Make network drivers share more code.

Distinguish a "factory" link-layer address from others for the
purposes of both protecting that address from deletion and computing
EUI64.

Return consistent, appropriate error codes from network drivers.

Improve readability. KNF.

*** Details ***

In if_attach(), always initialize the interface ioctl routine,
ifnet->if_ioctl, if the driver has not already initialized it.
Delete if_ioctl == NULL tests everywhere else, because it cannot
happen.

In the ioctl routines of network interfaces, inherit common ioctl
behaviors by calling either ifioctl_common() or whichever ioctl
routine is appropriate for the class of interface---e.g., ether_ioctl()
for ethernets.

Stop (ab)using SIOCSIFADDR and start to use SIOCINITIFADDR. In
the user->kernel interface, SIOCSIFADDR's argument was an ifreq,
but on the protocol->ifnet interface, SIOCSIFADDR's argument was
an ifaddr. That was confusing, and it would work against me as I
make it possible for a network interface to overload most ioctls.
On the protocol->ifnet interface, replace SIOCSIFADDR with
SIOCINITIFADDR. In ifioctl(), return EPERM if userland tries to
invoke SIOCINITIFADDR.

In ifioctl(), give the interface the first shot at handling most
interface ioctls, and give the protocol the second shot, instead
of the other way around. Finally, let compatibility code (COMPAT_OSOCK)
take a shot.

Pull device initialization out of switch statements under
SIOCINITIFADDR. For example, pull ..._init() out of any switch
statement that looks like this:

switch (...->sa_family) {
case ...:
..._init();
...
break;
...
default:
..._init();
...
break;
}

Rewrite many if-else clauses that handle all permutations of IFF_UP
and IFF_RUNNING to use a switch statement,

switch (x & (IFF_UP|IFF_RUNNING)) {
case 0:
...
break;
case IFF_RUNNING:
...
break;
case IFF_UP:
...
break;
case IFF_UP|IFF_RUNNING:
...
break;
}

unifdef lots of code containing #ifdef FreeBSD, #ifdef NetBSD, and
#ifdef SIOCSIFMTU, especially in fwip(4) and in ndis(4).

In ipw(4), remove an if_set_sadl() call that is out of place.

In nfe(4), reuse the jumbo MTU logic in ether_ioctl().

Let ethernets register a callback for setting h/w state such as
promiscuous mode and the multicast filter in accord with a change
in the if_flags: ether_set_ifflags_cb() registers a callback that
returns ENETRESET if the caller should reset the ethernet by calling
if_init(), 0 on success, != 0 on failure. Pull common code from
ex(4), gem(4), nfe(4), sip(4), tlp(4), vge(4) into ether_ioctl(),
and register if_flags callbacks for those drivers.

Return ENOTTY instead of EINVAL for inappropriate ioctls. In
zyd(4), use ENXIO instead of ENOTTY to indicate that the device is
not any longer attached.

Add to if_set_sadl() a boolean 'factory' argument that indicates
whether a link-layer address was assigned by the factory or some
other source. In a comment, recommend using the factory address
for generating an EUI64, and update in6_get_hw_ifid() to prefer a
factory address to any other link-layer address.

Add a routing message, RTM_LLINFO_UPD, that tells protocols to
update the binding of network-layer addresses to link-layer addresses.
Implement this message in IPv4 and IPv6 by sending a gratuitous
ARP or a neighbor advertisement, respectively. Generate RTM_LLINFO_UPD
messages on a change of an interface's link-layer address.

In ether_ioctl(), do not let SIOCALIFADDR set a link-layer address
that is broadcast/multicast or equal to 00:00:00:00:00:00.

Make ether_ioctl() call ifioctl_common() to handle ioctls that it
does not understand.

In gif(4), initialize if_softc and use it, instead of assuming that
the gif_softc and ifp overlap.

Let ifioctl_common() handle SIOCGIFADDR.

Sprinkle rtcache_invariants(), which checks on DIAGNOSTIC kernels
that certain invariants on a struct route are satisfied.

In agr(4), rewrite agr_ioctl_filter() to be a bit more explicit
about the ioctls that we do not allow on an agr(4) member interface.

bzero -> memset. Delete unnecessary casts to void *. Use
sockaddr_in_init() and sockaddr_in6_init(). Compare pointers with
NULL instead of "testing truth". Replace some instances of (type
*)0 with NULL. Change some K&R prototypes to ANSI C, and join
lines.
 1.105  28-Apr-2008  martin branches: 1.105.6; 1.105.8;
Remove clause 3 and 4 from TNF licenses
 1.104  14-Apr-2008  cegger branches: 1.104.2; 1.104.4;
- ansify
- use POSIX integers
 1.103  14-Apr-2008  spz pretty up if_ex: pmf'ify, device split, and improve printing a bit too.

Reviewed and function-tested on if_ex_cardbus by cube (thanks).
Function-tested on if_ex_pci by myself.
 1.102  14-Apr-2008  cegger ansify
 1.101  08-Apr-2008  cegger use aprint_*_dev and device_xname
 1.100  07-Feb-2008  dyoung branches: 1.100.6;
Start patching up the kernel so that a network driver always has
the opportunity to handle an ioctl before generic ifioctl handling
occurs. This will ease extending the kernel and sharing of code
between drivers.

First steps: Make the signature of ifioctl_common() match struct
ifinet->if_ioctl. Convert SIOCSIFCAP and SIOCSIFMTU to the new
ifioctl() regime, throughout the kernel.
 1.99  19-Oct-2007  ad branches: 1.99.2;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.98  26-Aug-2007  dyoung branches: 1.98.2; 1.98.6;
Constify: LLADDR -> CLLADDR. I'm aiming here to make it easier to
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(), ...).
 1.97  09-Jul-2007  ad branches: 1.97.2; 1.97.6;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.96  04-Mar-2007  christos branches: 1.96.2; 1.96.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.95  12-Nov-2006  itohy branches: 1.95.4;
Oops, I didn't notice the file had been updated and overwrote
the changes in 1.93....
Rescue the changes in 1.93 (IPv4 checksum fix).
 1.94  12-Nov-2006  itohy - In some rare cases, both Tx Complete and Dn Complete bits are set.
I'm not sure what it exactly means, but at least, the packet in question
is reloaded in ex_txstat() and should not handle the Dn Complete event
at the moment --- it should be served on later interrupt.

- Reload packet on collision, too.
 1.93  12-Nov-2006  tsutsui Add a workaround for a hardware ip4csum-tx bug which would sometimes put
wrong IPv4 checksum on sending 21 or 22 byte IP packets.

See discussion on tech-kern and tech-net for details:
http://mail-index.netbsd.org/tech-kern/2006/11/04/0004.html
 1.92  05-Nov-2006  itohy Restart transmitter, not reset the entire chip, on transmission errors
like Tx underrun.
This should improve performance on such errors.

Handle fifo threshold properly --- actually it did not handled at all.
Note that the Tx Complete interrupts occur only on errors, and ex_txstat()
is not good place to increment sc->tx_succ_ok. Increase the sc->tx_succ_ok
count from 100 to 256, since the ex(4) does busmastering and underruns
should rarely happen in normal operations.

Possibly improve some situation for the hang-on-heavy-load problems,
such as kern/11450 and kern/27096.
 1.91  04-Nov-2006  tsutsui Preserve m_pkthdr.csum_flags in TX packets because
it could be lost if bus_dmamap_load_mbuf(9) returns EFBIG.
(though I've never seen the "too mamy segments" message
which indicates the packet has more than 32 fragments)
 1.90  29-Oct-2006  itohy Turn on PHY power earlier in the initialization.
This should make 3c575CT work and fix following PRs:

kern/12965: 3com 575CT does not work
port-i386/16295: Problems in pci routing table and ex0 (3c575c-tx) networking
 1.89  24-Sep-2006  jmcneill Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@
 1.88  21-May-2006  christos branches: 1.88.6; 1.88.8;
void casts to functions whose return values are ignored.
 1.87  20-Feb-2006  thorpej branches: 1.87.2; 1.87.6; 1.87.8;
Use device_is_active() rather than testing dv_flags for DVF_ACTIVE
directly.
 1.86  11-Dec-2005  christos branches: 1.86.2; 1.86.4; 1.86.6;
merge ktrace-lwp.
 1.85  23-Oct-2005  christos The previous change (to use bus_space_read_2), was broken because it was
reading from an odd offset. From Robert Elz
 1.84  04-Oct-2005  christos branches: 1.84.2;
PR/31455: Robert Elz: ex (905[BC]) cards can hang in -current kernels
- fix bus_space_read_1 -> bus_space_read_2 since revision 1.27 changed
the bit defines to assume 2 byte reads.
- Increment oerrors in case of collisions
- Clamp success counter to 100, instead of letting rotate freely.
 1.83  31-May-2005  christos branches: 1.83.2;
revert previous and fix LLADDR instead.
 1.82  31-May-2005  christos use const cast.
 1.81  30-May-2005  christos - add missing const
- fix variable shadowing
- remove unneeded casts
 1.80  02-May-2005  yamt split IFCAP_CSUM_xxx to IFCAP_CSUM_xxx_Rx and IFCAP_CSUM_xxx_Tx.
 1.79  27-Feb-2005  perry branches: 1.79.2;
nuke trailing whitespace
 1.78  06-Feb-2005  skrll Initialize 'error' in all cases in ioctl handler, otherwise it doesn't
compile (and of course might return garbage). [hi kim!]
 1.77  06-Feb-2005  kim If the interface is up and running, only modify the receive filter
when setting promiscuous or debug mode. This avoids resetting the
chip unnecessarily.

Fixes PR kern/29126.
 1.76  04-Feb-2005  perry de-__P
 1.75  30-Oct-2004  thorpej branches: 1.75.4; 1.75.6;
When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
 1.74  28-Sep-2004  yamt ex_add_rxbuf: use MRESETDATA macro.
 1.73  02-Jul-2004  bouyer Fix PR 25788 by Arto Huusko using a cleaned up version of the provided patch.
Not reading the mii media status if the interface isn't up doesn't hurt,
as the real media status isn't reported if the interface isn't up anyway
(checked on i386).
On my alpha500, I tracked down the machine check to the GO_WINDOW(4) at
line 1858 of elinkxl.c. It's possible that the problem which was fixed in
rev 1.72 was also the GO_WINDOW(4) used in the non-mii case. tr from ddb
and a single-step show different results, and I trust the single-step
one :)
 1.72  10-Nov-2003  drochner branches: 1.72.2;
Reading the (non-MII) media status if the card is not running yields
"0xffff" (eg on i386) or a machine check (on alpha).
So don't read the status if !(UP&RUNNING).
 1.71  06-Jul-2003  jdolecek actually do gather some randomness (if it's enabled)
modelled after what elink3.c does
 1.70  05-Jun-2003  dogcow branches: 1.70.2;
Some models of the 556B don't turn on the transmitter without magic
values getting written. Fix from FreeBSD; cf sys/pci/if_xl.c, rev 1.110
 1.69  09-May-2003  christos PR/13653: Onno van der Linden: Set tranceiver media properly.
 1.68  31-Jan-2003  thorpej Use aprint_*().
 1.67  09-Nov-2002  enami Fix multicast handling on 3C905B or later card;
- Handle IFF_ALLMULTI case correctly. This is necessary to mrouted working.
Tested by taca@netbsd.org.
- Clear unnecessary multicast hash bit. Otherwise, unnecessary multicast
packet is received. Tested by me with the 3C905C bought at akihabara.
It was 2980yen.

The code is written by fvdl@netbsd.org and me.
 1.66  22-Oct-2002  fair Change the "dontcare bits" argument to ifmedia_init() to IFM_IMASK
so that it is possible select PHY instances other than the first
one (instance zero), if there is more than one PHY attached.
 1.65  01-Jul-2002  thorpej In ex_shutdown(), call ex_enable() to make sure the interface is
powered up and the PCI configuration registers restored. If we
don't do this, the firmware on some machines gets REALLY confused.
 1.64  20-Jun-2002  itojun more proper fix to ex_disable.
 1.63  12-May-2002  wiz branches: 1.63.2; 1.63.4;
Spelling fixes, from Sergey Svishchev in kern/16650.
 1.62  06-Apr-2002  mhitch Interface byte counts are counted in ether_input() and ether_output(). Don't
count them when reading the NIC counters - it doubles the count. Read the
NIC counters to prevent counter overflow interrupts, but don't add them to
the interface counters. Don't bother reading the upper counts because they
are just latched when reading the totals.

Fixes final part of PR#11549.
 1.61  28-Dec-2001  christos Clean up the C_ and S_ constants. We don't really need two sets of them.
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.
 1.60  13-Nov-2001  lukem add/cleanup RCSID
 1.59  10-Nov-2001  perry trivially rename some macro parameters to avoid lint warnings.
 1.58  03-Oct-2001  yamt branches: 1.58.2;
ack intr only when intr is for us.
 1.57  01-Oct-2001  yamt avoid losing a desc on error.
 1.56  16-Sep-2001  wiz Spell 'occurred' with two 'r's.
 1.55  19-Jul-2001  thorpej branches: 1.55.2;
Use BUS_DMA_READ and BUS_DMA_WRITE in some obvious places.
 1.54  07-Jul-2001  thorpej branches: 1.54.2;
bzero -> memset
 1.53  07-Jul-2001  thorpej bcopy -> strcpy
 1.52  07-Jul-2001  thorpej bcmp -> memcmp
 1.51  12-Jun-2001  thorpej Don't need INET or NS includes here.
 1.50  02-Jun-2001  thorpej Implement support for IP/TCP/UDP checksum offloading provided by
network interfaces. This works by pre-computing the pseudo-header
checksum and caching it, delaying the actual checksum to ip_output()
if the hardware cannot perform the sum for us. In-bound checksums
can either be fully-checked by hardware, or summed up for final
verification by software. This method was modeled after how this
is done in FreeBSD, although the code is significantly different in
most places.

We don't delay checksums for IPv6/TCP, but we do take advantage of the
cached pseudo-header checksum.

Note: hardware-assisted checksumming defaults to "off". It is
enabled with ifconfig(8). See the manual page for details.

Implement hardware-assisted checksumming on the DP83820 Gigabit Ethernet,
3c90xB/3c90xC 10/100 Ethernet, and Alteon Tigon/Tigon2 Gigabit Ethernet.
 1.49  10-May-2001  fvdl Despite what the hardware docs say, the global reset command is not
done when the command-in-progress bit has been cleared. The 1ms
time that is mentioned also seems wrong; 20,000us is not enough
on at least one machine. So, do a delay(100000) in ex_reset.
Fortunately, this function is only called when the card is
attached or when hardware failure is suspected.

While here, only mask one 1 bit in the 'reset hack' case.
 1.48  26-Apr-2001  kanaoka - Fix typo in comment.
- Add (missed)powerhook_disestablish() in ex_detach().
- Sync with below. Original commit log message:
Add new powerhook argument values, PWR_SOFTSUSPEND, PWR_SOFTSTANDBY and
PWR_SOFTRESUME. Apm calls powerhook with the values in normal interrupt
priority level while others are protected with splhigh().
 1.47  30-Jan-2001  thorpej branches: 1.47.2;
Power management support for the CardBus Etherlink XL cards.
From Masanori Kanaoka <kanaoka@ann.hi-ho.ne.jp>.
 1.46  14-Dec-2000  thorpej ALTQ'ify.
 1.45  15-Nov-2000  thorpej Move bpfattach()/bpfdetach() calls into ether_ifattach()/ether_ifdetach().
 1.44  14-Nov-2000  thorpej NBPG -> PAGE_SIZE
 1.43  17-Oct-2000  bouyer Support ETHERCAP_VLAN_MTU by ignoring the EX_UPD_ERROR and EX_UPD_OVERSIZED
status bits. Tested with a 3c905-TX.
 1.42  11-Oct-2000  thorpej Use ether_ioctl().
 1.41  01-Oct-2000  thorpej Move the check for "promisc + unicast + not for us" into ether_input(),
and change Ethernet drivers to always pass all received frames to
ether_input() (with a few exceptions, which are documented in the
code).
 1.40  19-Sep-2000  fvdl Add support for the 3c555, 556 and 556B MiniPCI cards. Based on the
cardbus code and the FreeBSD xl driver.
 1.39  31-Aug-2000  haya Correct LED polarity bit. This bit and PHY power bit should be
defined in elinkxlreg.h.
 1.38  29-Aug-2000  haya Add support 3C[CX]FE575CT.
 1.37  25-Aug-2000  haya Access on ELINK_W3_INTERNAL_CONFIG register with 32-bit mode. Remove
16-bit access code. This register is 32-bit. 16-bit access with the
register causes data inconsistency (especially for CardBus cards).
 1.36  28-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.35  27-Jun-2000  mrg remove redudant <vm/pmap.h> includes. <vm/pmap.h> -> <uvm/uvm_pmap.h>
 1.34  29-May-2000  jhawk branches: 1.34.2;
For all network drivers that call ether_ifattach(), and also
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.
 1.33  12-May-2000  thorpej branches: 1.33.2;
Use ether_crc32_be().
 1.32  12-May-2000  tsutsui Read upd_pktstatus from DMA buffer after bus_dmamap_sync() called.
 1.31  30-Mar-2000  augustss Remove register declarations.
 1.30  23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
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.
 1.29  06-Mar-2000  thorpej No longer necessary to futz with ifp->if_baudrate here.
 1.28  02-Mar-2000  enami Check if device is active in the interrupt handler and the one second
tick handler.
 1.27  01-Mar-2000  thorpej Amend previous; pay attention to EX_CONF_MII on deactivate, too.
 1.26  01-Mar-2000  thorpej Only detach PHYs if we have MII in the first place, and remove a bunch
of #if 0'd code which was copied from the Tulip driver.
 1.25  05-Feb-2000  augustss Support detach.
 1.24  02-Feb-2000  thorpej Don't dry to diving MIIF_NOISOLATE in the PHY drivers. Instead, pass
flags down from the parent to child vi mii_attach().
 1.23  02-Feb-2000  thorpej Bring some order to the chaos which was the MII code function naming
"conventions".
 1.22  18-Jan-2000  mycroft Rearrange ex_intr() to use C_INTR_LATCH the same way the ep driver does,
to prevent race conditions.
 1.21  12-Dec-1999  thorpej Use htole32() and le32toh().
 1.20  19-Nov-1999  bouyer Adapt printf format for 64bit stats counters.
 1.19  17-Nov-1999  thorpej Use the common MII bit-bang module.
 1.18  17-Nov-1999  thorpej Make the MII code match the `ep' driver's (*again*).
 1.17  12-Nov-1999  thorpej Call mii_down() as appropriate.
 1.16  04-Nov-1999  thorpej Adapt to mii_phy_probe() change.
 1.15  15-Oct-1999  haya branches: 1.15.2; 1.15.4;
This is the first check-in of CardBus driver. CardBus driver contains
CardBus bus stub, YENTA PCI-CardBus bridge (cbb), 3Com 3C575TX driver
(ex) and Intel fxp driver.

TODO:
o Conform to the KNF more strictly.
o Be unified with pcmcia code as much as possible.
o Add more drivers for CardBus card, such as APA-1480 or USB card.

The affected files are listed below.

sys/arch/i386/conf/files.i386
sys/arch/macppc/conf/files.macppc
sys/conf/files
sys/dev/ic/elinkxl.c
sys/dev/ic/elinkxlvar.h
sys/dev/ic/i82365.c
sys/dev/ic/i82365var.h
sys/dev/isa/i82365_isasubr.c
sys/dev/pci/files.pci
sys/dev/pcmcia/pcmcia.c
sys/dev/pcmcia/pcmciachip.h

The added files are listed below.

sys/arch/i386/conf/CARDBUS
sys/arch/i386/include/rbus_machdep.h
sys/arch/i386/i386/rbus_machdep.c
sys/arch/macppc/include/rbus_machdep.h
sys/arch/macppc/macppc/rbus_machdep.c
sys/dev/cardbus/if_ex_cardbus.c
sys/dev/cardbus/Makefile.cardbusdevs
sys/dev/cardbus/cardbus.c
sys/dev/cardbus/cardbus_map.c
sys/dev/cardbus/cardbusdevs
sys/dev/cardbus/cardbusdevs.h
sys/dev/cardbus/cardbusdevs_data.h
sys/dev/cardbus/cardbusvar.h
sys/dev/cardbus/cardslot.c
sys/dev/cardbus/cardslotvar.h
sys/dev/cardbus/devlist2h.awk
sys/dev/cardbus/files.cardbus
sys/dev/cardbus/if_fxp_cardbus.c
sys/dev/cardbus/pccardcis.h
sys/dev/cardbus/rbus.c
sys/dev/cardbus/rbus.h
sys/dev/pci/pccbb.c
sys/dev/pci/pccbbreg.h
sys/dev/pci/pccbbvar.h
 1.14  01-Sep-1999  fvdl branches: 1.14.2;
Select the right transceiver type when configuring the driver. Change the
timing for the mii code a bit. From Robert Elz / the FreeBSD xl driver.
 1.13  18-May-1999  thorpej Rework layer 2 protocol input routines. Instead of calling e.g. ether_input()
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.
 1.12  14-May-1999  drochner The last change made the driver go into an interrupt loop after a while.
Obviously, the TX_DEFERRALS counter must be read.
 1.11  12-May-1999  thorpej Don't count deferrals as output errors. It's only a (single) output error
if an excessive number of deferrals causes the transmission to abort.
 1.10  28-Apr-1999  dean Fix for PR kern/7483: ex driver gets bogus MAC address with 3c905B
 1.9  26-Apr-1999  thorpej Make the 3Com Etherlink XL driver work on big-endian systems. From
Izumi Tsutsui, PR #7279.
 1.8  13-Apr-1999  jonathan Fix ex_read_eeprom() for 3c57x.
 1.7  29-Mar-1999  fvdl branches: 1.7.2;
Fix multicast hashing function. PR 7274, from Izumi Tsutsui
 1.6  25-Mar-1999  thorpej Use ETHER_*_LEN constants from <net/if_ether.h> instead of defining them
ourselves.
 1.5  28-Feb-1999  explorer Update to slightly altered rnd_attach_source() api
 1.4  17-Feb-1999  thorpej Avoid initializing the interface in the SIOCSIFFLAGS if ! UP and ! RUNNING.
 1.3  10-Jan-1999  drochner - Set up the interface watchdog timer on sends. This fixes the hangups
reported by Matthias Scheler <tron@lyssa.owl.de> in PR kern/6772.
- After receiving, check whether the receive DMA pointer became 0
what obviously happens if the list runs out of entries. Simply reinit
in this case. This fixes receive lockups after DDB use observed
by myself.
Unstall the receive engine if the ELINK_UPPKTSTATUS indicates that it
was stalled. (Don't know when this might happen. FreeBSD does so.)
 1.2  29-Nov-1998  thorpej Fix media probe on non-MII chips.
 1.1  04-Nov-1998  fvdl Add the 'ex' driver, a DMA driver for 3Com 90x and 90xB cards. Rename
constants from EP_ to ELINK_ since they're now used in the ex driver as well.
 1.7.2.4  18-Sep-1999  cgd pull up rev 1.14 from trunk (cgd):
Select the right tranceiver type when configuring the driver,
and change the timing for the MII code a bit. Fixes a problem
with MII not being reported correctly (PR#8363). (cgd)
 1.7.2.3  28-Apr-1999  perry branches: 1.7.2.3.2;
pullup 1.9->1.10 (Dean Huxley): fix kern/7483
 1.7.2.2  27-Apr-1999  perry pullup 1.8->1.9 (thorpej)
 1.7.2.1  27-Apr-1999  perry pullup 1.7->1.8 (Jonathan Stone)
 1.7.2.3.2.1  21-Jun-1999  thorpej Sync w/ -current.
 1.14.2.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.15.4.1  15-Nov-1999  fvdl Sync with -current
 1.15.2.4  11-Feb-2001  bouyer Sync with HEAD.
 1.15.2.3  05-Jan-2001  bouyer Sync with HEAD
 1.15.2.2  22-Nov-2000  bouyer Sync with HEAD.
 1.15.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.33.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.34.2.7  13-Feb-2002  he Apply patch (requested by joda):
Correct typo in previous pull-up.
 1.34.2.6  01-Jan-2002  he Pull up revisions 1.47-1.48 (via patch, requested by kanaoka):
Add Power Management support for Cardbus Etherlink XL cards, and
some cleanup.
 1.34.2.5  15-Nov-2001  he Pull up revision 1.39 (requested by haya):
Set correct bit for LED polarity. Affects CardBus cards, such
as 3c575[BC].
 1.34.2.4  15-May-2001  he Pull up revision 1.49 (requested by fvdl):
Wait longer after a card reset, avoids reading bad values from
the eeprom.
 1.34.2.3  20-Mar-2001  he Pull up revision 1.40 (via patch, requested by chuck):
Add support for the 3Com 3c555, 3c556 and 3c556B MiniPCI Ethernet
cards.
 1.34.2.2  31-Dec-2000  jhawk Pull up revision 1.43 via patch (requested by bouyer):
Add support for 802.1Q virtual LANs.
 1.34.2.1  01-Sep-2000  haya Pull up rev 1.37 and 1.38: Support 3C[CX]FE575CT.
This pullup is approved by <thorpej@netbsd.org>.
 1.47.2.10  11-Nov-2002  nathanw Catch up to -current
 1.47.2.9  01-Aug-2002  nathanw Catch up to -current.
 1.47.2.8  20-Jun-2002  nathanw Catch up to -current.
 1.47.2.7  17-Apr-2002  nathanw Catch up to -current.
 1.47.2.6  08-Jan-2002  nathanw Catch up to -current.
 1.47.2.5  14-Nov-2001  nathanw Catch up to -current.
 1.47.2.4  08-Oct-2001  nathanw Catch up to -current.
 1.47.2.3  21-Sep-2001  nathanw Catch up to -current.
 1.47.2.2  24-Aug-2001  nathanw Catch up with -current.
 1.47.2.1  21-Jun-2001  nathanw Catch up to -current.
 1.54.2.4  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.54.2.3  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.54.2.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.54.2.1  03-Aug-2001  lukem update to -current
 1.55.2.2  11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.55.2.1  01-Oct-2001  fvdl Catch up with -current.
 1.58.2.1  12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.63.4.1  12-Dec-2002  he Pull up revision 1.67 (requested by taca in ticket #992):
Fix multicast handling on 3C905B or later card;
o Handle IFF_ALLMULTI case correctly. This is necessary
to mrouted working.
o Clear unnecessary multicast hash bit. Otherwise,
unnecessary multicast packet is received.
 1.63.2.1  15-Jul-2002  gehenna catch up with -current.
 1.70.2.10  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.70.2.9  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.70.2.8  07-Feb-2005  skrll Sunc with HEAD.
 1.70.2.7  06-Feb-2005  skrll Sync with HEAD.
 1.70.2.6  04-Feb-2005  skrll Sync with HEAD.
 1.70.2.5  02-Nov-2004  skrll Sync with HEAD.
 1.70.2.4  19-Oct-2004  skrll Sync with HEAD
 1.70.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.70.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.70.2.1  03-Aug-2004  skrll Sync with HEAD
 1.72.2.1  02-Jul-2004  he branches: 1.72.2.1.2;
Pull up revision 1.73 (requested by bouyer in ticket #581):
Make this driver work also on alpha systems, instead of
producing a machine check, by only reading the mii media
status if the interface is up. Fixes PR#25788.
 1.72.2.1.2.3  16-Dec-2006  bouyer Back out 1.72.2.1.2.2 (requested by itohy in ticket #10825)
The problem fixed by 1.85 (pulled up in ticket #5942) is an
inconsistency between elinkxl.c and elink3reg.h, that was introduced
by elink3reg.h rev 1.27. elink3reg.h in netbsd-2 branch is 1.26, and
pulling up the change made them inconsistent, and caused problem
kern/31455 that had not been in netbsd-2 branch.
 1.72.2.1.2.2  28-Oct-2005  jmc Pullup rev 1.85 (requested by christos in ticket #5942)
The previous change (to use bus_space_read_2), was broken because it was
reading from an odd offset.
 1.72.2.1.2.1  24-Jan-2005  he Pull up revision 1.75 (requested by thorpej in ticket #939):
When adding or deleting multicast addresses, only change
the address filter if the interface is marked RUNNING.
Fixes PR#27678.
 1.75.6.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.75.6.1  12-Feb-2005  yamt sync with head.
 1.75.4.1  29-Apr-2005  kent sync with -current
 1.79.2.2  28-Oct-2005  jmc Pullup rev 1.85 (requested by christos in ticket #913)
The previous change (to use bus_space_read_2), was broken because it was
reading from an odd offset.
 1.79.2.1  06-Oct-2005  tron Pull up following revision(s) (requested by christos in ticket #863):
sys/dev/ic/elinkxl.c: revision 1.84
PR/31455: Robert Elz: ex (905[BC]) cards can hang in -current kernels
- fix bus_space_read_1 -> bus_space_read_2 since revision 1.27 changed
the bit defines to assume 2 byte reads.
- Increment oerrors in case of collisions
- Clamp success counter to 100, instead of letting rotate freely.
 1.83.2.5  11-Feb-2008  yamt sync with head.
 1.83.2.4  27-Oct-2007  yamt sync with head.
 1.83.2.3  03-Sep-2007  yamt sync with head.
 1.83.2.2  30-Dec-2006  yamt sync with head.
 1.83.2.1  21-Jun-2006  yamt sync with head.
 1.84.2.1  26-Oct-2005  yamt sync with head
 1.86.6.2  01-Jun-2006  kardel Sync with head.
 1.86.6.1  22-Apr-2006  simonb Sync with head.
 1.86.4.1  09-Sep-2006  rpaulo sync with head
 1.86.2.1  01-Mar-2006  yamt sync with head.
 1.87.8.1  19-Jun-2006  chap Sync with head.
 1.87.6.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.87.2.1  24-May-2006  yamt sync with head.
 1.88.8.2  10-Dec-2006  yamt sync with head.
 1.88.8.1  22-Oct-2006  yamt sync with head
 1.88.6.1  18-Nov-2006  ad Sync with head.
 1.95.4.1  12-Mar-2007  rmind Sync with HEAD.
 1.96.4.1  11-Jul-2007  mjf Sync with head.
 1.96.2.3  23-Oct-2007  ad Sync with head.
 1.96.2.2  09-Oct-2007  ad Sync with head.
 1.96.2.1  01-Jul-2007  ad Adapt to callout API change.
 1.97.6.2  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.97.6.1  03-Sep-2007  jmcneill Sync with HEAD.
 1.97.2.1  03-Sep-2007  skrll Sync with HEAD.
 1.98.6.1  25-Oct-2007  bouyer Sync with HEAD.
 1.98.2.2  23-Mar-2008  matt sync with HEAD
 1.98.2.1  06-Nov-2007  matt sync with HEAD
 1.99.2.1  18-Feb-2008  mjf Sync with HEAD.
 1.100.6.2  17-Jan-2009  mjf Sync with HEAD.
 1.100.6.1  02-Jun-2008  mjf Sync with HEAD.
 1.104.4.5  11-Aug-2010  yamt sync with head.
 1.104.4.4  11-Mar-2010  yamt sync with head
 1.104.4.3  16-Sep-2009  yamt sync with head
 1.104.4.2  04-May-2009  yamt sync with head.
 1.104.4.1  16-May-2008  yamt sync with head.
 1.104.2.1  18-May-2008  yamt sync with head.
 1.105.8.1  19-Jan-2009  skrll Sync with HEAD.
 1.105.6.1  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.110.4.2  05-Mar-2011  rmind sync with head
 1.110.4.1  30-May-2010  rmind sync with head
 1.110.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.113.12.1  18-Feb-2012  mrg merge to -current.
 1.113.8.2  30-Oct-2012  yamt sync with head
 1.113.8.1  17-Apr-2012  yamt sync with head
 1.115.12.1  07-Apr-2014  tls Be a little more clear and consistent about harvesting entropy from devices:

1) deprecate RND_FLAG_NO_ESTIMATE

2) define RND_FLAG_COLLECT_TIME, RND_FLAG_COLLECT_VALUE

3) define RND_FLAG_ESTIMATE_TIME, RND_FLAG_ESTIMATE_VALUE

4) define RND_FLAG_DEFAULT: RND_FLAG_COLLECT_TIME|
RND_FLAG_COLLECT_VALUE|RND_FLAG_ESTIMATE_TIME

5) Make entropy harvesting from environmental sensors a little more generic
and remove it from individual sensor drivers.

6) Remove individual open-coded delta-estimators for values from a few
places in the tree (uvm, environmental drivers).

7) 0 -> RND_FLAG_DEFAULT, actually gather entropy from various drivers
that had stubbed out code, other minor cleanups.
 1.115.2.2  03-Dec-2017  jdolecek update from HEAD
 1.115.2.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.116.4.5  28-Aug-2017  skrll Sync with HEAD
 1.116.4.4  05-Feb-2017  skrll Sync with HEAD
 1.116.4.3  09-Jul-2016  skrll Sync with HEAD
 1.116.4.2  19-Mar-2016  skrll Sync with HEAD
 1.116.4.1  06-Jun-2015  skrll Sync with HEAD
 1.119.2.2  20-Mar-2017  pgoyette Sync with HEAD
 1.119.2.1  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.120.2.1  21-Apr-2017  bouyer Sync with HEAD
 1.121.12.4  26-Jan-2019  pgoyette Sync with HEAD
 1.121.12.3  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.121.12.2  28-Jul-2018  pgoyette Sync with HEAD
 1.121.12.1  25-Jun-2018  pgoyette Sync with HEAD
 1.121.6.3  11-Feb-2020  martin Pull up following revision(s) (requested by msaitoh in ticket #1501):

sys/dev/ic/elinkxl.c: revision 1.137

Restore an register read for RX_FRAMES_OK which was removed in rev. 1.133.

All statistics registers should be read to ACK the interrupt. Fixes PR#54920.
XXX pullup-[89]
 1.121.6.2  06-Nov-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #1427):

sys/arch/arm/broadcom/bcm53xx_eth.c: revision 1.39
sys/dev/pcmcia/if_xi.c: revision 1.91
sys/dev/ic/aic6915.c: revision 1.40
sys/dev/pci/if_tl.c: revision 1.117
sys/arch/arm/gemini/gemini_gmac.c: revision 1.18
sys/dev/ic/elinkxl.c: revision 1.133
sys/dev/pci/if_ste.c: revision 1.57
sys/dev/pci/if_alc.c: revision 1.43
sys/dev/pci/if_stge.c: revision 1.72
sys/dev/pci/if_ale.c: revision 1.34
sys/dev/pci/if_age.c: revision 1.62
sys/dev/pci/if_txp.c: revision 1.60
sys/dev/ic/i82557.c: revision 1.156
sys/dev/pci/if_vte.c: revision 1.27
sys/arch/powerpc/booke/dev/pq3etsec.c: revision 1.47
sys/arch/arm/gemini/if_gpn.c: revision 1.13

if_percpuq(9) and ether_input() automatically increment if_ipackets, so don't add number of
RX frames from device's statistics counter to if_ipackets to avoid double
count.
 1.121.6.1  26-Jul-2018  snj Pull up following revision(s) (requested by msaitoh in ticket #938):
sys/arch/acorn32/podulebus/if_ie.c: revision 1.41
sys/arch/amiga/dev/if_es.c: revision 1.58
sys/arch/amiga/dev/if_qn.c: revision 1.45
sys/arch/arm/at91/at91emac.c: revision 1.20
sys/arch/arm/ep93xx/epe.c: revision 1.37
sys/arch/emips/ebus/if_le_ebus.c: revision 1.14
sys/arch/emips/ebus/if_le_ebus.c: revision 1.15
sys/arch/mac68k/dev/if_mc.c: revision 1.46
sys/arch/macppc/dev/am79c950.c: revision 1.39
sys/arch/newsmips/apbus/if_sn.c: revision 1.40
sys/arch/next68k/dev/mb8795.c: revision 1.59
sys/arch/playstation2/dev/if_smap.c: revision 1.25
sys/arch/playstation2/dev/if_smap.c: revision 1.26
sys/arch/sun2/dev/if_ec.c: revision 1.28
sys/arch/sun3/dev/if_ie.c: revision 1.63
sys/arch/x68k/dev/if_ne_intio.c: revision 1.19
sys/arch/xen/xen/if_xennet_xenbus.c: revision 1.75
sys/arch/xen/xen/xennetback_xenbus.c: revision 1.63
sys/dev/bi/if_ni.c: revision 1.45
sys/dev/cadence/if_cemac.c: revision 1.12
sys/dev/ic/am7990.c: revision 1.78
sys/dev/ic/am79900.c: revision 1.27
sys/dev/ic/an.c: revision 1.67
sys/dev/ic/cs89x0.c: revision 1.40
sys/dev/ic/dm9000.c: revision 1.13
sys/dev/ic/dm9000.c: revision 1.14
sys/dev/ic/dp8390.c: revision 1.88
sys/dev/ic/elink3.c: revision 1.141
sys/dev/ic/elinkxl.c: revision 1.122
sys/dev/ic/hme.c: revision 1.98
sys/dev/ic/i82586.c: revision 1.77
sys/dev/ic/lance.c: revision 1.53
sys/dev/ic/mb86950.c: revision 1.27
sys/dev/ic/mb86960.c: revision 1.86
sys/dev/ic/mtd803.c: revision 1.34
sys/dev/ic/pdq_ifsubr.c: revision 1.59
sys/dev/ic/rrunner.c: revision 1.86
sys/dev/ic/seeq8005.c: revision 1.58
sys/dev/ic/sgec.c: revision 1.47
sys/dev/ic/smc90cx6.c: revision 1.72
sys/dev/ic/smc91cxx.c: revision 1.96
sys/dev/ic/tropic.c: revision 1.49
sys/dev/ic/wi.c: revision 1.245
sys/dev/isa/if_eg.c: revision 1.93
sys/dev/isa/if_el.c: revision 1.95
sys/dev/isa/if_iy.c: revision 1.101
sys/dev/ofw/ofnet.c: revision 1.58
sys/dev/pci/if_alc.c: revision 1.27
sys/dev/pci/if_de.c: revision 1.152
sys/dev/pci/if_fpa.c: revision 1.61
sys/dev/pci/if_jme.c: revision 1.34
sys/dev/pci/if_tl.c: revision 1.108
sys/dev/pci/if_vte.c: revision 1.19
sys/dev/pci/ixgbe/ixgbe.h: revision 1.50
sys/dev/pcmcia/if_cnw.c: revision 1.62
sys/dev/pcmcia/if_malo_pcmcia.c: revision 1.17
sys/dev/pcmcia/if_ray.c: revision 1.89
sys/dev/pcmcia/if_xi.c: revision 1.81
sys/dev/pcmcia/mhzc.c: revision 1.51
sys/dev/pcmcia/xirc.c: revision 1.34
sys/dev/qbus/if_de.c: revision 1.33
sys/dev/qbus/if_qe.c: revision 1.78
sys/dev/qbus/if_qt.c: revision 1.22
sys/dev/sbus/be.c: revision 1.87
sys/dev/sbus/qe.c: revision 1.68
sys/dev/scsipi/if_se.c: revision 1.96
sys/dev/usb/if_atu.c: revision 1.59
sys/net/if_l2tp.c: revision 1.28 via patch
sys/net/if_ppp.c: revision 1.160
It's not required to include net/bpfdesc.h. Remove it.
--
Simplify like other drivers. NULL check of ifp->if_bpf is done in
bpf_mtap(), so it's not required to do it here.
--
Remove duplicated inclusion of net/bpf.h.
--
Remove duplicated inclusion of net/bpf.h.
--
Simplify bpf_mtap() call. No functional change.
 1.124.2.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.124.2.1  10-Jun-2019  christos Sync with HEAD
 1.131.2.2  11-Feb-2020  martin Pull up following revision(s) (requested by msaitoh in ticket #695):

sys/dev/ic/elinkxl.c: revision 1.137

Restore an register read for RX_FRAMES_OK which was removed in rev. 1.133.

All statistics registers should be read to ACK the interrupt. Fixes PR#54920.
XXX pullup-[89]
 1.131.2.1  06-Nov-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #403):

sys/arch/arm/broadcom/bcm53xx_eth.c: revision 1.39
sys/dev/pcmcia/if_xi.c: revision 1.91
sys/dev/ic/aic6915.c: revision 1.40
sys/dev/pci/if_tl.c: revision 1.117
sys/arch/arm/gemini/gemini_gmac.c: revision 1.18
sys/dev/ic/elinkxl.c: revision 1.133
sys/dev/pci/if_ste.c: revision 1.57
sys/dev/pci/if_alc.c: revision 1.43
sys/dev/pci/if_stge.c: revision 1.72
sys/dev/pci/if_ale.c: revision 1.34
sys/dev/pci/if_age.c: revision 1.62
sys/dev/pci/if_txp.c: revision 1.60
sys/dev/ic/i82557.c: revision 1.156
sys/dev/pci/if_vte.c: revision 1.27
sys/arch/powerpc/booke/dev/pq3etsec.c: revision 1.47
sys/arch/arm/gemini/if_gpn.c: revision 1.13

if_percpuq(9) and ether_input() automatically increment if_ipackets, so don't add number of
RX frames from device's statistics counter to if_ipackets to avoid double
count.
 1.133.2.1  29-Feb-2020  ad Sync with head.

RSS XML Feed