From de2365f8903f8646f5a2245b3f5be8beff11d7be Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Mon, 8 Sep 2008 08:10:55 +0000 Subject: Fix a link state issue reported by reyk@ In some situations we were not clearing pending link state attentions. Because of this we were not getting further interrupts for link state changes, thus never went into iface UP state. Force an interrupt at the end of bge_ifmedia_upd so we will call bge_link_upd, clear the link state attention and get further interrupts. From FreeBSD ok reyk@ --- sys/dev/pci/if_bge.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'sys/dev/pci') diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index 07ec2db9353..3b9959d4b60 100644 --- a/sys/dev/pci/if_bge.c +++ b/sys/dev/pci/if_bge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bge.c,v 1.241 2008/08/26 19:43:05 kettenis Exp $ */ +/* $OpenBSD: if_bge.c,v 1.242 2008/09/08 08:10:54 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -3216,6 +3216,20 @@ bge_ifmedia_upd(struct ifnet *ifp) } mii_mediachg(mii); + /* + * Force an interrupt so that we will call bge_link_upd + * if needed and clear any pending link state attention. + * Without this we are not getting any further interrupts + * for link state changes and thus will not UP the link and + * not be able to send in bge_start. The only way to get + * things working was to receive a packet and get a RX intr. + */ + if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5700 || + sc->bge_flags & BGE_IS_5788) + BGE_SETBIT(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_INTR_SET); + else + BGE_SETBIT(sc, BGE_HCC_MODE, BGE_HCCMODE_COAL_NOW); + return (0); } -- cgit v1.2.3