ring->cur = (ring->cur + 1) % IWN_TX_RING_COUNT;
IWN_WRITE(sc, IWN_HBUS_TARG_WRPTR, ring->qid << 8 | ring->cur);
- return async ? 0 : lksleep(desc, &sc->sc_lock, 0, "iwncmd", hz);
+ return async ? 0 : tsleep(desc, 0, "iwncmd", hz);
}
static int
/* Wait at most two seconds for calibration to complete. */
if (!(sc->sc_flags & IWN_FLAG_CALIB_DONE))
- error = lksleep(sc, &sc->sc_lock, 0, "iwninit", 2 * hz);
+ error = tsleep(sc, 0, "iwninit", 2 * hz);
return error;
}
IWN_WRITE(sc, IWN_RESET, 0);
/* Wait at most one second for first alive notification. */
- error = lksleep(sc, &sc->sc_lock, 0, "iwninit", hz);
+ error = tsleep(sc, 0, "iwninit", hz);
if (error) {
device_printf(sc->sc_dev,
"%s: timeout waiting for adapter to initialize, error %d\n",
iwn_nic_unlock(sc);
/* Wait at most five seconds for FH DMA transfer to complete. */
- return lksleep(sc, &sc->sc_lock, 0, "iwninit", hz);
+ return tsleep(sc, 0, "iwninit", hz);
}
static int
return error;
}
/* Wait at most one second for firmware alive notification. */
- error = lksleep(sc, &sc->sc_lock, 0, "iwninit", hz);
+ error = tsleep(sc, 0, "iwninit", hz);
if (error != 0) {
device_printf(sc->sc_dev,
"%s: timeout waiting for adapter to initialize, error %d\n",
#define IWN_LOCK_ASSERT(_sc) ASSERT_SERIALIZED((_sc)->sc_ifp->if_serializer)
#define IWN_UNLOCK(_sc) lwkt_serialize_exit((_sc)->sc_ifp->if_serializer)
#define IWN_LOCK_DESTROY(_sc)
-#endif
#define IWN_LOCK_INIT(_sc) \
lockinit(&(_sc)->sc_lock, \
#define IWN_LOCK_ASSERT(_sc) KKASSERT(lockstatus(&(sc)->sc_lock, curthread) != 0)
#define IWN_UNLOCK(_sc) lockmgr(&(_sc)->sc_lock, LK_RELEASE)
#define IWN_LOCK_DESTROY(_sc) lockuninit(&(_sc)->sc_lock)
+#endif
+
+#define IWN_LOCK_INIT(_sc)
+#define IWN_LOCK(_sc) lwkt_gettoken(&wlan_token)
+#define IWN_UNLOCK(_sc) lwkt_reltoken(&wlan_token)
+#define IWN_LOCK_DESTROY(_sc)
+#define IWN_LOCK_ASSERT(_sc) ASSERT_LWKT_TOKEN_HELD(&wlan_token)