summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-02-26 02:21:32 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-02-26 02:21:32 +0000
commita2cd4ab7ffa8f82e2f3a131b13eda46124f23f5b (patch)
tree9dd1c93c39b20cc6034982d299ef1a35ccf13f54 /sys/dev
parent3a421d378205863be5f48b9cf1ee2cdb6a1eed5b (diff)
store the shutdown hook pointer in the softc struct.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_vic.c15
-rw-r--r--sys/dev/pci/if_vicvar.h3
2 files changed, 6 insertions, 12 deletions
diff --git a/sys/dev/pci/if_vic.c b/sys/dev/pci/if_vic.c
index f79279d65b2..c55a4cdb298 100644
--- a/sys/dev/pci/if_vic.c
+++ b/sys/dev/pci/if_vic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vic.c,v 1.2 2006/02/26 02:13:54 brad Exp $ */
+/* $OpenBSD: if_vic.c,v 1.3 2006/02/26 02:21:31 brad Exp $ */
/*
* Copyright (c) 2006 Reyk Floeter <reyk@openbsd.org>
@@ -113,7 +113,6 @@ vic_attach(struct device *parent, struct device *self, void *aux)
pci_intr_handle_t ih;
const char *intrstr = NULL;
struct ifnet *ifp;
- void *hook;
/* Enable memory mapping */
if (pci_mapreg_map(pa, VIC_BAR0, PCI_MAPREG_TYPE_IO, 0,
@@ -144,11 +143,6 @@ vic_attach(struct device *parent, struct device *self, void *aux)
sc->sc_dmat = pa->pa_dmat;
- if ((hook = shutdownhook_establish(vic_shutdown, sc)) == NULL) {
- printf(": failed to establish the shutdown hook\n");
- return;
- }
-
sc->sc_ver_major = VIC_READ(VIC_VERSION_MAJOR);
sc->sc_ver_minor = VIC_READ(VIC_VERSION_MINOR);
@@ -187,8 +181,7 @@ vic_attach(struct device *parent, struct device *self, void *aux)
vic_getlladdr(sc);
/* Initialise pseudo media types */
- ifmedia_init(&sc->sc_media, 0, vic_media_change,
- vic_media_status);
+ ifmedia_init(&sc->sc_media, 0, vic_media_change, vic_media_status);
ifmedia_add(&sc->sc_media, IFM_ETHER | IFM_AUTO, 0, NULL);
ifmedia_set(&sc->sc_media, IFM_ETHER | IFM_AUTO);
@@ -230,13 +223,13 @@ vic_attach(struct device *parent, struct device *self, void *aux)
if_attach(ifp);
ether_ifattach(ifp);
+ sc->sc_sdhook = shutdownhook_establish(vic_shutdown, sc);
+
/* Initialize timeout for link state update. */
timeout_set(&sc->sc_timer, vic_timer, sc);
/* XXX poll */
timeout_set(&sc->sc_poll, vic_poll, sc);
-
- return;
}
void
diff --git a/sys/dev/pci/if_vicvar.h b/sys/dev/pci/if_vicvar.h
index edc6cfefe45..72186bfa53e 100644
--- a/sys/dev/pci/if_vicvar.h
+++ b/sys/dev/pci/if_vicvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vicvar.h,v 1.2 2006/02/26 02:13:54 brad Exp $ */
+/* $OpenBSD: if_vicvar.h,v 1.3 2006/02/26 02:21:31 brad Exp $ */
/*
* Copyright (c) 2006 Reyk Floeter <reyk@openbsd.org>
@@ -65,6 +65,7 @@ struct vic_txbuf {
struct vic_softc {
void *sc_ih;
struct device sc_dev;
+ void *sc_sdhook;
struct arpcom sc_ac;
struct ifmedia sc_media;