diff options
author | 2013-12-06 21:03:01 +0000 | |
---|---|---|
committer | 2013-12-06 21:03:01 +0000 | |
commit | 37ecb59650d3f381e0120446318f17da385095e3 (patch) | |
tree | c81a3d99b5090a799f492b07d59e5f336209bce0 /sys/dev/pci/if_ipw.c | |
parent | It seems to be possible to truncate an object while it is still mapped. (diff) | |
download | wireguard-openbsd-37ecb59650d3f381e0120446318f17da385095e3.tar.xz wireguard-openbsd-37ecb59650d3f381e0120446318f17da385095e3.zip |
Add a DVACT_WAKEUP op to the *_activate() API. This is called after the
kernel resumes normal (non-cold, able to run processes, etc) operation.
Previously we were relying on specific DVACT_RESUME op's in drivers
creating callback/threads themselves, but that has become too common,
indicating the need for a built-in mechanism.
ok dlg kettenis, tested by a sufficient amount of people
Diffstat (limited to 'sys/dev/pci/if_ipw.c')
-rw-r--r-- | sys/dev/pci/if_ipw.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c index 5bcdd04a692..62eeb716f79 100644 --- a/sys/dev/pci/if_ipw.c +++ b/sys/dev/pci/if_ipw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ipw.c,v 1.97 2013/11/14 12:41:14 dlg Exp $ */ +/* $OpenBSD: if_ipw.c,v 1.98 2013/12/06 21:03:04 deraadt Exp $ */ /*- * Copyright (c) 2004-2008 @@ -25,7 +25,6 @@ #include <sys/param.h> #include <sys/sockio.h> -#include <sys/task.h> #include <sys/workq.h> #include <sys/mbuf.h> #include <sys/kernel.h> @@ -65,7 +64,7 @@ int ipw_match(struct device *, void *, void *); void ipw_attach(struct device *, struct device *, void *); int ipw_activate(struct device *, int); -void ipw_resume(void *, void *); +void ipw_wakeup(struct ipw_softc *); int ipw_dma_alloc(struct ipw_softc *); void ipw_release(struct ipw_softc *); int ipw_media_change(struct ifnet *); @@ -171,8 +170,6 @@ ipw_attach(struct device *parent, struct device *self, void *aux) sc->sc_pct = pa->pa_pc; sc->sc_pcitag = pa->pa_tag, - task_set(&sc->sc_resume_t, ipw_resume, sc, NULL); - /* clear device specific PCI configuration register 0x41 */ data = pci_conf_read(sc->sc_pct, sc->sc_pcitag, 0x40); data &= ~0x0000ff00; @@ -303,8 +300,8 @@ ipw_activate(struct device *self, int act) if (ifp->if_flags & IFF_RUNNING) ipw_stop(ifp, 0); break; - case DVACT_RESUME: - task_add(systq, &sc->sc_resume_t); + case DVACT_WAKEUP: + ipw_wakeup(sc); break; } @@ -312,9 +309,8 @@ ipw_activate(struct device *self, int act) } void -ipw_resume(void *arg1, void *arg2) +ipw_wakeup(struct ipw_softc *sc) { - struct ipw_softc *sc = arg1; struct ifnet *ifp = &sc->sc_ic.ic_if; pcireg_t data; int s; |