View | Details | Raw Unified | Return to bug 197143 | Differences between
and this patch

Collapse All | Expand All

(-)sys/dev/wpi/if_wpi.c (-7 / +9 lines)
Lines 396-401 Link Here
396
	}
396
	}
397
397
398
	WPI_LOCK_INIT(sc);
398
	WPI_LOCK_INIT(sc);
399
	WPI_TX_LOCK_INIT(sc);
399
	WPI_RXON_LOCK_INIT(sc);
400
	WPI_RXON_LOCK_INIT(sc);
400
	WPI_NT_LOCK_INIT(sc);
401
	WPI_NT_LOCK_INIT(sc);
401
	WPI_TXQ_LOCK_INIT(sc);
402
	WPI_TXQ_LOCK_INIT(sc);
Lines 726-731 Link Here
726
	WPI_TXQ_LOCK_DESTROY(sc);
727
	WPI_TXQ_LOCK_DESTROY(sc);
727
	WPI_NT_LOCK_DESTROY(sc);
728
	WPI_NT_LOCK_DESTROY(sc);
728
	WPI_RXON_LOCK_DESTROY(sc);
729
	WPI_RXON_LOCK_DESTROY(sc);
730
	WPI_TX_LOCK_DESTROY(sc);
729
	WPI_LOCK_DESTROY(sc);
731
	WPI_LOCK_DESTROY(sc);
730
	return 0;
732
	return 0;
731
}
733
}
Lines 2845-2851 Link Here
2845
		return ENETDOWN;
2847
		return ENETDOWN;
2846
	}
2848
	}
2847
2849
2848
	WPI_LOCK(sc);
2850
	WPI_TX_LOCK(sc);
2849
	if (params == NULL) {
2851
	if (params == NULL) {
2850
		/*
2852
		/*
2851
		 * Legacy path; interpret frame contents to decide
2853
		 * Legacy path; interpret frame contents to decide
Lines 2859-2865 Link Here
2859
		 */
2861
		 */
2860
		error = wpi_tx_data_raw(sc, m, ni, params);
2862
		error = wpi_tx_data_raw(sc, m, ni, params);
2861
	}
2863
	}
2862
	WPI_UNLOCK(sc);
2864
	WPI_TX_UNLOCK(sc);
2863
2865
2864
	if (error != 0) {
2866
	if (error != 0) {
2865
		/* NB: m is reclaimed on tx failure */
2867
		/* NB: m is reclaimed on tx failure */
Lines 2886-2892 Link Here
2886
	struct ieee80211_node *ni;
2888
	struct ieee80211_node *ni;
2887
	struct mbuf *m;
2889
	struct mbuf *m;
2888
2890
2889
	WPI_LOCK(sc);
2891
	WPI_TX_LOCK(sc);
2890
	DPRINTF(sc, WPI_DEBUG_XMIT, "%s: called\n", __func__);
2892
	DPRINTF(sc, WPI_DEBUG_XMIT, "%s: called\n", __func__);
2891
2893
2892
	for (;;) {
2894
	for (;;) {
Lines 2903-2917 Link Here
2903
			break;
2905
			break;
2904
		ni = (struct ieee80211_node *)m->m_pkthdr.rcvif;
2906
		ni = (struct ieee80211_node *)m->m_pkthdr.rcvif;
2905
		if (wpi_tx_data(sc, m, ni) != 0) {
2907
		if (wpi_tx_data(sc, m, ni) != 0) {
2906
			WPI_UNLOCK(sc);
2907
			ieee80211_free_node(ni);
2908
			ieee80211_free_node(ni);
2908
			WPI_LOCK(sc);
2909
			if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
2909
			if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
2910
		}
2910
		}
2911
	}
2911
	}
2912
2912
2913
	DPRINTF(sc, WPI_DEBUG_XMIT, "%s: done\n", __func__);
2913
	DPRINTF(sc, WPI_DEBUG_XMIT, "%s: done\n", __func__);
2914
	WPI_UNLOCK(sc);
2914
	WPI_TX_UNLOCK(sc);
2915
}
2915
}
2916
2916
2917
static void
2917
static void
Lines 5350-5358 Link Here
5350
	WPI_LOCK(sc);
5350
	WPI_LOCK(sc);
