openbsd-ports/emulators/qemu/patches/patch-hw_e1000_c

23 lines
738 B
Plaintext

$OpenBSD: patch-hw_e1000_c,v 1.1 2011/08/28 11:21:05 sthen Exp $
use MII status register for link up/down
--- hw/e1000.c.orig Fri Aug 26 02:20:32 2011
+++ hw/e1000.c Fri Aug 26 02:23:52 2011
@@ -624,10 +624,13 @@ e1000_set_link_status(VLANClientState *nc)
E1000State *s = DO_UPCAST(NICState, nc, nc)->opaque;
uint32_t old_status = s->mac_reg[STATUS];
- if (nc->link_down)
+ if (nc->link_down) {
s->mac_reg[STATUS] &= ~E1000_STATUS_LU;
- else
+ s->phy_reg[PHY_STATUS] &= ~MII_SR_LINK_STATUS;
+ } else {
s->mac_reg[STATUS] |= E1000_STATUS_LU;
+ s->phy_reg[PHY_STATUS] |= MII_SR_LINK_STATUS;
+ }
if (s->mac_reg[STATUS] != old_status)
set_ics(s, 0, E1000_ICR_LSC);