diff options
author | 2014-12-19 15:19:47 +0000 | |
---|---|---|
committer | 2014-12-19 15:19:47 +0000 | |
commit | 12679decf0b2d766becc536ca3bcd3ab473cef71 (patch) | |
tree | ad7a9399f7181cec448bb81eca3d29cf3d257269 | |
parent | shuffle function declarations a bit; stylistic changes only. (diff) | |
download | wireguard-openbsd-12679decf0b2d766becc536ca3bcd3ab473cef71.tar.xz wireguard-openbsd-12679decf0b2d766becc536ca3bcd3ab473cef71.zip |
Change scan and auth+assoc workq entries to taskq entries.
Identical diff originally and independently developed by blambert@.
-rw-r--r-- | sys/dev/pci/if_ipw.c | 18 | ||||
-rw-r--r-- | sys/dev/pci/if_ipwvar.h | 5 |
2 files changed, 14 insertions, 9 deletions
diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c index 752829375b4..04b4b3ebe33 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.101 2014/07/22 13:12:11 mpi Exp $ */ +/* $OpenBSD: if_ipw.c,v 1.102 2014/12/19 15:19:47 krw Exp $ */ /*- * Copyright (c) 2004-2008 @@ -25,7 +25,7 @@ #include <sys/param.h> #include <sys/sockio.h> -#include <sys/workq.h> +#include <sys/task.h> #include <sys/mbuf.h> #include <sys/kernel.h> #include <sys/socket.h> @@ -205,6 +205,9 @@ ipw_attach(struct device *parent, struct device *self, void *aux) } printf(": %s", intrstr); + task_set(&sc->sc_scantask, ipw_scan, sc, NULL); + task_set(&sc->sc_authandassoctask, ipw_auth_and_assoc, sc, NULL); + if (ipw_reset(sc) != 0) { printf(": could not reset adapter\n"); return; @@ -606,6 +609,9 @@ ipw_release(struct ipw_softc *sc) bus_dmamap_destroy(sc->sc_dmat, sbuf->map); } } + + task_del(systq, &sc->sc_scantask); + task_del(systq, &sc->sc_authandassoctask); } int @@ -680,15 +686,11 @@ ipw_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg) switch (nstate) { case IEEE80211_S_SCAN: - error = workq_add_task(NULL, 0, ipw_scan, sc, NULL); - if (error != 0) - return error; + task_add(systq, &sc->sc_scantask); break; case IEEE80211_S_AUTH: - error = workq_add_task(NULL, 0, ipw_auth_and_assoc, sc, NULL); - if (error != 0) - return error; + task_add(systq, &sc->sc_authandassoctask); break; case IEEE80211_S_RUN: diff --git a/sys/dev/pci/if_ipwvar.h b/sys/dev/pci/if_ipwvar.h index 0b222b5d43f..7dbcbd6d161 100644 --- a/sys/dev/pci/if_ipwvar.h +++ b/sys/dev/pci/if_ipwvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ipwvar.h,v 1.23 2013/12/06 21:03:04 deraadt Exp $ */ +/* $OpenBSD: if_ipwvar.h,v 1.24 2014/12/19 15:19:47 krw Exp $ */ /*- * Copyright (c) 2004-2006 @@ -117,6 +117,9 @@ struct ipw_softc { struct ipw_soft_bd srbd_list[IPW_NRBD]; struct ipw_soft_buf rx_sbuf_list[IPW_NRBD]; + struct task sc_scantask; + struct task sc_authandassoctask; + SLIST_HEAD(, ipw_soft_hdr) free_shdr; SLIST_HEAD(, ipw_soft_buf) free_sbuf; |