« Previous | Next » 

Revision b9d03e35

IDb9d03e352cb6b31a66545763f6a1e20c9abf0c2c

Added by Jason Wang almost 12 years ago

e1000: link auto-negotiation emulation

Indeed, there's nothing else except for the time spent on the
negotiation needs to be emulated. This is needed for resuming windows
guest from hibernation, as without a proper delay, qemu would send the
packet too early ( guest even does not have a proper intr handler),
which could lead windows guest hang.

This patch first introduces an array of function pointers to make it
possible to emulate per-register write behavior. Then traps the
PHY_CTRL register write and when guest want to restart the link auto
negotiation, we would down the link and mark the auto negotiation in
progress in PHY_STATUS register. After time, a timer with 500 ms (
which is the minimum timeout of auto-negotation specified in 802.3
spec). The link would be up when timer expired.

Test with resuming windows guest plus flood ping and linux ethtool
linkstatus test.

Signed-off-by: Jason Wang <>
Signed-off-by: Michael S. Tsirkin <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences