Home | History | Annotate | Download | only in ic
History log of /src/sys/dev/ic/tulip.c
RevisionDateAuthorComments
 1.213  05-Jul-2024  rin sys: Drop redundant NULL check before m_freem(9)

m_freem(9) safely has accepted NULL argument at least since 4.2BSD:
https://www.tuhs.org/cgi-bin/utree.pl?file=4.2BSD/usr/src/sys/sys/uipc_mbuf.c

Compile-tested on amd64/ALL.

Suggested by knakahara@
 1.212  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.211  10-Feb-2024  andvar s/alloted/allotted/ in comments.
 1.210  20-Dec-2023  thorpej malloc(9) -> kmem(9), and plug a memory leak on detach while I'm here.
 1.209  04-Sep-2023  mrg mask a value with the array size mask to avoid a GCC 12 warning.

i'm fairly sure this can't actually happen, but it likely avoids
any potential bug without real issue.
 1.208  01-Aug-2022  kre Revert this to 1.205, undoing changes apparently mistakenly
committed in 1.206, and the total disaster that the attempt to
revert those in 1.207 created.
 1.207  01-Aug-2022  mlelstv Revert last accidental commits.
 1.206  01-Aug-2022  mlelstv Also fix shift values for SCT constants.
 1.205  25-Jun-2022  tsutsui Pass proper status values to rnd_add_uint32(9) as rnd(9) man page claims.
 1.204  15-Mar-2020  thorpej Don't bother with IFF_OACTIVE.
 1.203  11-Mar-2020  msaitoh Use unsigned to avoid undefined behavior. Found by kUBSan.
 1.202  04-Feb-2020  thorpej Use ifmedia_fini().
 1.201  29-Jan-2020  thorpej Adopt <net/if_stats.h>.
 1.200  10-Nov-2019  chs branches: 1.200.2;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.199  13-Sep-2019  msaitoh if_flags is neither int nor short. It's unsigned short.
 1.198  30-Jul-2019  msaitoh Avoid undefined behavior when setting multicast address. found by kUBSan.
 1.197  28-May-2019  msaitoh branches: 1.197.2;
s/recieve/receive/
 1.196  28-May-2019  msaitoh Use ETHER_LOCK()/ETHER_UNLOCK() for all ethernet drivers to protect ec_multi*.
 1.195  23-May-2019  msaitoh Whitespace fix (mainly tabify).
 1.194  23-May-2019  msaitoh No functional change:
- Simplify MII structure initialization and reference.
- u_int*_t -> uint*_t.
- KNF
 1.193  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.192  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.191  26-Jun-2018  msaitoh branches: 1.191.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.190  23-May-2017  ozaki-r branches: 1.190.8;
Apply deferred if_start to more drivers

And annotate some XXX_start as it runs in softint to clarify that
it doesn't need deferred if_start.
 1.189  15-Dec-2016  ozaki-r 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.188  11-Jul-2016  msaitoh branches: 1.188.2;
KNF. No functional change.
 1.187  10-Jun-2016  ozaki-r 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.186  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.185  26-Feb-2015  nakayama Stop the interface before detaching to avoid the race between
tlp_detach() and tlp_intr().

While there, add missing callout_destroy()s.
 1.184  10-Aug-2014  tls branches: 1.184.2; 1.184.4;
Merge tls-earlyentropy branch into HEAD.
 1.183  15-Sep-2013  martin branches: 1.183.2;
Comment out unused variable
 1.182  14-Sep-2013  joerg GC unused functions and variables.
 1.181  22-Jul-2012  matt branches: 1.181.2; 1.181.4;
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.180  02-Feb-2012  tls branches: 1.180.2; 1.180.6; 1.180.8;
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.179  13-Aug-2011  jakllsch branches: 1.179.2; 1.179.6;
Fix TLP_DEBUG after previous
 1.178  13-Aug-2011  christos simplifying code, unconfuses gcc index calculation.
 1.177  09-Jul-2011  christos - add a routine to get the name of the card.
 1.176  13-Nov-2010  uebayasi 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.175  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.174  19-Jan-2010  pooka branches: 1.174.2; 1.174.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.173  04-Dec-2009  dyoung Oops, there was one mii_activate() call left. Delete it.
 1.172  05-Sep-2009  tsutsui Invert logic around nested pmf(9) registrations for readability.
 1.171  01-Sep-2009  jmcneill aprint-ify
 1.170  27-Aug-2009  dyoung Use *_FOREACH() routines instead of open-coding them.
 1.169  17-Apr-2009  cegger change tlp_attach() to return an error code on failure.
 1.168  17-Apr-2009  cegger set dmamap to NULL when bus_dmamap_create() fails to prevent bus_dmamap_destroy to be called with an invalid dmamap in error path.
 1.167  17-Apr-2009  cegger device_t/softc split. Tested with tlp at pci
 1.166  17-Apr-2009  cegger use device_private
 1.165  17-Apr-2009  cegger struct device * -> device_t
u_intNN_t -> uintNN_t
 1.164  07-Nov-2008  dyoung branches: 1.164.4;
*** 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.163  28-Apr-2008  martin branches: 1.163.6; 1.163.8;
Remove clause 3 and 4 from TNF licenses
 1.162  08-Apr-2008  cegger branches: 1.162.2; 1.162.4;
use aprint_*_dev and device_xname
 1.161  23-Mar-2008  tsutsui On preparing a setup packet, use proper byteswap ops and byte shift ops
rather than #ifdef BYTE_ORDER and subtle pointer casts.
 1.160  23-Mar-2008  tsutsui Ignore the Report on MII error bit if chip doesn't have MII.
Fixes annoying "tlp0: MII error" messages on Qube 2700 with 21041.
 1.159  11-Mar-2008  dyoung Prepare for PMF self-suspension: in the if_stop() methods, clear
