tsleep'ing (for example waiting for the firmware to become alive)
in iwn_init.
ok damien@
-/* $OpenBSD: if_wpi.c,v 1.100 2010/04/20 22:05:43 tedu Exp $ */
+/* $OpenBSD: if_wpi.c,v 1.101 2010/07/22 10:22:37 kettenis Exp $ */
/*-
* Copyright (c) 2006-2008
int s, error = 0;
s = splnet();
+ /*
+ * Prevent processes from entering this function while another
+ * process is tsleep'ing in it.
+ */
+ if (sc->sc_flags & WPI_FLAG_BUSY) {
+ splx(s);
+ return EBUSY;
+ }
+ sc->sc_flags |= WPI_FLAG_BUSY;
switch (cmd) {
case SIOCSIFADDR:
}
}
+ sc->sc_flags &= ~WPI_FLAG_BUSY;
splx(s);
return error;
}
-/* $OpenBSD: if_wpivar.h,v 1.20 2009/11/17 20:35:53 damien Exp $ */
+/* $OpenBSD: if_wpivar.h,v 1.21 2010/07/22 10:22:37 kettenis Exp $ */
/*-
* Copyright (c) 2006-2008
u_int sc_flags;
#define WPI_FLAG_HAS_5GHZ (1 << 0)
+#define WPI_FLAG_BUSY (1 << 1)
/* Shared area. */
struct wpi_dma_info shared_dma;