Lines 399-404
Link Here
|
399 |
WPI_RXON_LOCK_INIT(sc); |
399 |
WPI_RXON_LOCK_INIT(sc); |
400 |
WPI_NT_LOCK_INIT(sc); |
400 |
WPI_NT_LOCK_INIT(sc); |
401 |
WPI_TXQ_LOCK_INIT(sc); |
401 |
WPI_TXQ_LOCK_INIT(sc); |
|
|
402 |
WPI_TXQ_STATE_LOCK_INIT(sc); |
402 |
|
403 |
|
403 |
/* Allocate DMA memory for firmware transfers. */ |
404 |
/* Allocate DMA memory for firmware transfers. */ |
404 |
if ((error = wpi_alloc_fwmem(sc)) != 0) { |
405 |
if ((error = wpi_alloc_fwmem(sc)) != 0) { |
Lines 523-529
Link Here
|
523 |
|
524 |
|
524 |
callout_init_mtx(&sc->calib_to, &sc->rxon_mtx, 0); |
525 |
callout_init_mtx(&sc->calib_to, &sc->rxon_mtx, 0); |
525 |
callout_init_mtx(&sc->scan_timeout, &sc->rxon_mtx, 0); |
526 |
callout_init_mtx(&sc->scan_timeout, &sc->rxon_mtx, 0); |
526 |
callout_init_mtx(&sc->tx_timeout, &sc->sc_mtx, 0); |
527 |
callout_init_mtx(&sc->tx_timeout, &sc->txq_state_mtx, 0); |
527 |
callout_init_mtx(&sc->watchdog_rfkill, &sc->sc_mtx, 0); |
528 |
callout_init_mtx(&sc->watchdog_rfkill, &sc->sc_mtx, 0); |
528 |
TASK_INIT(&sc->sc_reinittask, 0, wpi_hw_reset, sc); |
529 |
TASK_INIT(&sc->sc_reinittask, 0, wpi_hw_reset, sc); |
529 |
TASK_INIT(&sc->sc_radiooff_task, 0, wpi_radio_off, sc); |
530 |
TASK_INIT(&sc->sc_radiooff_task, 0, wpi_radio_off, sc); |
Lines 721-726
Link Here
|
721 |
if_free(ifp); |
722 |
if_free(ifp); |
722 |
|
723 |
|
723 |
DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__); |
724 |
DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__); |
|
|
725 |
WPI_TXQ_STATE_LOCK_DESTROY(sc); |
724 |
WPI_TXQ_LOCK_DESTROY(sc); |
726 |
WPI_TXQ_LOCK_DESTROY(sc); |
725 |
WPI_NT_LOCK_DESTROY(sc); |
727 |
WPI_NT_LOCK_DESTROY(sc); |
726 |
WPI_RXON_LOCK_DESTROY(sc); |
728 |
WPI_RXON_LOCK_DESTROY(sc); |
Lines 1970-1975
Link Here
|
1970 |
ieee80211_tx_complete(ni, m, (status & 0xff) != 1); |
1972 |
ieee80211_tx_complete(ni, m, (status & 0xff) != 1); |
1971 |
WPI_LOCK(sc); |
1973 |
WPI_LOCK(sc); |
1972 |
|
1974 |
|
|
|
1975 |
WPI_TXQ_STATE_LOCK(sc); |
1973 |
ring->queued -= 1; |
1976 |
ring->queued -= 1; |
1974 |
if (ring->queued > 0) { |
1977 |
if (ring->queued > 0) { |
1975 |
callout_reset(&sc->tx_timeout, 5*hz, wpi_tx_timeout, sc); |
1978 |
callout_reset(&sc->tx_timeout, 5*hz, wpi_tx_timeout, sc); |
Lines 1988-1993
Link Here
|
1988 |
} |
1991 |
} |
1989 |
} else |
1992 |
} else |
1990 |
callout_stop(&sc->tx_timeout); |
1993 |
callout_stop(&sc->tx_timeout); |
|
|
1994 |
WPI_TXQ_STATE_UNLOCK(sc); |
1991 |
|
1995 |
|
1992 |
DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__); |
1996 |
DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__); |
1993 |
} |
1997 |
} |
Lines 2524-2529
Link Here
|
2524 |
|
2528 |
|
2525 |
if (ring->qid < WPI_CMD_QUEUE_NUM) { |
2529 |
if (ring->qid < WPI_CMD_QUEUE_NUM) { |
2526 |
/* Mark TX ring as full if we reach a certain threshold. */ |
2530 |
/* Mark TX ring as full if we reach a certain threshold. */ |
|
|
2531 |
WPI_TXQ_STATE_LOCK(sc); |
2527 |
if (++ring->queued > WPI_TX_RING_HIMARK) { |
2532 |
if (++ring->queued > WPI_TX_RING_HIMARK) { |
2528 |
sc->qfullmsk |= 1 << ring->qid; |
2533 |
sc->qfullmsk |= 1 << ring->qid; |
2529 |
|
2534 |
|
Lines 2533-2538
Link Here
|
2533 |
} |
2538 |
} |
2534 |
|
2539 |
|
2535 |
callout_reset(&sc->tx_timeout, 5*hz, wpi_tx_timeout, sc); |
2540 |
callout_reset(&sc->tx_timeout, 5*hz, wpi_tx_timeout, sc); |
|
|
2541 |
WPI_TXQ_STATE_UNLOCK(sc); |
2536 |
} |
2542 |
} |
2537 |
|
2543 |
|
2538 |
DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__); |
2544 |
DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__); |
Lines 5277-5283
Link Here
|
5277 |
sc->txq_active = 0; |
5283 |
sc->txq_active = 0; |
5278 |
WPI_TXQ_UNLOCK(sc); |
5284 |
WPI_TXQ_UNLOCK(sc); |
5279 |
|
5285 |
|
|
|
5286 |
WPI_TXQ_STATE_LOCK(sc); |
5280 |
callout_stop(&sc->tx_timeout); |
5287 |
callout_stop(&sc->tx_timeout); |
|
|
5288 |
WPI_TXQ_STATE_UNLOCK(sc); |
5281 |
|
5289 |
|
5282 |
WPI_RXON_LOCK(sc); |
5290 |
WPI_RXON_LOCK(sc); |
5283 |
callout_stop(&sc->scan_timeout); |
5291 |
callout_stop(&sc->scan_timeout); |