diff options
author | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2005-02-07 15:03:51 +0000 |
---|---|---|
committer | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2005-02-07 15:03:51 +0000 |
commit | 07ade622f28a37dfb0e5d9af96dfdafc95897df9 (patch) | |
tree | 334f639e92cb8529acfe45264f5bc42006f346b1 /sys/dev/pci/if_em.c | |
parent | b8e5539854ee250cdc06b2346ffae5ec9d39a026 (diff) |
em(4) doesn't use the mii layer, call if_link_state_change() directly.
- link state changes for em now show up on the routing socket
- carp failover now occurs right away when the link goes down, rather
than waiting for several ip_output() errors to occur.
ok brad@ mpf@
Diffstat (limited to 'sys/dev/pci/if_em.c')
-rw-r--r-- | sys/dev/pci/if_em.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c index 076be718ffa..1e7816a06b5 100644 --- a/sys/dev/pci/if_em.c +++ b/sys/dev/pci/if_em.c @@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ /* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */ -/* $OpenBSD: if_em.c,v 1.37 2005/01/17 03:19:29 brad Exp $ */ +/* $OpenBSD: if_em.c,v 1.38 2005/02/07 15:03:50 mcbride Exp $ */ #include "bpfilter.h" #include "vlan.h" @@ -1961,6 +1961,7 @@ em_print_link_status(struct em_softc * sc) void em_update_link_status(struct em_softc * sc) { + struct ifnet *ifp = &sc->interface_data.ac_if; if (E1000_READ_REG(&sc->hw, STATUS) & E1000_STATUS_LU) { if (sc->link_active == 0) { em_get_speed_and_duplex(&sc->hw, @@ -1968,12 +1969,16 @@ em_update_link_status(struct em_softc * sc) &sc->link_duplex); sc->link_active = 1; sc->smartspeed = 0; + ifp->if_link_state = LINK_STATE_UP; + if_link_state_change(ifp); } } else { if (sc->link_active == 1) { sc->link_speed = 0; sc->link_duplex = 0; sc->link_active = 0; + ifp->if_link_state = LINK_STATE_DOWN; + if_link_state_change(ifp); } } |