summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2007-04-30 22:02:24 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2007-04-30 22:02:24 +0000
commit37ee79777e65570eccad503da3158f9c0ec12da6 (patch)
tree42e9d2e6e503fa74e7daee4a5c6c8f845e6cadb3 /sys
parentcaf35766e66f7da42e8a0961f12fb0b223c2b242 (diff)
run the nx_tick function every second to check the link state, even if
the interface is down.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_nx.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/pci/if_nx.c b/sys/dev/pci/if_nx.c
index d8c8ac0716b..f49921164ee 100644
--- a/sys/dev/pci/if_nx.c
+++ b/sys/dev/pci/if_nx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_nx.c,v 1.27 2007/04/30 21:41:02 reyk Exp $ */
+/* $OpenBSD: if_nx.c,v 1.28 2007/04/30 22:02:23 reyk Exp $ */
/*
* Copyright (c) 2007 Reyk Floeter <reyk@openbsd.org>
@@ -949,7 +949,8 @@ nx_attach(struct device *parent, struct device *self, void *aux)
if_attach(ifp);
ether_ifattach(ifp);
- timeout_set(&nx->nx_tick, nx_tick, sc);
+ timeout_set(&nx->nx_tick, nx_tick, nx);
+ timeout_add(&nx->nx_tick, hz);
return;
}
@@ -1146,9 +1147,14 @@ void
nx_tick(void *arg)
{
struct nx_softc *nx = (struct nx_softc *)arg;
+ struct nxb_softc *sc = nx->nx_sc;
+
+ if (sc->sc_state != NX_S_READY)
+ goto done;
nx_link_state(nx);
+ done:
timeout_add(&nx->nx_tick, hz);
}