IFF_UP and IFF_RUNNING before running the 'disable' step, instead
of after. Soon I will handle the 'disable' step by calling into
PMF, which may call if_stop(, 0). Ordinarily, that is harmless.
This change lets the if_stop() routines exit early when they find
on entry that IFF_RUNNING is not set.
 1.158  09-Mar-2008  jmcneill Convert from shutdownhook/powerhook to PMF.
 1.157  19-Jan-2008  dyoung branches: 1.157.2; 1.157.6;
Make many ethernet drivers share the common code for MII media
handling, ether_mediastatus() and ether_mediachange(). Check for
a non-ENXIO error return from mii_mediachg(). (ENXIO indicates
that a PHY is suspended.)

This patch shrinks the source code size by 979 lines. There was
a 5100-byte savings on the NetBSD/i386 kernel configuration, ALL.

I have made a few miscellaneous changes, too:

gem(4): use LIST_EMPTY(), LIST_FOREACH().
mtd(4): handle media ioctls, for a change!
axe(4): do not track link status in sc->axe_link any longer
nfe(4), aue(4), axe(4), udav(4), url(4): do not reset all PHYs
on a change of media

Except for the change to mtd(4), no functional changes are intended.

XXX This patch affects more architectures than I can feasibly
XXX compile and run. I have compiled macppc, sparc64, i386. I
XXX have run the patches on i386 boxen with bnx(4) and sip(4).
XXX Compiling and running on evbmips (MERAKI, ADM5120) is in
XXX progress.
 1.156  18-Jan-2008  ad Noisy printf
 1.155  29-Dec-2007  tsutsui Fix typo in comments.
 1.154  19-Oct-2007  ad branches: 1.154.2; 1.154.8;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.153  29-Sep-2007  scw branches: 1.153.2;
s/NPBFILTER/NBPFILTER/ in some #endif comments. No functional change.
 1.152  27-Aug-2007  dyoung branches: 1.152.2; 1.152.4;
Constify.
 1.151  26-Aug-2007  dyoung 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.150  09-Jul-2007  ad branches: 1.150.2; 1.150.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.149  04-Mar-2007  christos branches: 1.149.2; 1.149.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.148  19-Feb-2007  rumble Extract mac addresses on Phobos G100 boards.
 1.147  24-Sep-2006  jmcneill branches: 1.147.2; 1.147.4;
Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@
 1.146  30-Aug-2006  rumble branches: 1.146.2; 1.146.4;
Phobos boards (my G130 at least) have a non-standard srom layout. Try to
identify it and pull out the enaddr.
 1.145  26-May-2006  blymn branches: 1.145.4;
Clean up bogus whitespace
 1.144  14-May-2006  elad branches: 1.144.2;
integrate kauth.
 1.143  25-Mar-2006  rpaulo Add support for the Conexant RS7112. From Frank Wille <frank@phoenix.owl.de>.
 1.142  20-Feb-2006  thorpej branches: 1.142.2; 1.142.4; 1.142.6;
Use device_is_active() rather than testing dv_flags for DVF_ACTIVE
directly.
 1.141  24-Dec-2005  perry branches: 1.141.2; 1.141.4; 1.141.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.140  11-Dec-2005  christos merge ktrace-lwp.
 1.139  17-Jul-2005  he Make tlp_idle() not be static, so that the newsmips version of the
driver can access that function again.

Approved by thorpej
 1.138  08-Jul-2005  thorpej - Use ANSI function decls.
- Liberally apply static.
 1.137  23-Jun-2005  rpaulo branches: 1.137.2;
Add support for ASIX AX88140A/AX88141 chipsets using only
the 10/100 MII with inspiration from FreeBSD dc(4) driver.

Tested on i386 and macppc.

Reviewed by Jason Thorpe and ok'ed by Hubert Feyrer.
 1.136  23-Mar-2005  wiz Remove duplicate word in comment. From Rui Paulo in PR 29767.
 1.135  27-Feb-2005  perry branches: 1.135.2;
nuke trailing whitespace
 1.134  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.133  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.132  04-Feb-2005  perry de-__P
 1.131  30-Jan-2005  thorpej Eliminate use of M_HASFCS.
 1.130  11-Dec-2004  sketch branches: 1.130.2; 1.130.4;
Silence the 'receive process failed to idle' message on the Davicom DM9102A.
 1.129  30-Oct-2004  thorpej When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
 1.128  05-Aug-2004  jkunz Attach phy anyway if srom has invalid contents.
Patch sugested by Charles M. Hannum on tech-kern.
 1.127  02-Jul-2004  mycroft Add debugging code to dump the filter setup descriptor, similar to the transmit
path.
 1.126  18-Dec-2003  thorpej branches: 1.126.2; 1.126.4;
If we're running on a Connectix Virtual PC, we might get a packet longer
than a max size Ethernet frame without getting a frame-too-long error. VPC
seems to be adding 4 zeros at the end of every frame. Detect this condition
and simply truncate the packet to a max size Ethernet frame.

I now have no problems with networking on NetBSD inside Virtual PC 6.
 1.125  25-Oct-2003  christos Fix uninitialized variable warning.
 1.124  25-Oct-2003  christos Fix uninitialized variable warnings
 1.123  07-Sep-2003  tsutsui Handle SROM quirk of tulip on Cobalt RAQ2. Fixes kern/20702.
 1.122  26-Feb-2003  matt branches: 1.122.2;
Add MBUFTRACE kernel option.
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.
 1.121  08-Oct-2002  minoura Check existence of the default 10baseT media for 21140.
If one does not exist, fall back to the first.
 1.120  27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.119  18-Sep-2002  thorpej For the 21142/21143 internal Nway, only advertise/resolve media for
which we have SROM blocks.
 1.118  14-Jul-2002  chs use the SROM info to set the media in 2114[23] autonegotiation
