1/* $FreeBSD: head/sys/dev/wpi/if_wpivar.h 282376 2015-05-03 22:43:45Z adrian $ */
| 1/* $FreeBSD: head/sys/dev/wpi/if_wpivar.h 282400 2015-05-03 23:39:02Z adrian $ */
|
2 3/*- 4 * Copyright (c) 2006,2007 5 * Damien Bergamini <damien.bergamini@free.fr> 6 * 7 * Permission to use, copy, modify, and distribute this software for any 8 * purpose with or without fee is hereby granted, provided that the above 9 * copyright notice and this permission notice appear in all copies. 10 * 11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 */ 19struct wpi_rx_radiotap_header { 20 struct ieee80211_radiotap_header wr_ihdr; 21 uint64_t wr_tsft; 22 uint8_t wr_flags; 23 uint8_t wr_rate; 24 uint16_t wr_chan_freq; 25 uint16_t wr_chan_flags; 26 int8_t wr_dbm_antsignal; 27 int8_t wr_dbm_antnoise; 28 uint8_t wr_antenna; 29} __packed; 30 31#define WPI_RX_RADIOTAP_PRESENT \ 32 ((1 << IEEE80211_RADIOTAP_TSFT) | \ 33 (1 << IEEE80211_RADIOTAP_FLAGS) | \ 34 (1 << IEEE80211_RADIOTAP_RATE) | \ 35 (1 << IEEE80211_RADIOTAP_CHANNEL) | \ 36 (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | \ 37 (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) | \ 38 (1 << IEEE80211_RADIOTAP_ANTENNA)) 39 40struct wpi_tx_radiotap_header { 41 struct ieee80211_radiotap_header wt_ihdr; 42 uint8_t wt_flags; 43 uint8_t wt_rate; 44 uint16_t wt_chan_freq; 45 uint16_t wt_chan_flags; 46} __packed; 47 48#define WPI_TX_RADIOTAP_PRESENT \ 49 ((1 << IEEE80211_RADIOTAP_FLAGS) | \ 50 (1 << IEEE80211_RADIOTAP_RATE) | \ 51 (1 << IEEE80211_RADIOTAP_CHANNEL)) 52 53struct wpi_dma_info { 54 bus_dma_tag_t tag; 55 bus_dmamap_t map; 56 bus_addr_t paddr; 57 caddr_t vaddr; 58 bus_size_t size; 59}; 60 61struct wpi_tx_data { 62 bus_dmamap_t map; 63 bus_addr_t cmd_paddr; 64 struct mbuf *m; 65 struct ieee80211_node *ni; 66}; 67 68struct wpi_tx_ring { 69 struct wpi_dma_info desc_dma; 70 struct wpi_dma_info cmd_dma; 71 struct wpi_tx_desc *desc; 72 struct wpi_tx_cmd *cmd; 73 struct wpi_tx_data data[WPI_TX_RING_COUNT]; 74 bus_dma_tag_t data_dmat; 75 int qid; 76 int queued; 77 int cur; 78 int update; 79}; 80 81struct wpi_rx_data { 82 struct mbuf *m; 83 bus_dmamap_t map; 84}; 85 86struct wpi_rx_ring { 87 struct wpi_dma_info desc_dma; 88 uint32_t *desc; 89 struct wpi_rx_data data[WPI_RX_RING_COUNT]; 90 bus_dma_tag_t data_dmat; 91 int cur; 92 int update; 93}; 94 95struct wpi_node { 96 struct ieee80211_node ni; /* must be the first */ 97 uint8_t id; 98}; 99#define WPI_NODE(ni) ((struct wpi_node *)(ni)) 100 101struct wpi_power_sample { 102 uint8_t index; 103 int8_t power; 104}; 105 106struct wpi_power_group { 107#define WPI_SAMPLES_COUNT 5 108 struct wpi_power_sample samples[WPI_SAMPLES_COUNT]; 109 uint8_t chan; 110 int8_t maxpwr; 111 int16_t temp; 112}; 113 114struct wpi_buf { 115 uint8_t data[56]; /* sizeof(struct wpi_cmd_beacon) */ 116 struct ieee80211_node *ni; 117 struct mbuf *m; 118 size_t size; 119 int code; 120 int ac; 121}; 122 123struct wpi_vap { 124 struct ieee80211vap wv_vap; 125 126 struct wpi_buf wv_bcbuf; 127 struct ieee80211_beacon_offsets wv_boff; 128 struct mtx wv_mtx; 129 130 uint32_t wv_gtk; 131#define WPI_VAP_KEY(kid) (1 << kid) 132 133 int (*wv_newstate)(struct ieee80211vap *, 134 enum ieee80211_state, int); 135}; 136#define WPI_VAP(vap) ((struct wpi_vap *)(vap)) 137 138#define WPI_VAP_LOCK_INIT(_wvp) \ 139 mtx_init(&(_wvp)->wv_mtx, "lock for wv_bcbuf/wv_boff structures", \ 140 NULL, MTX_DEF) 141#define WPI_VAP_LOCK(_wvp) mtx_lock(&(_wvp)->wv_mtx) 142#define WPI_VAP_UNLOCK(_wvp) mtx_unlock(&(_wvp)->wv_mtx) 143#define WPI_VAP_LOCK_ASSERT(_wvp) mtx_assert(&(_wvp)->wv_mtx, MA_OWNED) 144#define WPI_VAP_LOCK_DESTROY(_wvp) mtx_destroy(&(_wvp)->wv_mtx) 145 146struct wpi_fw_part { 147 const uint8_t *text; 148 uint32_t textsz; 149 const uint8_t *data; 150 uint32_t datasz; 151}; 152 153struct wpi_fw_info { 154 const uint8_t *data; 155 size_t size; 156 struct wpi_fw_part init; 157 struct wpi_fw_part main; 158 struct wpi_fw_part boot; 159}; 160 161struct wpi_softc { 162 device_t sc_dev; 163 164 struct ifnet *sc_ifp; 165 int sc_debug; 166
| 2 3/*- 4 * Copyright (c) 2006,2007 5 * Damien Bergamini <damien.bergamini@free.fr> 6 * 7 * Permission to use, copy, modify, and distribute this software for any 8 * purpose with or without fee is hereby granted, provided that the above 9 * copyright notice and this permission notice appear in all copies. 10 * 11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 */ 19struct wpi_rx_radiotap_header { 20 struct ieee80211_radiotap_header wr_ihdr; 21 uint64_t wr_tsft; 22 uint8_t wr_flags; 23 uint8_t wr_rate; 24 uint16_t wr_chan_freq; 25 uint16_t wr_chan_flags; 26 int8_t wr_dbm_antsignal; 27 int8_t wr_dbm_antnoise; 28 uint8_t wr_antenna; 29} __packed; 30 31#define WPI_RX_RADIOTAP_PRESENT \ 32 ((1 << IEEE80211_RADIOTAP_TSFT) | \ 33 (1 << IEEE80211_RADIOTAP_FLAGS) | \ 34 (1 << IEEE80211_RADIOTAP_RATE) | \ 35 (1 << IEEE80211_RADIOTAP_CHANNEL) | \ 36 (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | \ 37 (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) | \ 38 (1 << IEEE80211_RADIOTAP_ANTENNA)) 39 40struct wpi_tx_radiotap_header { 41 struct ieee80211_radiotap_header wt_ihdr; 42 uint8_t wt_flags; 43 uint8_t wt_rate; 44 uint16_t wt_chan_freq; 45 uint16_t wt_chan_flags; 46} __packed; 47 48#define WPI_TX_RADIOTAP_PRESENT \ 49 ((1 << IEEE80211_RADIOTAP_FLAGS) | \ 50 (1 << IEEE80211_RADIOTAP_RATE) | \ 51 (1 << IEEE80211_RADIOTAP_CHANNEL)) 52 53struct wpi_dma_info { 54 bus_dma_tag_t tag; 55 bus_dmamap_t map; 56 bus_addr_t paddr; 57 caddr_t vaddr; 58 bus_size_t size; 59}; 60 61struct wpi_tx_data { 62 bus_dmamap_t map; 63 bus_addr_t cmd_paddr; 64 struct mbuf *m; 65 struct ieee80211_node *ni; 66}; 67 68struct wpi_tx_ring { 69 struct wpi_dma_info desc_dma; 70 struct wpi_dma_info cmd_dma; 71 struct wpi_tx_desc *desc; 72 struct wpi_tx_cmd *cmd; 73 struct wpi_tx_data data[WPI_TX_RING_COUNT]; 74 bus_dma_tag_t data_dmat; 75 int qid; 76 int queued; 77 int cur; 78 int update; 79}; 80 81struct wpi_rx_data { 82 struct mbuf *m; 83 bus_dmamap_t map; 84}; 85 86struct wpi_rx_ring { 87 struct wpi_dma_info desc_dma; 88 uint32_t *desc; 89 struct wpi_rx_data data[WPI_RX_RING_COUNT]; 90 bus_dma_tag_t data_dmat; 91 int cur; 92 int update; 93}; 94 95struct wpi_node { 96 struct ieee80211_node ni; /* must be the first */ 97 uint8_t id; 98}; 99#define WPI_NODE(ni) ((struct wpi_node *)(ni)) 100 101struct wpi_power_sample { 102 uint8_t index; 103 int8_t power; 104}; 105 106struct wpi_power_group { 107#define WPI_SAMPLES_COUNT 5 108 struct wpi_power_sample samples[WPI_SAMPLES_COUNT]; 109 uint8_t chan; 110 int8_t maxpwr; 111 int16_t temp; 112}; 113 114struct wpi_buf { 115 uint8_t data[56]; /* sizeof(struct wpi_cmd_beacon) */ 116 struct ieee80211_node *ni; 117 struct mbuf *m; 118 size_t size; 119 int code; 120 int ac; 121}; 122 123struct wpi_vap { 124 struct ieee80211vap wv_vap; 125 126 struct wpi_buf wv_bcbuf; 127 struct ieee80211_beacon_offsets wv_boff; 128 struct mtx wv_mtx; 129 130 uint32_t wv_gtk; 131#define WPI_VAP_KEY(kid) (1 << kid) 132 133 int (*wv_newstate)(struct ieee80211vap *, 134 enum ieee80211_state, int); 135}; 136#define WPI_VAP(vap) ((struct wpi_vap *)(vap)) 137 138#define WPI_VAP_LOCK_INIT(_wvp) \ 139 mtx_init(&(_wvp)->wv_mtx, "lock for wv_bcbuf/wv_boff structures", \ 140 NULL, MTX_DEF) 141#define WPI_VAP_LOCK(_wvp) mtx_lock(&(_wvp)->wv_mtx) 142#define WPI_VAP_UNLOCK(_wvp) mtx_unlock(&(_wvp)->wv_mtx) 143#define WPI_VAP_LOCK_ASSERT(_wvp) mtx_assert(&(_wvp)->wv_mtx, MA_OWNED) 144#define WPI_VAP_LOCK_DESTROY(_wvp) mtx_destroy(&(_wvp)->wv_mtx) 145 146struct wpi_fw_part { 147 const uint8_t *text; 148 uint32_t textsz; 149 const uint8_t *data; 150 uint32_t datasz; 151}; 152 153struct wpi_fw_info { 154 const uint8_t *data; 155 size_t size; 156 struct wpi_fw_part init; 157 struct wpi_fw_part main; 158 struct wpi_fw_part boot; 159}; 160 161struct wpi_softc { 162 device_t sc_dev; 163 164 struct ifnet *sc_ifp; 165 int sc_debug; 166
|
| 167 int sc_flags; 168#define WPI_PS_PATH (1 << 0) 169
|
167 struct mtx sc_mtx; 168 struct mtx tx_mtx; 169 170 /* Shared area. */ 171 struct wpi_dma_info shared_dma; 172 struct wpi_shared *shared; 173 174 struct wpi_tx_ring txq[WPI_NTXQUEUES]; 175 struct mtx txq_mtx; 176 struct mtx txq_state_mtx; 177 uint32_t txq_active; 178 179 struct wpi_rx_ring rxq; 180 181 /* TX Thermal Callibration. */ 182 struct callout calib_to; 183 int calib_cnt; 184 185 struct callout scan_timeout; 186 struct callout tx_timeout; 187 188 /* Watch dog timer. */ 189 struct callout watchdog_rfkill; 190 191 /* Firmware image. */ 192 struct wpi_fw_info fw; 193 uint32_t errptr; 194 195 struct resource *irq; 196 struct resource *mem; 197 bus_space_tag_t sc_st; 198 bus_space_handle_t sc_sh; 199 void *sc_ih; 200 bus_size_t sc_sz; 201 int sc_cap_off; /* PCIe Capabilities. */ 202 203 struct wpi_rxon rxon; 204 struct mtx rxon_mtx; 205 206 int temp; 207 uint32_t qfullmsk; 208 209 uint32_t nodesmsk; 210 struct mtx nt_mtx; 211 212 void (*sc_node_free)(struct ieee80211_node *);
| 170 struct mtx sc_mtx; 171 struct mtx tx_mtx; 172 173 /* Shared area. */ 174 struct wpi_dma_info shared_dma; 175 struct wpi_shared *shared; 176 177 struct wpi_tx_ring txq[WPI_NTXQUEUES]; 178 struct mtx txq_mtx; 179 struct mtx txq_state_mtx; 180 uint32_t txq_active; 181 182 struct wpi_rx_ring rxq; 183 184 /* TX Thermal Callibration. */ 185 struct callout calib_to; 186 int calib_cnt; 187 188 struct callout scan_timeout; 189 struct callout tx_timeout; 190 191 /* Watch dog timer. */ 192 struct callout watchdog_rfkill; 193 194 /* Firmware image. */ 195 struct wpi_fw_info fw; 196 uint32_t errptr; 197 198 struct resource *irq; 199 struct resource *mem; 200 bus_space_tag_t sc_st; 201 bus_space_handle_t sc_sh; 202 void *sc_ih; 203 bus_size_t sc_sz; 204 int sc_cap_off; /* PCIe Capabilities. */ 205 206 struct wpi_rxon rxon; 207 struct mtx rxon_mtx; 208 209 int temp; 210 uint32_t qfullmsk; 211 212 uint32_t nodesmsk; 213 struct mtx nt_mtx; 214 215 void (*sc_node_free)(struct ieee80211_node *);
|
| 216 void (*sc_update_rx_ring)(struct wpi_softc *); 217 void (*sc_update_tx_ring)(struct wpi_softc *, 218 struct wpi_tx_ring *);
|
213 214 struct wpi_rx_radiotap_header sc_rxtap; 215 struct wpi_tx_radiotap_header sc_txtap; 216 217 /* Firmware image. */ 218 const struct firmware *fw_fp; 219 220 /* Firmware DMA transfer. */ 221 struct wpi_dma_info fw_dma; 222 223 /* Tasks used by the driver. */ 224 struct task sc_reinittask; 225 struct task sc_radiooff_task; 226 struct task sc_radioon_task; 227 struct task sc_start_task; 228 229 /* Taskqueue */ 230 struct taskqueue *sc_tq; 231 232 /* Eeprom info. */ 233 uint8_t cap; 234 uint16_t rev; 235 uint8_t type; 236 struct wpi_eeprom_chan 237 eeprom_channels[WPI_CHAN_BANDS_COUNT][WPI_MAX_CHAN_PER_BAND]; 238 struct wpi_power_group groups[WPI_POWER_GROUPS_COUNT]; 239 int8_t maxpwr[IEEE80211_CHAN_MAX]; 240 char domain[4]; /* Regulatory domain. */ 241}; 242 243/* 244 * Locking order: 245 * 1. WPI_LOCK; 246 * 2. WPI_RXON_LOCK; 247 * 3. WPI_TX_LOCK; 248 * 4. WPI_NT_LOCK / WPI_VAP_LOCK; 249 * 5. WPI_TXQ_LOCK; 250 * 6. WPI_TXQ_STATE_LOCK; 251 */ 252 253#define WPI_LOCK_INIT(_sc) \ 254 mtx_init(&(_sc)->sc_mtx, device_get_nameunit((_sc)->sc_dev), \ 255 MTX_NETWORK_LOCK, MTX_DEF) 256#define WPI_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) 257#define WPI_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) 258#define WPI_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) 259#define WPI_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx) 260 261#define WPI_RXON_LOCK_INIT(_sc) \ 262 mtx_init(&(_sc)->rxon_mtx, "lock for wpi_rxon structure", NULL, MTX_DEF) 263#define WPI_RXON_LOCK(_sc) mtx_lock(&(_sc)->rxon_mtx) 264#define WPI_RXON_UNLOCK(_sc) mtx_unlock(&(_sc)->rxon_mtx) 265#define WPI_RXON_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->rxon_mtx, MA_OWNED) 266#define WPI_RXON_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->rxon_mtx) 267 268#define WPI_TX_LOCK_INIT(_sc) \ 269 mtx_init(&(_sc)->tx_mtx, "tx path lock", NULL, MTX_DEF) 270#define WPI_TX_LOCK(_sc) mtx_lock(&(_sc)->tx_mtx) 271#define WPI_TX_UNLOCK(_sc) mtx_unlock(&(_sc)->tx_mtx) 272#define WPI_TX_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->tx_mtx) 273 274#define WPI_NT_LOCK_INIT(_sc) \ 275 mtx_init(&(_sc)->nt_mtx, "node table lock", NULL, MTX_DEF) 276#define WPI_NT_LOCK(_sc) mtx_lock(&(_sc)->nt_mtx) 277#define WPI_NT_UNLOCK(_sc) mtx_unlock(&(_sc)->nt_mtx) 278#define WPI_NT_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->nt_mtx) 279 280#define WPI_TXQ_LOCK_INIT(_sc) \ 281 mtx_init(&(_sc)->txq_mtx, "txq/cmdq lock", NULL, MTX_DEF) 282#define WPI_TXQ_LOCK(_sc) mtx_lock(&(_sc)->txq_mtx) 283#define WPI_TXQ_UNLOCK(_sc) mtx_unlock(&(_sc)->txq_mtx) 284#define WPI_TXQ_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->txq_mtx) 285 286#define WPI_TXQ_STATE_LOCK_INIT(_sc) \ 287 mtx_init(&(_sc)->txq_state_mtx, "txq state lock", NULL, MTX_DEF) 288#define WPI_TXQ_STATE_LOCK(_sc) mtx_lock(&(_sc)->txq_state_mtx) 289#define WPI_TXQ_STATE_UNLOCK(_sc) mtx_unlock(&(_sc)->txq_state_mtx) 290#define WPI_TXQ_STATE_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->txq_state_mtx)
| 219 220 struct wpi_rx_radiotap_header sc_rxtap; 221 struct wpi_tx_radiotap_header sc_txtap; 222 223 /* Firmware image. */ 224 const struct firmware *fw_fp; 225 226 /* Firmware DMA transfer. */ 227 struct wpi_dma_info fw_dma; 228 229 /* Tasks used by the driver. */ 230 struct task sc_reinittask; 231 struct task sc_radiooff_task; 232 struct task sc_radioon_task; 233 struct task sc_start_task; 234 235 /* Taskqueue */ 236 struct taskqueue *sc_tq; 237 238 /* Eeprom info. */ 239 uint8_t cap; 240 uint16_t rev; 241 uint8_t type; 242 struct wpi_eeprom_chan 243 eeprom_channels[WPI_CHAN_BANDS_COUNT][WPI_MAX_CHAN_PER_BAND]; 244 struct wpi_power_group groups[WPI_POWER_GROUPS_COUNT]; 245 int8_t maxpwr[IEEE80211_CHAN_MAX]; 246 char domain[4]; /* Regulatory domain. */ 247}; 248 249/* 250 * Locking order: 251 * 1. WPI_LOCK; 252 * 2. WPI_RXON_LOCK; 253 * 3. WPI_TX_LOCK; 254 * 4. WPI_NT_LOCK / WPI_VAP_LOCK; 255 * 5. WPI_TXQ_LOCK; 256 * 6. WPI_TXQ_STATE_LOCK; 257 */ 258 259#define WPI_LOCK_INIT(_sc) \ 260 mtx_init(&(_sc)->sc_mtx, device_get_nameunit((_sc)->sc_dev), \ 261 MTX_NETWORK_LOCK, MTX_DEF) 262#define WPI_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) 263#define WPI_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) 264#define WPI_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) 265#define WPI_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx) 266 267#define WPI_RXON_LOCK_INIT(_sc) \ 268 mtx_init(&(_sc)->rxon_mtx, "lock for wpi_rxon structure", NULL, MTX_DEF) 269#define WPI_RXON_LOCK(_sc) mtx_lock(&(_sc)->rxon_mtx) 270#define WPI_RXON_UNLOCK(_sc) mtx_unlock(&(_sc)->rxon_mtx) 271#define WPI_RXON_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->rxon_mtx, MA_OWNED) 272#define WPI_RXON_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->rxon_mtx) 273 274#define WPI_TX_LOCK_INIT(_sc) \ 275 mtx_init(&(_sc)->tx_mtx, "tx path lock", NULL, MTX_DEF) 276#define WPI_TX_LOCK(_sc) mtx_lock(&(_sc)->tx_mtx) 277#define WPI_TX_UNLOCK(_sc) mtx_unlock(&(_sc)->tx_mtx) 278#define WPI_TX_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->tx_mtx) 279 280#define WPI_NT_LOCK_INIT(_sc) \ 281 mtx_init(&(_sc)->nt_mtx, "node table lock", NULL, MTX_DEF) 282#define WPI_NT_LOCK(_sc) mtx_lock(&(_sc)->nt_mtx) 283#define WPI_NT_UNLOCK(_sc) mtx_unlock(&(_sc)->nt_mtx) 284#define WPI_NT_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->nt_mtx) 285 286#define WPI_TXQ_LOCK_INIT(_sc) \ 287 mtx_init(&(_sc)->txq_mtx, "txq/cmdq lock", NULL, MTX_DEF) 288#define WPI_TXQ_LOCK(_sc) mtx_lock(&(_sc)->txq_mtx) 289#define WPI_TXQ_UNLOCK(_sc) mtx_unlock(&(_sc)->txq_mtx) 290#define WPI_TXQ_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->txq_mtx) 291 292#define WPI_TXQ_STATE_LOCK_INIT(_sc) \ 293 mtx_init(&(_sc)->txq_state_mtx, "txq state lock", NULL, MTX_DEF) 294#define WPI_TXQ_STATE_LOCK(_sc) mtx_lock(&(_sc)->txq_state_mtx) 295#define WPI_TXQ_STATE_UNLOCK(_sc) mtx_unlock(&(_sc)->txq_state_mtx) 296#define WPI_TXQ_STATE_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->txq_state_mtx)
|