- Merge following link state detection fixes from FreeBSD:
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 2 May 2007 14:34:10 +0000 (14:34 +0000)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 2 May 2007 14:34:10 +0000 (14:34 +0000)
commitdb86146690071ba6bbf8d08699df3c4b29ca6940
tree009346fef500823d52c7fc2b3455652646900a94
parentd5a49382de758f2d15bc3fd90f15ca30bdd12626
- Merge following link state detection fixes from FreeBSD:
  if_bge.c rev 1.{102, 104, 113, 120, 124} (mainly oleg@freebsd.org)
  Local modifications:
  o  Split bge_link_upd() into
     bge_bcm5700_link_upd() -- for 5700 chips, except B2
     bge_tbi_link_upd()     -- for fiber interface
     bge_copper_link_upd()  -- for the rest for the bge(4) chips
     Assign one of them to bge_softc.bge_link_upd based on chip type
     in attach routine.
  o  Add bge_softc.bge_link_chg, which is setup based on chip type in
     attach routine.  It is used to check against MAC_STS to determine
     whether link state is changed or not.
  o  We always trust that "link state changed" bit in MAC_STS is correct.
  o  Keep the PCS error checks for fiber interface during link state
     changing detection.
- After above change, bge_tick() is used to drive mii_tick(), so cleanup
  brgphy_mii_phy_auto().
- In brgphy_status(), use temporary variable to hold BRGPHY_MII_AUXSTS,
  so it is not accessed twice.
- For fiber interface, correct media status reporting if link is down.
  Obtained-from: OpenBSD (brad@openbsd.org)
- Correct chip id for 5700 B1 and 5700 B2.
- Minor style changes.
sys/dev/netif/bge/if_bge.c
sys/dev/netif/bge/if_bgereg.h
sys/dev/netif/mii_layer/brgphy.c