rather than just fiddling the opmode CSR, since we might
need to change the SIA CSRs as well (eg. for some ZNYX cards).
from PR 17510.
 1.117  09-Jul-2002  chuck only powerdown on a suspend. do not powerdown on a standby (PR#17537).
 1.116  08-Jul-2002  mycroft Add a missing DELAY() in the initial GPIO setup for the 21140.
 1.115  01-Jun-2002  lukem SIMPLEQ rototill:
- 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
 1.114  31-May-2002  thorpej Remove duplicate TULIP_SET/TULIP_CLR.
 1.113  03-May-2002  mycroft branches: 1.113.2; 1.113.4;
Clean up some dead code.
Combine nway_reset() into nway_auto().
 1.112  03-May-2002  mycroft 5) Be more liberal in blasting SIATXRX and SIASTAT in nway_auto(); in
particular, make sure that all the SIASTAT_ANS bits are in the right state
so we don't do something inane.

Still doesn't actually bring the link up properly, but at least it negotiates
most of the time, and does it a little faster.
 1.111  03-May-2002  mycroft More internal Nway issues:
1) Do not call tlp_sia_update_link() in Nway mode, and do not look at SIASTAT
in any other place that nway_status(), where we first check that it's valid.
In other places, look at IFM_ACTIVE after having call nway_status().
2) Eliminate stupid MII_MEDIACHG calls, and arrange for nway_service() to
update status on every call.
3) Nuke the synchronous case of nway_auto() from orbit.
4) Do not call nway_statchg() when using manual configuration; tlp_sia_set()
does everything we need.
 1.110  03-May-2002  mycroft Fix multiple problems with 2114x internal Nway:
1) Set OPMODE_TTM in the default tsti_opmode, so that nway_status doesn't
blow up and report the wrong media type when statically configured. (This
code is a hack.)
2) Do not set IFM_ACTIVE (i.e. ignore SIASTAT_LS*) when in auto-negotiation
mode and negotiation has not completed (per 21143 manual).
3) Do not clear auto-negotiation mode; otherwise the chip will not
renegotiate on a link failure.

With these changes, 10/100 selection is more stable, and auto-negotiation
comes up with the right status and detects link, but the link does not work
unless it's hardwired. More work is needed.
 1.109  14-Apr-2002  mycroft tm_gpctl and tm_gpdata must be shifted right 16 bits. DOH.
This makes another CardBus tlp card work...
 1.108  09-Apr-2002  chs add support for built-in NWay autonegotiation on 2114[23], Macronix
98713A, 98715, 98715A, 98725, and Lite-On 82C115.
 1.107  05-Apr-2002  mycroft With certain 21140 and 21143 SROM formats, OPMODE_FD was never being set when
the interface was wired to full-duplex mode. Duh.
Also, add OPMODE_TTM to OPMODE_MEDIA_BITS, to insure that it is changed when
we switch between 10 and 100.
 1.106  26-Mar-2002  chs move some prototypes from tulip.c to tulipvar.h so they can
be used by bus-specific code.
 1.105  16-Mar-2002  chs in the TULIP_ROM_MB_21142_MII case of tlp_2114x_isv_tmsw_init(),
