freebsd-nq/sys/dev/mii
Stephen McKay e3c5a44915 Work around an Intel 21143 chip bug.
Rev 1.56 of if_dc.c removed calls to mii_pollstat() from the dc_tick()
routine.  dc_tick() is called regularly to detect link up and link down
status, especially when autonegotiating.

The expectation was that mii_tick() (which is still called from dc_tick())
would update status information automatically in all cases where it would
be sensible to do so.

Unfortunately, with authentic 21143 chips this is not the case, and
the driver never successfully autonegotiates.  This is because (despite
what it says in the 21143 manual) the chip always claims that link is not
present while the autonegotiation enable bit is set.  Autonegotation takes
place and succeeds, but the driver tests the link bits before it switches
off the autonegotiation enable bit, and success is not recognised.

The simplest solution is to call dcphy_status() more often for MII_TICK
calls by dropping out of the switch statement instead of exiting when
we are autonegotiating and link appears to not be present.  When
autonegotiation succeeds, dcphy_status() will note the speed and fdx/hdx
state and turn off the autonegotiation enable bit.  The next call to
dcphy_status() will notice that link is present, and the dc driver code
will be notified.

Macronix chips also use this code, but implement link detection as
described in the manual, and hence don't need this patch.  However, tests
on a Macronix 98715AEC-C show that it does not adversely affect them.

This could be done better but is the minimal effective change, and most
closely mimics what was happening prior to rev 1.56 of if_dc.c.  (Actually
I also deleted a small amount of unnecessary code while I was in the area.)

Reviewed by:	wpaul
2002-04-18 14:40:20 +00:00
..
acphy.c Remove __P. 2002-03-20 02:08:01 +00:00
acphyreg.h Add QS6612, AC101 and LXT970 personal drivers and register definitions. 2001-02-07 19:57:40 +00:00
amphy.c Remove __P. 2002-03-20 02:08:01 +00:00
amphyreg.h
brgphy.c Teach the brgphy driver about the BCM5701's internal copper PHY. 2002-03-22 06:38:52 +00:00
brgphyreg.h Fix typo: BGGPHY -> BRGPHY in one of the #defines I added the other day. 2001-09-27 17:32:49 +00:00
dcphy.c Work around an Intel 21143 chip bug. 2002-04-18 14:40:20 +00:00
devlist2h.awk
e1000phy.c Cleanup pass for mii drivers. 2001-09-29 19:18:52 +00:00
e1000phyreg.h Add Marvell PHY support for 10/100/1000 LIVENGOOD_CU Intel NIC. 2001-04-09 21:29:44 +00:00
exphy.c Remove __P. 2002-03-20 02:08:01 +00:00
inphy.c Cleanup pass for mii drivers. 2001-09-29 19:18:52 +00:00
inphyreg.h Add drivers for Intel 82553 and 82555 PHYs. 2001-03-12 02:41:57 +00:00
lxtphy.c Remove __P. 2002-03-20 02:08:01 +00:00
lxtphyreg.h Add QS6612, AC101 and LXT970 personal drivers and register definitions. 2001-02-07 19:57:40 +00:00
Makefile.miidevs
mii_physubr.c Remove __P. 2002-03-20 02:08:01 +00:00
mii.c Remove __P. 2002-03-20 02:08:01 +00:00
mii.h
miibus_if.m Add new device method miibus_linkchg, along with a service routine. 2001-09-29 18:40:06 +00:00
miidevs Teach the rlphy driver how to do parallel link detection. If the link partner 2002-04-07 20:55:50 +00:00
miidevs.h Regenerate. 2002-04-07 20:56:19 +00:00
miivar.h Remove __P. 2002-03-20 02:08:01 +00:00
mlphy.c Remove __P. 2002-03-20 02:08:01 +00:00
nsgphy.c Remove __P. 2002-03-20 02:08:01 +00:00
nsgphyreg.h Add support for gigabit ethernet cards based on the NatSemi DP83820 2001-05-11 19:56:39 +00:00
nsphy.c Remove __P. 2002-03-20 02:08:01 +00:00
nsphyreg.h
pnaphy.c Remove __P. 2002-03-20 02:08:01 +00:00
pnphy.c Remove __P. 2002-03-20 02:08:01 +00:00
qsphy.c Remove __P. 2002-03-20 02:08:01 +00:00
qsphyreg.h Add QS6612, AC101 and LXT970 personal drivers and register definitions. 2001-02-07 19:57:40 +00:00
rlphy.c Teach the rlphy driver how to do parallel link detection. If the link partner 2002-04-07 20:55:50 +00:00
tdkphy.c Remove __P. 2002-03-20 02:08:01 +00:00
tdkphyreg.h NEWCARD/Cardbus - 2000-10-19 08:34:32 +00:00
tlphy.c Remove __P. 2002-03-20 02:08:01 +00:00
tlphyreg.h
ukphy_subr.c
ukphy.c Remove __P. 2002-03-20 02:08:01 +00:00
xmphy.c Remove __P. 2002-03-20 02:08:01 +00:00
xmphyreg.h Fix reversed definitions for the bits that select half vs. full duplex. 2002-01-10 18:06:41 +00:00