summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2008-09-08 08:10:55 +0000
committerBrad Smith <brad@cvs.openbsd.org>2008-09-08 08:10:55 +0000
commitde2365f8903f8646f5a2245b3f5be8beff11d7be (patch)
treeade4a29753ac1438c355987c2d4eedb9bf13317c /sys/dev/pci
parent944b4292b4cde8d9db6b9db3cd894b58716c6594 (diff)
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@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/if_bge.c16
1 files changed, 15 insertions, 1 deletions
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);
}