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

Collapse All | Expand All

(-)sys/dev/wpi/if_wpi.c (-2 / +16 lines)
Lines 384-389 Link Here
384
	}
384
	}
385
385
386
	WPI_LOCK_INIT(sc);
386
	WPI_LOCK_INIT(sc);
387
	WPI_NT_LOCK_INIT(sc);
387
	WPI_TXQ_LOCK_INIT(sc);
388
	WPI_TXQ_LOCK_INIT(sc);
388
389
389
	/* Allocate DMA memory for firmware transfers. */
390
	/* Allocate DMA memory for firmware transfers. */
Lines 681-686 Link Here
681
682
682
	DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__);
683
	DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__);
683
	WPI_TXQ_LOCK_DESTROY(sc);
684
	WPI_TXQ_LOCK_DESTROY(sc);
685
	WPI_NT_LOCK_DESTROY(sc);
684
	WPI_LOCK_DESTROY(sc);
686
	WPI_LOCK_DESTROY(sc);
685
	return 0;
687
	return 0;
686
}
688
}
Lines 1582-1593 Link Here
1582
	struct wpi_node *wn = WPI_NODE(ni);
1584
	struct wpi_node *wn = WPI_NODE(ni);
1583
1585
1584
	if (wn->id != WPI_ID_UNDEFINED) {
1586
	if (wn->id != WPI_ID_UNDEFINED) {
1585
		WPI_LOCK(sc);
1587
		WPI_NT_LOCK(sc);
1586
		if (wpi_check_node_entry(sc, wn->id)) {
1588
		if (wpi_check_node_entry(sc, wn->id)) {
1587
			wpi_del_node_entry(sc, wn->id);
1589
			wpi_del_node_entry(sc, wn->id);
1588
			wpi_del_node(sc, ni);
1590
			wpi_del_node(sc, ni);
1589
		}
1591
		}
1590
		WPI_UNLOCK(sc);
1592
		WPI_NT_UNLOCK(sc);
1591
	}
1593
	}
1592
1594
1593
	sc->sc_node_free(ni);
1595
	sc->sc_node_free(ni);
Lines 2095-2101 Link Here
2095
			    le32toh(*status));
2097
			    le32toh(*status));
2096
2098
2097
			if (le32toh(*status) & 1) {
2099
			if (le32toh(*status) & 1) {
2100
				WPI_NT_LOCK(sc);
2098
				wpi_clear_node_table(sc);
2101
				wpi_clear_node_table(sc);
2102
				WPI_NT_UNLOCK(sc);
2099
				ieee80211_runtask(ic, &sc->sc_radiooff_task);
2103
				ieee80211_runtask(ic, &sc->sc_radiooff_task);
2100
				return;
2104
				return;
2101
			}
2105
			}
