diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-08-30 20:42:55 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-08-30 20:42:55 +0000 |
commit | 0dc5c529ac587885468d2b11474fa9705127d678 (patch) | |
tree | d66e42d3da13fd1a3e5308e9aae264da44674133 /sys/dev/pci | |
parent | bbb36a164f00f5b8538f7487aef1dc973a857c29 (diff) |
ioctl versus resume-workq exclusion; cloned from iwn
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/if_wi_pci.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/dev/pci/if_wi_pci.c b/sys/dev/pci/if_wi_pci.c index d763582c442..9a6fdfe6c3f 100644 --- a/sys/dev/pci/if_wi_pci.c +++ b/sys/dev/pci/if_wi_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wi_pci.c,v 1.46 2010/08/27 18:29:44 deraadt Exp $ */ +/* $OpenBSD: if_wi_pci.c,v 1.47 2010/08/30 20:42:54 deraadt Exp $ */ /* * Copyright (c) 2001-2003 Todd C. Miller <Todd.Miller@courtesan.com> @@ -187,7 +187,18 @@ wi_pci_resume(void *arg1, void *arg2) { struct wi_softc *sc = (struct wi_softc *)arg1; + int s; + + s = splnet(); + while (sc->wi_flags & WI_FLAGS_BUSY) + tsleep(&sc->wi_flags, 0, "wipwr", 0); + sc->wi_flags |= WI_FLAGS_BUSY; + wi_init(sc); + + sc->wi_flags &= ~WI_FLAGS_BUSY; + wakeup(&sc->wi_flags); + splx(s); } void |