Pyun YongHyeon 66c6108d5d Rework link establishment and link state detection logic.
- Remove MIIBUS statchg callback and program VGE_DIAGCTL before
   initiating link establishment.  Previously driver used to
   program VGE_DIAGCTL after getting a link in statchg callback.
   It seems the VGE_DIAGCTL register works like a kind of MII
   register such that it requires setting a 'to be' mode in advance
   rather than relying on resolved speed/duplex of established link.
   This means the statchg callback is not needed in driver.  In
   addition, if there was no link at the time of media change, this
   was not called at all.
 - Introduce vge_ifmedia_upd_locked() to change current media to
   configured one.  Actual media change is performed only after PHY
   reset and VGE_DIAGCTL setup.
 - In WOL configuration, make sure to clear forced mode such that
   controller can rely on auto-negotiation.
 - Unlike most other drivers that use miibus(4), vge(4) used
   controller's auto-polling feature for link state tracking via
   interrupt.  This came from controller's inefficient mechanism to
   access MII registers.  On link state change interrupt, vge(4)
   used to get current link state with series of MII register
   accesses.  Because vge(4) already enabled auto polling, read PHY
   status register to resolved speed/duplex/flow control parameters.

vge(4) still does not drive MII_TICK to reduce number of MII
register accesses which in turn means the driver does not know the
status of auto-negotiation.  This was a one of long standing
issue of vge(4).  Probably driver may be able to implement a timer
that keeps track of auto-negotiation state and restart
auto-negotiation when driver couldn't establish a link within a
specified period.  However the controller does not provide a
reliable way to detect auto-negotiation failure so I'm not sure
whether it's worth to implement it in driver.

Alternatively driver can completely disable MII auto-polling and
let miibus(4) poll link state by driving MII_TICK.  This may reduce
unnecessary overhead of stopping/restarting MII auto-polling of
controller.  Unfortunately it was known that some variants of
controller does not work correctly if MII auto-polling is disabled.
2011-11-22 20:45:09 +00:00
..
2011-10-13 20:06:19 +00:00
2011-10-10 02:54:58 +00:00
2011-04-23 23:11:44 +00:00
2011-06-28 08:36:48 +00:00
2011-10-18 07:29:21 +00:00
2011-10-13 20:06:19 +00:00
2011-10-18 08:09:44 +00:00
2011-03-24 08:56:12 +00:00
2011-05-15 13:17:08 +00:00
2011-06-28 08:36:48 +00:00
2011-10-07 08:59:54 +00:00
2011-11-14 20:38:14 +00:00
2011-11-21 07:50:29 +00:00
2011-10-18 08:09:44 +00:00
2011-10-16 14:30:28 +00:00