use "cp" instead of "ncp" as a temporary pointer into the SROM.
we still need the value of ncp here, it points to the next media block.
(update the copy of this code in tlp_21142_reset() just 'cause.)
this makes the BNC port on the Adaptec ANA-6911A work.
 1.104  14-Mar-2002  chs assume that 21143 SROM info blocks are in extended format (as the spec
requires), even if the bit to indicate this is not set.
this makes Phobos P430 4-port cards work.
 1.103  12-Jan-2002  tsutsui Call malloc(9) with M_ZERO flag instead of memset() after malloc().
 1.102  22-Nov-2001  yamt use little-endian crc on multicast hash for admtek chips.
 1.101  13-Nov-2001  lukem add/cleanup RCSID
 1.100  10-Nov-2001  perry trivially rename some macro parameters to avoid lint warnings.
 1.99  16-Sep-2001  wiz branches: 1.99.2;
Spell 'occurred' with two 'r's.
 1.98  20-Aug-2001  wiz branches: 1.98.2;
Succeed has two 'c's.
 1.97  14-Aug-2001  mrg mtod() with uintptr_t, not bus_addr_t.
 1.96  23-Jul-2001  thorpej Make sure to initialize the all Rx descriptors properly in *_init()
even if mbufs for them are already allocated.
 1.95  19-Jul-2001  thorpej Use BUS_DMA_READ and BUS_DMA_WRITE in some obvious places.
 1.94  07-Jul-2001  thorpej branches: 1.94.2;
bcmp -> memcmp
 1.93  12-Jun-2001  thorpej Don't need INET or NS includes here.
 1.92  12-Jun-2001  wiz receive, not recieve
 1.91  24-Feb-2001  cgd branches: 1.91.2;
C requires that labels be followed by statements.
 1.90  21-Feb-2001  jdolecek make some more constant arrays 'const'
 1.89  17-Jan-2001  thorpej Filter "receive process failed to idle" on noisy chips (like the
ADMtek AN985).
 1.88  16-Jan-2001  thorpej Fix register offset botch when setting the multicast filter on
the ADMtek AN985.
 1.87  08-Jan-2001  thorpej On ADMtek chips, don't just idle the chip when programming the
multicast filter. These chips don't like to go into "idle" state
very much, so we have to use the big hammer and reset the chip,
instead.
 1.86  08-Jan-2001  thorpej The ADMtek AN985 "ghosts" the single built-in PHY at every MII address.
Work around this by having a custom media init routine that limits the
search to MII address 1.
 1.85  07-Jan-2001  thorpej Also ignore receiver errors if VLAN_MTU is enabled; the 21040 appears
to require this.
 1.84  19-Dec-2000  thorpej Fix a problem with the ALTQ changes that can cause bogus memory
refernces. Problem reported by Luke Mewburn.
 1.83  14-Dec-2000  thorpej ALTQ'ify.
 1.82  26-Nov-2000  takemura 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.81  15-Nov-2000  thorpej Move bpfattach()/bpfdetach() calls into ether_ifattach()/ether_ifdetach().
 1.80  15-Oct-2000  thorpej Don't trim off the FCS, pass it up.
 1.79  11-Oct-2000  thorpej Use ether_ioctl().
 1.78  11-Oct-2000  onoe Add flags to indicate that tlp_init() should set some more BUSMODE bits.
TULIPF_BLE /* data is big endian */
TULIPF_DBO /* descriptor is big endian */
These setting is required for Big-endian bus front-end (such as APbus for
newsmips) to work with tulip. Also,
sc_maxburst
member is added to the tulip_softc to limit the maximum burst length.
This member defaults to zero which means no restriction for burst length.
 1.77  09-Oct-2000  enami Move inclusion of rnd.h and sys/rnd.h from tulip.c to tulipvar.h.
 1.76  09-Oct-2000  enami Make tulip a random source.
 1.75  05-Oct-2000  bouyer When 802.1Q MTU, we have to ignore the Frame Too Long errors, and there's no
need to disable RWT and JAB.
 1.74  03-Oct-2000  thorpej Support ETHERCAP_VLAN_MTU by igorning Receive Watchdog and Transmit Jabber
errors if VLANs are configured on the interface.
 1.73  03-Oct-2000  thorpej Add support for the ADMtek AN983 and AN985.
 1.72  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.71  03-Aug-2000  castor Support some differences in the Macronix 98715AEC-C and E chips from the other
98715* series.

The MX98715AEC-[C,E] use a different location in the serial eerom for
LED control, and programming it with the original location's values
caused unpredictable behavior.

Also, start integrating fixes where media changes on an adapter
under load may fail. There's more work to be done here, but I need
to sort out our internal changes a little more carefully.
 1.70  04-Jul-2000  thorpej Remove work-around for Lite-On PNIC in tlp_filter_setup() that is
apparently no longer necessary (probably due to other fixes that
have happened in the filter setup path) and is in fact harmful.

Based on a patch from Krister Walfridsson, who claims this makes
his newer NetGear FA-310TX work (although, my older NetGear FA-310TX
still does not, but fails in an entirely different way).
 1.69  28-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.68  26-May-2000  thorpej branches: 1.68.4;
Add support for the Davicom DM9102 and DM9102A 10/100 Ethernet chips.

Partially based on diffs submitted by Matthew Orgass <darkstar@pgh.net>
and IWAMOTO Toshihiro <iwamoto@sat.t.u-tokyo.ac.jp>.
 1.67  25-May-2000  thorpej So, while the DEC chips and other clones want no FS|LS in the
setup descriptor, apparently the Xircom X3201-3 requires it.
 1.66  25-May-2000  thorpej Fix a couple of typos in debugging messages. From IWAMOTO Toshihiro,
kern/10194.
 1.65  25-May-2000  thorpej Don't set FS and LS in the setup packet descriptor. From
IWAMOTO Toshihiro <iwamoto@sat.t.u-tokyo.ac.jp>, kern/10194,
and confirmed with the 21040 manual.
 1.64  18-May-2000  thorpej Use big-endian CRC on ADMtek multicast hash.
 1.63  12-May-2000  thorpej If using ring-mode, don't update the receive descriptor list base address
when a receive overrun occurs. From Castor Fu <castor@geocast.com>.
 1.62  12-May-2000  thorpej Use ether_crc32_le().
 1.61  07-Apr-2000  thorpej Add a patchable variable `tlp_srom_debug' that enables dumping of
SROM output, etc.
 1.60  04-Apr-2000  thorpej - if_tlp_cardbus.c: Use the `pmreg' pointer passed by by
cardbus_get_capability() [mirror change already made to if_tlp_pci.c]
- if_tlp_cardbus.c: If we don't find an ISV SROM, try to grab the
Ethernet address from the CIS.
- if_tlp_cardbus.c: set CardBus cards to store-and-forward mode from
the get-go.
- Put the TxThresh tables in tulipvar.h, and use them in the CardBus
and PCI front-ends to go to store-and-forward mode.
- Document the Xircom X3201-3 clone a little more.
 1.59  02-Apr-2000  mycroft If the SROM size is to far out of range, issue a diagnostic and set the size
to 1Kb. Some boards (e.g. my SMC9332) have a broken MicroWire interface.
 1.58  02-Apr-2000  thorpej Slight correction to last: really only do it if it's a 21142 or 21143.
 1.57  02-Apr-2000  mycroft When using MII on 2114[23] chips, zero the SIA TXRX register to disable the
internal Nway engine. This fixed a major performance problem.
Thanks to Matt Thomas for pointing this out.
 1.56  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.55  20-Mar-2000  thorpej Get rid of the powerhook when we detach.
 1.54  19-Mar-2000  thorpej Add suspend/resume hooks to ensure that the chip doesn't scramble memory
after an APM suspend and is unsnoozed after an APM resume.
 1.53  15-Mar-2000  thorpej Add power management support to the `tlp' driver. The battery on my
laptop lasts a whole lot longer now.
 1.52  10-Mar-2000  thorpej Slight change to the SROM size printf.
 1.51  07-Mar-2000  enami Add missing `cnt++'.
 1.50  07-Mar-2000  enami Also, fix indentation in previous commit.
 1.49  07-Mar-2000  soren Fix bug in previous.
 1.48  07-Mar-2000  soren Only print SROM size if TLP_DEBUG.
 1.47  07-Mar-2000  mycroft Determine the size of the SROM by probing the chip using the standard Microwire
protocol. Eliminates the need for srom_quirks and some other trash.
 1.46  06-Mar-2000  thorpej No longer necessary to futz with ifp->if_baudrate here.
 1.45  06-Mar-2000  enami Remove redundant assignment.
 1.44  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.43  02-Feb-2000  thorpej Bring some order to the chaos which was the MII code function naming
"conventions".
 1.42  01-Feb-2000  thorpej First cut at detach support; doens't fully work yet.
 1.41  28-Jan-2000  thorpej When possible, use ring mode for descriptors. Not only is this slightly
more efficient on genuine DEC chips, but some clones apparently Lose Badly
if you use chain mode. To further complicate things, some clones *only*
do chain mode, so make this whole mess conditional.
 1.40  28-Jan-2000  thorpej Just use a regular Tx descriptor for the setup packet; don't bother with
a separate one.
 1.39  25-Jan-2000  thorpej Some changes for the Xircom X3201-3 in 21143 emulation mode:
- The Xircom doesn't bring itself out of reset; we have to do it.
- The Xircom requires transmit buffers to be aligned to 4 bytes, too.

Partially from Rafal Boni (though the Tx buffer alignment issue is
handled much differently in this version).
 1.38  25-Jan-2000  thorpej Add a chip type for the Xircom X3201-3, and centralize the declaration
of the chip names array.
 1.37  25-Jan-2000  thorpej When checking for a non-standard address ROM format, allow the
Cobalt Networks address ROM through.

From Soren S. Jorvang <soren@wheel.dk>
 1.36  15-Dec-1999  tsutsui add one more htole32().
fixes "tlp0: filter setup timeout" on my macppc.
 1.35  11-Dec-1999  thorpej - Don't try to run the chip in big-endian mode. Not all chips support
this consistently, and it doesn't always work even when the chip
supports it.
- Make sure things DMA'd to the chip that the chip interprets are in
little-endian mode.
 1.34  07-Dec-1999  thorpej When checking the SROM checksum, if the standard location fails, try
the new standard location (according to the SROM format update document
for the 21143). From Masanori Kanaoka.
 1.33  19-Nov-1999  thorpej - Use the common MII bit-bang module.
- Add support other than 128-byte SROMs.
- Add support for the 21142/21143 MII.
 1.32  12-Nov-1999  thorpej Call mii_down() as appropriate.
 1.31  04-Nov-1999  thorpej Do rd/line and rd/mult on the MX98725 and LC82C115, too.
 1.30  04-Nov-1999  thorpej Use Memory Read Line and Memory Read Multiple on the 21140, 21140A,
21142, and 21143, if the PCI bus says its okay.
 1.29  04-Nov-1999  thorpej Adapt to mii_phy_probe() change.
 1.28  03-Nov-1999  thorpej Update for ifmedia changes.
 1.27  03-Nov-1999  thorpej More or less completely rewrite the way DECchip media is handled, and
add support for the DECchip 21142/21143 SIA/SYM media. Make the Macronix
98713 behave like a 21140A, and the 98713A and later behave like a 21143.
Nuke all of the Macronix-specific Nway code, as it will be identical to
the 21143 Nway code once it is written.
 1.26  30-Sep-1999  thorpej branches: 1.26.2; 1.26.4; 1.26.8;
Set the LED mode per the EEPROM on Macronix chips.
 1.25  30-Sep-1999  thorpej Changes to get the Lite-On/Macronix 82C115 working:
- 82C115 has a 128-bit multicast hash table, not 512-bit.
- Correct the way the MAC address is read from the SROM, after re-reading
the MX98715A Application Note.

Other semi-related changes:
- Differentiate between MX98715 and MX98715A.
- Improve the Macronix link-up/link-down detection.
 1.24  30-Sep-1999  thorpej Add link-up/link-down detection for the Macronix NWay block.
 1.23  29-Sep-1999  thorpej Add some optional stats gathering, and fix tx stats counting; use the last
descriptor in the packet, not the first.
 1.22  29-Sep-1999  thorpej Grumble, yet another chip-designers-and-manual-writers-disagree. Deal with
this by frobbing the 10TCTL register minimally, toggling only the bit we
care about (and hoping that link-capability advertisement happens correctly).

MX98715 can talk to the network now.
 1.21  29-Sep-1999  thorpej - Get a little closer on the Macronix chips. Still some more work to do.
- Add some basic support for the ADMtek AL981 clone (which, unfortunately,
I can't test until my sample boards arrive).
 1.20  28-Sep-1999  thorpej Oops, Macronix MX98713A doesn't have GPIO direction bits in the SROM
because it doesn't have a GPIO port (CSR12 is the `10baseT status'
register on this chip revision).
 1.19  27-Sep-1999  thorpej Initial support for 21140[A] GPR media.
 1.18  26-Sep-1999  thorpej Make tlp_read_srom() work on big-endian systems.

From a patch supplied by Luoqi Chen <luoqi@chekov.watermarkgroup.com>.
 1.17  25-Sep-1999  thorpej Add support for the DECchip 21140[A]. This currently only works with
boards which use MII for media attachment.

ISV SROM format information lifted from Matt Thomas's `de' driver.

Thanks to Dave Sainty for experimenting w/ his 21140A MII boards, and
for supplying a fix to the MII bit-bang code (PR #8382).
 1.16  21-Sep-1999  thorpej A couple more hacks for the Lite-On PNIC:
- Only use 16 longword bursts.
- Reset the interface for receive filter setups that don't come from
the reset path.

Hi, Jason is getting really tired of broken clone chips, and really wishes
real 21140 boards were still available, because the DEC chips seem to work
Just Dandy.
 1.15  20-Sep-1999  thorpej Remove the has-mii-doesn't-have-mii OPMODE block from tlp_init(), and
let the pre-init hook and media switch routines handle it all.
 1.14  20-Sep-1999  thorpej Remove special-case 2114x-set-OPMODE_MBO; it's done in the pre-init hook
now.
 1.13  20-Sep-1999  thorpej Add support for the DECchip 21041. This also adds some preliminary
support for the ISV SROM format used in the 2114{1,1A,2,3}. Note, like
the 21040, auto-sense is not yet supported for the 21041.

Add a "pre-init" hook, which will be used for the 2114x and PNIC (currently)
which allows chip-specific code to set up and write OPMODE before the
chip is reset. This is necessary in order for the chip's internal
pathways to get initialized properly for MII/SYM/PCS/SIA media attachments.

Thanks to Dave Sainty for the hint from the `de' driver that inspired the
pre-init hook.
 1.12  19-Sep-1999  thorpej Fix a buglet in tlp_reset(): don't touch the Tulip for at least 50
PCI cycles after starting the reset; it won't respond. This will
cause a machine check on some Alpha core logic chipsets (e.g. 21071 APECS).
 1.11  17-Sep-1999  thorpej If the interface is not marked as running, abort tlp_intr() early.
 1.10  14-Sep-1999  thorpej Apparently can't really look at excessive collitions and late collisions
in completed transmit descriptors. These seem to be set even on successful
packet transmissions on my AlphaStation 500's 21040.
 1.9  14-Sep-1999  thorpej First crack at shared ROM/shared interrupts on 21040 multi-port boards,
plus quirk identification for non-multiple-port boards.
 1.8  14-Sep-1999  thorpej Change the semantics of `sc_regshift'; it is now the shift required to
make a CSR index number into a CSR offset. Introduce a couple of macros
to handle CSR name -> offset conversion.
 1.7  14-Sep-1999  thorpej - More PNIC NWAY stuff. Still more work to do, here.
- Fix the SROM checksum routine.
- Add code to parse the old DEC Address ROM SROM format.
- Rearrange the statchg routines a bit, to make them consistent with one
another.
- Add support for the DECchip 21040. XXX No support for media autosense
yet, and no support for any of the multi-port boards yet.
 1.6  09-Sep-1999  thorpej Snapshot of work-in-progress to support the internal NWay block on
the Lite-On PNIC chips. Not finished yet; some other infrastructure
work left to do.
 1.5  02-Sep-1999  thorpej Deal with some more Winbond differences, after a more-thorough-than-before
reading of its manual.
 1.4  01-Sep-1999  thorpej Make Tulip-style filter setup interrupt-driven.
 1.3  01-Sep-1999  thorpej Don't attempt to do transmit threshold tuning on the Lite-On PNCI; just
put it in Store-and-Forward mode right from the get-go. This eliminates
the DMA underrun errors that prevented the receive filter setup from working
and caused smashed packets to go out onto the wire.

My NetGear FA310-TX board now works.

There are still "filter setup failed to complete" messages, however they
don't appear to indicate that the filter setup actually failed, since
unicast and multicast packet reception work fine. I will address this
problem shortly.

Reading the log for the FreeBSD `pn' driver suggests that these chips are,
in fact, pretty crappy, riddled with hardware bugs (for which more workarounds
are coming).
 1.2  01-Sep-1999  thorpej Some of the Tulip clone chips (like the Winbond and ASIX) want the
IC bit set in the *first* descriptor of the outgoing packet. Appease
them.
 1.1  01-Sep-1999  thorpej This is the long-awaited "new Tulip driver", a complete, from-scratch
rewrite of the driver for the DECchip 21x4x Ethernet chips, and a variety
of clones.

Currently, the driver supports the Winbond 89C840F (this works pretty
well), and the Lite-On PNIC (e.g. NetGear PCI boards), however Lite-On
support may be broken [I may simply have a busted test board].

Eventually, support for the Macronix and ASIX chips will filter into
this driver, and then, slowly, support for the genuine DEC chips,
and maybe even the DE-425 EISA model.
 1.26.8.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.26.4.1  15-Nov-1999  fvdl Sync with -current
 1.26.2.7  12-Mar-2001  bouyer Sync with HEAD.
 1.26.2.6  11-Feb-2001  bouyer Sync with HEAD.
 1.26.2.5  18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.26.2.4  05-Jan-2001  bouyer Sync with HEAD
 1.26.2.3  08-Dec-2000  bouyer Sync with HEAD.
 1.26.2.2  22-Nov-2000  bouyer Sync with HEAD.
 1.26.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.68.4.7  06-May-2001  he Pull up revision 1.82 (via patch, requested by he):
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.68.4.6  23-Apr-2001  he Pull up revisions 1.73,1.87 (via patch, requested by hubertf):
Support Accton EN2242 and other AmdTek AN985 compatible cards
with the tlp(4) driver.
 1.68.4.5  26-Jan-2001  jhawk Pull up revision 1.85 (requested by thorpej):
Ignore recieve errors if VLAN_MTU is enabled.
 1.68.4.4  31-Dec-2000  jhawk Pull up revisions 1.74-1.75 (requested by bouyer):
Add support for 802.1Q virtual LANs.
 1.68.4.3  17-Oct-2000  tv Pullup 1.76 and 1.77 [enami]:
Make tulip a random source.
 1.68.4.2  09-Aug-2000  castor Pulling up
ic/tulipvar.h diffs between 1.36 and 1.37
ic/tulipreg.h diffs between 1.21 and 1.20
ic/ tulip.c diffs between 1.70 and 1.71
pci/if_tlp_pci.c diffs between 1.43 and 1.46

requested by tls and thorpej, approved by thorpej

> date: 2000/08/03 03:07:31; author: castor; state: Exp;
lines: +5 -1 Support some differences in the Macronix
98715AEC-C and E chips from the other 98715* series.

The MX98715AEC-[C,E] use a different location in the serial eerom for
LED control, and programming it with the original location's values
caused unpredictable behavior.

Also, start integrating fixes where media changes on an adapter
under load may fail. There's more work to be done here, but I need
to sort out our internal changes a little more carefully.
 1.68.4.1  04-Jul-2000  thorpej Pull up rev. 1.70:
Remove work-around for Lite-On PNIC in tlp_filter_setup() that is
apparently no longer necessary (probably due to other fixes that
have happened in the filter setup path) and is in fact harmful.

Based on a patch from Krister Walfridsson, who claims this makes
his newer NetGear FA-310TX work (although, my older NetGear FA-310TX
still does not, but fails in an entirely different way).
 1.91.2.11  18-Oct-2002  nathanw Catch up to -current.
 1.91.2.10  01-Aug-2002  nathanw Catch up to -current.
 1.91.2.9  20-Jun-2002  nathanw Catch up to -current.
 1.91.2.8  17-Apr-2002  nathanw Catch up to -current.
 1.91.2.7  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.91.2.6  28-Feb-2002  nathanw Catch up to -current.
 1.91.2.5  08-Jan-2002  nathanw Catch up to -current.
 1.91.2.4  14-Nov-2001  nathanw Catch up to -current.
 1.91.2.3  21-Sep-2001  nathanw Catch up to -current.
 1.91.2.2  24-Aug-2001  nathanw Catch up with -current.
 1.91.2.1  21-Jun-2001  nathanw Catch up to -current.
 1.94.2.7  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.94.2.6  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.94.2.5  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.94.2.4  11-Feb-2002  jdolecek Sync w/ -current.
 1.94.2.3  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.94.2.2  25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.94.2.1  03-Aug-2001  lukem update to -current
 1.98.2.1  01-Oct-2001  fvdl Catch up with -current.
 1.99.2.1  12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.113.4.4  28-Jul-2003  he Pull up revisions 1.116,1.119 (requested by thorpej in ticket #845):
Add a missing DELAY() in the initial GPIO setup for the 21140.
For the 21142/21143 internal Nway, only advertise/resolve media for
which we have SROM blocks. Fixes panic on DEC PWS, which only has
built-in 10BaseT media.
 1.113.4.3  07-Dec-2002  he Pull up revision 1.121 (requested by minoura in ticket #943):
Check existence of the default 10baseT media for 21140.
If none exists, fall back to the first.
 1.113.4.2  15-Jul-2002  thorpej pullup-1-6 ticket #505 (chuq).

Original log message:
use the SROM info to set the media in 2114[23] autonegotiation
rather than just fiddling the opmode CSR, since we might
need to change the SIA CSRs as well (eg. for some ZNYX cards).
from PR 17510.
 1.113.4.1  10-Jul-2002  lukem Pull up revision 1.117 (requested by chuck in ticket #454):
only powerdown on a suspend. do not powerdown on a standby (PR#17537).
 1.113.2.2  15-Jul-2002  gehenna catch up with -current.
 1.113.2.1  20-Jun-2002  gehenna catch up with -current.
 1.122.2.12  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.122.2.11  01-Apr-2005  skrll Sync with HEAD.
 1.122.2.10  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.122.2.9  07-Feb-2005  skrll Sunc with HEAD.
 1.122.2.8  06-Feb-2005  skrll Sync with HEAD.
 1.122.2.7  04-Feb-2005  skrll Sync with HEAD.
 1.122.2.6  18-Dec-2004  skrll Sync with HEAD.
 1.122.2.5  02-Nov-2004  skrll Sync with HEAD.
 1.122.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.122.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.122.2.2  12-Aug-2004  skrll Sync with HEAD.
 1.122.2.1  03-Aug-2004  skrll Sync with HEAD
 1.126.4.2  30-Jan-2005  he Pull up revision 1.129 (requested by thorpej in ticket #940):
When adding or deleting multicast addresses, only change
the address filter if the interface is marked RUNNING.
Fixes PR#37678.
 1.126.4.1  11-Jan-2005  jmc Pullup rev 1.130 (requested by sketch in ticket #1084)

Silence the 'receive process failed to idle' message on the Davicom DM9102A.
 1.126.2.1  11-Jan-2005  jmc Pullup rev 1.130 (requested by sketch in ticket #1084)

Silence the 'receive process failed to idle' message on the Davicom DM9102A.
 1.130.4.3  26-Mar-2005  yamt sync with head.
 1.130.4.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.130.4.1  12-Feb-2005  yamt sync with head.
 1.130.2.1  29-Apr-2005  kent sync with -current
 1.135.2.1  01-Jul-2005  tron Pull up revision 1.137 (requested by rpaulo in ticket #493):
Add support for ASIX AX88140A/AX88141 chipsets using only
the 10/100 MII with inspiration from FreeBSD dc(4) driver.
Tested on i386 and macppc.
Reviewed by Jason Thorpe and ok'ed by Hubert Feyrer.
 1.137.2.8  24-Mar-2008  yamt sync with head.
 1.137.2.7  17-Mar-2008  yamt sync with head.
 1.137.2.6  21-Jan-2008  yamt sync with head
 1.137.2.5  27-Oct-2007  yamt sync with head.
 1.137.2.4  03-Sep-2007  yamt sync with head.
 1.137.2.3  26-Feb-2007  yamt sync with head.
 1.137.2.2  30-Dec-2006  yamt sync with head.
 1.137.2.1  21-Jun-2006  yamt sync with head.
 1.141.6.2  01-Jun-2006  kardel Sync with head.
 1.141.6.1  22-Apr-2006  simonb Sync with head.
 1.141.4.1  09-Sep-2006  rpaulo sync with head
 1.141.2.1  01-Mar-2006  yamt sync with head.
 1.142.6.1  28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.142.4.1  19-Apr-2006  elad sync with head.
 1.142.2.3  03-Sep-2006  yamt sync with head.
 1.142.2.2  26-Jun-2006  yamt sync with head.
 1.142.2.1  01-Apr-2006  yamt sync with head.
 1.144.2.1  19-Jun-2006  chap Sync with head.
 1.145.4.1  10-Sep-2006  tron Pull up following revision(s) (requested by rumble in ticket #137):
sys/dev/ic/tulip.c: revision 1.146
Phobos boards (my G130 at least) have a non-standard srom layout. Try to
identify it and pull out the enaddr.
 1.146.4.1  22-Oct-2006  yamt sync with head
 1.146.2.1  18-Nov-2006  ad Sync with head.
 1.147.4.2  12-Mar-2007  rmind Sync with HEAD.
 1.147.4.1  27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.147.2.1  04-Mar-2007  bouyer Pull up following revision(s) (requested by rumble in ticket #478):
sys/dev/pci/if_tl.c: revision 1.78 - 1.80
sys/dev/ic/tulip.c: revision 1.148
Make the ThunderLAN part of the Set Engineering GIO board for sgimips (IP22)
work.
Extract mac addresses on Phobos G100 boards.
 1.149.4.1  11-Jul-2007  mjf Sync with head.
 1.149.2.3  23-Oct-2007  ad Sync with head.
 1.149.2.2  09-Oct-2007  ad Sync with head.
 1.149.2.1  01-Jul-2007  ad Adapt to callout API change.
 1.150.6.3  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.150.6.2  02-Oct-2007  joerg Sync with HEAD.
 1.150.6.1  03-Sep-2007  jmcneill Sync with HEAD.
 1.150.2.1  03-Sep-2007  skrll Sync with HEAD.
 1.152.4.1  06-Oct-2007  yamt sync with head.
 1.152.2.3  23-Mar-2008  matt sync with HEAD
 1.152.2.2  09-Jan-2008  matt sync with HEAD
 1.152.2.1  06-Nov-2007  matt sync with HEAD
 1.153.2.1  25-Oct-2007  bouyer Sync with HEAD.
 1.154.8.3  20-Jan-2008  bouyer Sync with HEAD
 1.154.8.2  19-Jan-2008  bouyer Sync with HEAD
 1.154.8.1  02-Jan-2008  bouyer Sync with HEAD
 1.154.2.1  18-Feb-2008  mjf Sync with HEAD.
 1.157.6.3  17-Jan-2009  mjf Sync with HEAD.
 1.157.6.2  02-Jun-2008  mjf Sync with HEAD.
 1.157.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.157.2.1  24-Mar-2008  keiichi sync with head.
 1.162.4.5  11-Aug-2010  yamt sync with head.
 1.162.4.4  11-Mar-2010  yamt sync with head
 1.162.4.3  16-Sep-2009  yamt sync with head
 1.162.4.2  04-May-2009  yamt sync with head.
 1.162.4.1  16-May-2008  yamt sync with head.
 1.162.2.1  18-May-2008  yamt sync with head.
 1.163.8.2  28-Apr-2009  skrll Sync with HEAD.
 1.163.8.1  19-Jan-2009  skrll Sync with HEAD.
 1.163.6.1  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.164.4.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.174.4.2  05-Mar-2011  rmind sync with head
 1.174.4.1  30-May-2010  rmind sync with head
 1.174.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.179.6.1  18-Feb-2012  mrg merge to -current.
 1.179.2.3  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.179.2.2  30-Oct-2012  yamt sync with head
 1.179.2.1  17-Apr-2012  yamt sync with head
 1.180.8.1  05-Mar-2015  riz Pull up following revision(s) (requested by nakayama in ticket #1262):
sys/dev/ic/tulip.c: revision 1.185
Stop the interface before detaching to avoid the race between
tlp_detach() and tlp_intr().
While there, add missing callout_destroy()s.
 1.180.6.1  05-Mar-2015  riz Pull up following revision(s) (requested by nakayama in ticket #1262):
sys/dev/ic/tulip.c: revision 1.185
Stop the interface before detaching to avoid the race between
tlp_detach() and tlp_intr().
While there, add missing callout_destroy()s.
 1.180.2.1  05-Mar-2015  riz Pull up following revision(s) (requested by nakayama in ticket #1262):
sys/dev/ic/tulip.c: revision 1.185
Stop the interface before detaching to avoid the race between
tlp_detach() and tlp_intr().
While there, add missing callout_destroy()s.
 1.181.4.1  18-May-2014  rmind sync with head
 1.181.2.2  03-Dec-2017  jdolecek update from HEAD
 1.181.2.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.183.2.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.184.4.6  28-Aug-2017  skrll Sync with HEAD
 1.184.4.5  05-Feb-2017  skrll Sync with HEAD
 1.184.4.4  05-Oct-2016  skrll Sync with HEAD
 1.184.4.3  09-Jul-2016  skrll Sync with HEAD
 1.184.4.2  19-Mar-2016  skrll Sync with HEAD
 1.184.4.1  06-Apr-2015  skrll Sync with HEAD
 1.184.2.1  03-Mar-2015  snj Pull up following revision(s) (requested by nakayama in ticket #558):
sys/dev/ic/tulip.c: revision 1.185
Stop the interface before detaching to avoid the race between
tlp_detach() and tlp_intr().
While there, add missing callout_destroy()s.
 1.188.2.1  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.190.8.2  26-Jan-2019  pgoyette Sync with HEAD
 1.190.8.1  28-Jul-2018  pgoyette Sync with HEAD
 1.191.2.3  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.191.2.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.191.2.1  10-Jun-2019  christos Sync with HEAD
 1.197.2.1  31-Jan-2020  martin Pull up following revision(s) (requested by msaitoh in ticket #672):

sys/dev/ic/tulip.c: revision 1.198
sys/dev/pci/if_jme.c: revision 1.45
sys/dev/pci/agp.c: revision 1.86
sys/dev/pci/if_lii.c: revision 1.27
sys/dev/acpi/thinkpad_acpi.c: revision 1.47
sys/dev/scsipi/scsipi_base.c: revision 1.183
sys/dev/ic/aic6915reg.h: revision 1.6

Fix undefined behavior in thinkpad_mask_init(). Found by kUBSan.

Use unsigned when initialize the transmit completion ring to avoid undefined
behavior. Found by kUBSan.

Avoid undefined behavior when setting multicast address. found by kUBSan.

Use unsigned to avoid undefined behavior in agpattach(). Found by kUBSan.

Avoid undefined behavior in jme_mii_write(). Found by kUBSan.

Use unsigned to avoid undefined behavior in lii_setmulti().

Use unsigned to avoid undefined behavior in scsipi_{get,put}_tag().

Found by kUBSan.
 1.200.2.1  29-Feb-2020  ad Sync with head.

RSS XML Feed