5351
	sc->sc_rxtap.wr_chan_freq = htole16(c->ic_freq);
5351
	sc->sc_rxtap.wr_chan_freq = htole16(c->ic_freq);
5352
	sc->sc_rxtap.wr_chan_flags = htole16(c->ic_flags);
5352
	sc->sc_rxtap.wr_chan_flags = htole16(c->ic_flags);
5353
	WPI_UNLOCK(sc);
5354
	WPI_TX_LOCK(sc);
5353
	sc->sc_txtap.wt_chan_freq = htole16(c->ic_freq);
5355
	sc->sc_txtap.wt_chan_freq = htole16(c->ic_freq);
5354
	sc->sc_txtap.wt_chan_flags = htole16(c->ic_flags);
5356
	sc->sc_txtap.wt_chan_flags = htole16(c->ic_flags);
5355
	WPI_UNLOCK(sc);
5357
	WPI_TX_UNLOCK(sc);
5356
5358
5357
	/*
5359
	/*
5358
	 * Only need to set the channel in Monitor mode. AP scanning and auth
5360
	 * Only need to set the channel in Monitor mode. AP scanning and auth
(-)sys/dev/wpi/if_wpivar.h (-3 / +11 lines)
Lines 165-170 Link Here
165
	int			sc_debug;
165
	int			sc_debug;
166
166
167
	struct mtx		sc_mtx;
167
	struct mtx		sc_mtx;
168
	struct mtx		tx_mtx;
168
169
169
	/* Shared area. */
170
	/* Shared area. */
170
	struct wpi_dma_info	shared_dma;
171
	struct wpi_dma_info	shared_dma;
Lines 242-250 Link Here
242
 * Locking order:
243
 * Locking order:
243
 * 1. WPI_LOCK;
244
 * 1. WPI_LOCK;
244
 * 2. WPI_RXON_LOCK;
245
 * 2. WPI_RXON_LOCK;
245
 * 3. WPI_NT_LOCK / WPI_VAP_LOCK;
246
 * 3. WPI_TX_LOCK;
246
 * 4. WPI_TXQ_LOCK;
247
 * 4. WPI_NT_LOCK / WPI_VAP_LOCK;
247
 * 5. WPI_TXQ_STATE_LOCK;
248
 * 5. WPI_TXQ_LOCK;
249
 * 6. WPI_TXQ_STATE_LOCK;
248
 */
250
 */
249
251
250
#define WPI_LOCK_INIT(_sc) \
252
#define WPI_LOCK_INIT(_sc) \
Lines 262-267 Link Here
262
#define WPI_RXON_LOCK_ASSERT(_sc)	mtx_assert(&(_sc)->rxon_mtx, MA_OWNED)
264
#define WPI_RXON_LOCK_ASSERT(_sc)	mtx_assert(&(_sc)->rxon_mtx, MA_OWNED)
263
#define WPI_RXON_LOCK_DESTROY(_sc)	mtx_destroy(&(_sc)->rxon_mtx)
265
#define WPI_RXON_LOCK_DESTROY(_sc)	mtx_destroy(&(_sc)->rxon_mtx)
264
266
267
#define WPI_TX_LOCK_INIT(_sc) \
268
	mtx_init(&(_sc)->tx_mtx, "tx path lock", NULL, MTX_DEF)
269
#define WPI_TX_LOCK(_sc)		mtx_lock(&(_sc)->tx_mtx)
270
#define WPI_TX_UNLOCK(_sc)		mtx_unlock(&(_sc)->tx_mtx)
271
#define WPI_TX_LOCK_DESTROY(_sc)	mtx_destroy(&(_sc)->tx_mtx)
272
265
#define WPI_NT_LOCK_INIT(_sc) \
273
#define WPI_NT_LOCK_INIT(_sc) \
266
	mtx_init(&(_sc)->nt_mtx, "node table lock", NULL, MTX_DEF)
274
	mtx_init(&(_sc)->nt_mtx, "node table lock", NULL, MTX_DEF)
267
#define WPI_NT_LOCK(_sc)		mtx_lock(&(_sc)->nt_mtx)
275
#define WPI_NT_LOCK(_sc)		mtx_lock(&(_sc)->nt_mtx)

Return to bug 197143