diff options
-rw-r--r-- | sys/dev/pci/if_ipw.c | 12 | ||||
-rw-r--r-- | sys/dev/pci/if_iwi.c | 12 | ||||
-rw-r--r-- | sys/dev/pci/if_iwn.c | 12 | ||||
-rw-r--r-- | sys/dev/pci/if_wpi.c | 12 |
4 files changed, 36 insertions, 12 deletions
diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c index 2bd64440f5d..e2d28eab276 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.88 2010/08/03 18:26:25 kettenis Exp $ */ +/* $OpenBSD: if_ipw.c,v 1.89 2010/08/12 15:03:59 oga Exp $ */ /*- * Copyright (c) 2004-2008 @@ -339,12 +339,15 @@ ipw_power(int why, void *arg) pci_conf_write(sc->sc_pct, sc->sc_pcitag, 0x40, data); s = splnet(); + while (sc->sc_flags & IPW_FLAG_BUSY) + tsleep(&sc->sc_flags, PZERO, "ipwpwr", 0); sc->sc_flags |= IPW_FLAG_BUSY; if (ifp->if_flags & IFF_UP) ipw_init(ifp); sc->sc_flags &= ~IPW_FLAG_BUSY; + wakeup(&sc->sc_flags); splx(s); } @@ -1399,9 +1402,11 @@ ipw_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) * Prevent processes from entering this function while another * process is tsleep'ing in it. */ - if (sc->sc_flags & IPW_FLAG_BUSY) { + while (sc->sc_flags & IPW_FLAG_BUSY && error == 0) + error = tsleep(&sc->sc_flags, PCATCH, "ipwioc", 0); + if (error) { splx(s); - return EBUSY; + return error; } sc->sc_flags |= IPW_FLAG_BUSY; @@ -1458,6 +1463,7 @@ ipw_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } sc->sc_flags &= ~IPW_FLAG_BUSY; + wakeup(&sc->sc_flags); splx(s); return error; } diff --git a/sys/dev/pci/if_iwi.c b/sys/dev/pci/if_iwi.c index febc0c50180..c6b770452e9 100644 --- a/sys/dev/pci/if_iwi.c +++ b/sys/dev/pci/if_iwi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwi.c,v 1.105 2010/08/03 18:26:25 kettenis Exp $ */ +/* $OpenBSD: if_iwi.c,v 1.106 2010/08/12 15:03:59 oga Exp $ */ /*- * Copyright (c) 2004-2008 @@ -381,12 +381,15 @@ iwi_power(int why, void *arg) pci_conf_write(sc->sc_pct, sc->sc_pcitag, 0x40, data); s = splnet(); + while (sc->sc_flags & IWI_FLAG_BUSY) + tsleep(&sc->sc_flags, 0, "iwipwr", 0); sc->sc_flags |= IWI_FLAG_BUSY; if (ifp->if_flags & IFF_UP) iwi_init(ifp); sc->sc_flags &= ~IWI_FLAG_BUSY; + wakeup(&sc->sc_flags); splx(s); } @@ -1486,9 +1489,11 @@ iwi_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) * Prevent processes from entering this function while another * process is tsleep'ing in it. */ - if (sc->sc_flags & IWI_FLAG_BUSY) { + while (sc->sc_flags & IWI_FLAG_BUSY && error == 0) + error = tsleep(&sc->sc_flags, PCATCH, "iwiioc", 0); + if (error) { splx(s); - return EBUSY; + return error; } sc->sc_flags |= IWI_FLAG_BUSY; @@ -1545,6 +1550,7 @@ iwi_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } sc->sc_flags &= ~IWI_FLAG_BUSY; + wakeup(&sc->sc_flags); splx(s); return error; } diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c index b1374e0abab..29b11456b29 100644 --- a/sys/dev/pci/if_iwn.c +++ b/sys/dev/pci/if_iwn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwn.c,v 1.100 2010/07/28 21:21:38 deraadt Exp $ */ +/* $OpenBSD: if_iwn.c,v 1.101 2010/08/12 15:04:00 oga Exp $ */ /*- * Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr> @@ -786,12 +786,15 @@ iwn_power(int why, void *arg) pci_conf_write(sc->sc_pct, sc->sc_pcitag, 0x40, reg); s = splnet(); + while (sc->sc_flags & IWN_FLAG_BUSY) + tsleep(&sc->sc_flags, 0, "iwnpwr", 0); sc->sc_flags |= IWN_FLAG_BUSY; if (ifp->if_flags & IFF_UP) iwn_init(ifp); sc->sc_flags &= ~IWN_FLAG_BUSY; + wakeup(&sc->sc_flags); splx(s); } @@ -3111,9 +3114,11 @@ iwn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) * Prevent processes from entering this function while another * process is tsleep'ing in it. */ - if (sc->sc_flags & IWN_FLAG_BUSY) { + while (sc->sc_flags & IWN_FLAG_BUSY && error == 0) + error = tsleep(&sc->sc_flags, PCATCH, "iwnioc", 0); + if (error) { splx(s); - return EBUSY; + return error; } sc->sc_flags |= IWN_FLAG_BUSY; @@ -3177,6 +3182,7 @@ iwn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } sc->sc_flags &= ~IWN_FLAG_BUSY; + wakeup(&sc->sc_flags); splx(s); return error; } diff --git a/sys/dev/pci/if_wpi.c b/sys/dev/pci/if_wpi.c index ee754fda4cf..5ca6aa11cba 100644 --- a/sys/dev/pci/if_wpi.c +++ b/sys/dev/pci/if_wpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wpi.c,v 1.104 2010/08/03 18:26:25 kettenis Exp $ */ +/* $OpenBSD: if_wpi.c,v 1.105 2010/08/12 15:04:00 oga Exp $ */ /*- * Copyright (c) 2006-2008 @@ -436,12 +436,15 @@ wpi_power(int why, void *arg) pci_conf_write(sc->sc_pct, sc->sc_pcitag, 0x40, reg); s = splnet(); + while (sc->sc_flags & WPI_FLAG_BUSY) + tsleep(&sc->sc_flags, 0, "wpipwr", 0); sc->sc_flags |= WPI_FLAG_BUSY; if (ifp->if_flags & IFF_UP) wpi_init(ifp); sc->sc_flags &= ~WPI_FLAG_BUSY; + wakeup(&sc->sc_flags); splx(s); } @@ -1999,9 +2002,11 @@ wpi_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) * Prevent processes from entering this function while another * process is tsleep'ing in it. */ - if (sc->sc_flags & WPI_FLAG_BUSY) { + while (sc->sc_flags & WPI_FLAG_BUSY && error == 0) + error = tsleep(&sc->sc_flags, PCATCH, "wpiioc", 0); + if (error) { splx(s); - return EBUSY; + return error; } sc->sc_flags |= WPI_FLAG_BUSY; @@ -2064,6 +2069,7 @@ wpi_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } sc->sc_flags &= ~WPI_FLAG_BUSY; + wakeup(&sc->sc_flags); splx(s); return error; } |