Lines 2557-2563 Link Here
2557
		if (wn->id == WPI_ID_UNDEFINED &&
2561
		if (wn->id == WPI_ID_UNDEFINED &&
2558
		    (vap->iv_opmode == IEEE80211_M_IBSS ||
2562
		    (vap->iv_opmode == IEEE80211_M_IBSS ||
2559
		    vap->iv_opmode == IEEE80211_M_AHDEMO)) {
2563
		    vap->iv_opmode == IEEE80211_M_AHDEMO)) {
2564
			WPI_NT_LOCK(sc);
2560
			error = wpi_add_ibss_node(sc, ni);
2565
			error = wpi_add_ibss_node(sc, ni);
2566
			WPI_NT_UNLOCK(sc);
2561
			if (error != 0) {
2567
			if (error != 0) {
2562
				device_printf(sc->sc_dev,
2568
				device_printf(sc->sc_dev,
2563
				    "%s: could not add IBSS node, error %d\n",
2569
				    "%s: could not add IBSS node, error %d\n",
Lines 3501-3510 Link Here
3501
		error = wpi_cmd(sc, WPI_CMD_RXON_ASSOC, &rxon_assoc,
3507
		error = wpi_cmd(sc, WPI_CMD_RXON_ASSOC, &rxon_assoc,
3502
		    sizeof (struct wpi_assoc), async);
3508
		    sizeof (struct wpi_assoc), async);
3503
	} else {
3509
	} else {
3510
		if (async)
3511
			WPI_NT_LOCK(sc);
3512
3504
		error = wpi_cmd(sc, WPI_CMD_RXON, &sc->rxon,
3513
		error = wpi_cmd(sc, WPI_CMD_RXON, &sc->rxon,
3505
		    sizeof (struct wpi_rxon), async);
3514
		    sizeof (struct wpi_rxon), async);
3506
3515
3507
		wpi_clear_node_table(sc);
3516
		wpi_clear_node_table(sc);
3517
3518
		if (async)
3519
			WPI_NT_UNLOCK(sc);
3508
	}
3520
	}
3509
	if (error != 0) {
3521
	if (error != 0) {
3510
		device_printf(sc->sc_dev, "RXON command failed, error %d\n",
3522
		device_printf(sc->sc_dev, "RXON command failed, error %d\n",
Lines 4069-4075 Link Here
4069
4081
4070
	if (vap->iv_opmode == IEEE80211_M_STA) {
4082
	if (vap->iv_opmode == IEEE80211_M_STA) {
4071
		/* Add BSS node. */
4083
		/* Add BSS node. */
4084
		WPI_NT_LOCK(sc);
4072
		error = wpi_add_sta_node(sc, ni);
4085
		error = wpi_add_sta_node(sc, ni);
4086
		WPI_NT_UNLOCK(sc);
4073
		if (error != 0) {
4087
		if (error != 0) {
4074
			device_printf(sc->sc_dev,
4088
			device_printf(sc->sc_dev,
4075
			    "%s: could not add BSS node, error %d\n", __func__,
4089
			    "%s: could not add BSS node, error %d\n", __func__,
(-)sys/dev/wpi/if_wpivar.h (-1 / +9 lines)
Lines 185-191 Link Here
185
	struct wpi_rxon		rxon;
185
	struct wpi_rxon		rxon;
186
	int			temp;
186
	int			temp;
187
	uint32_t		qfullmsk;
187
	uint32_t		qfullmsk;
188
188
	uint32_t		nodesmsk;
189
	uint32_t		nodesmsk;
190
	struct mtx		nt_mtx;
189
191
190
	int			sc_tx_timer;
192
	int			sc_tx_timer;
191
	int			sc_scan_timer;
193
	int			sc_scan_timer;
Lines 219-225 Link Here
219
	char			domain[4];	/* Regulatory domain. */
221
	char			domain[4];	/* Regulatory domain. */
220
};
222
};
221
223
222
/* WPI_LOCK > WPI_TXQ_LOCK */
224
/* WPI_LOCK > WPI_NT_LOCK > WPI_TXQ_LOCK */
223
225
224
#define WPI_LOCK_INIT(_sc) \
226
#define WPI_LOCK_INIT(_sc) \
225
	mtx_init(&(_sc)->sc_mtx, device_get_nameunit((_sc)->sc_dev), \
227
	mtx_init(&(_sc)->sc_mtx, device_get_nameunit((_sc)->sc_dev), \
Lines 229-234 Link Here
229
#define WPI_LOCK_ASSERT(sc)	mtx_assert(&(sc)->sc_mtx, MA_OWNED)
231
#define WPI_LOCK_ASSERT(sc)	mtx_assert(&(sc)->sc_mtx, MA_OWNED)
230
#define WPI_LOCK_DESTROY(_sc)	mtx_destroy(&(_sc)->sc_mtx)
232
#define WPI_LOCK_DESTROY(_sc)	mtx_destroy(&(_sc)->sc_mtx)
231
233
234
#define WPI_NT_LOCK_INIT(_sc) \
235
	mtx_init(&(_sc)->nt_mtx, "node table lock", NULL, MTX_DEF)
236
#define WPI_NT_LOCK(_sc)		mtx_lock(&(_sc)->nt_mtx)
237
#define WPI_NT_UNLOCK(_sc)		mtx_unlock(&(_sc)->nt_mtx)
238
#define WPI_NT_LOCK_DESTROY(_sc)	mtx_destroy(&(_sc)->nt_mtx)
239
232
#define WPI_TXQ_LOCK_INIT(_sc) \
240
#define WPI_TXQ_LOCK_INIT(_sc) \
233
	mtx_init(&(_sc)->txq_mtx, "txq/cmdq lock", NULL, MTX_DEF)
241
	mtx_init(&(_sc)->txq_mtx, "txq/cmdq lock", NULL, MTX_DEF)
234
#define WPI_TXQ_LOCK(_sc)		mtx_lock(&(_sc)->txq_mtx)
242
#define WPI_TXQ_LOCK(_sc)		mtx_lock(&(_sc)->txq_mtx)

Return to bug 197143