FreeBSD Bugzilla – Attachment 154349 Details for
Bug 197143
[wpi] [patch]: sync with iwn / OpenBSD wpi
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Use separate mutex for wv_bcbuf / wv_boff structures
patch-wpi38.diff (text/plain), 3.27 KB, created by
Andriy Voskoboinyk
on 2015-03-15 12:29:22 UTC
(
hide
)
Description:
Use separate mutex for wv_bcbuf / wv_boff structures
Filename:
MIME Type:
Creator:
Andriy Voskoboinyk
Created:
2015-03-15 12:29:22 UTC
Size:
3.27 KB
patch
obsolete
>Index: sys/dev/wpi/if_wpi.c >=================================================================== >--- sys/dev/wpi/if_wpi.c (revision 279775) >+++ sys/dev/wpi/if_wpi.c (working copy) >@@ -617,8 +617,10 @@ > vap = &wvp->wv_vap; > ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid, mac); > >- if (opmode == IEEE80211_M_IBSS) >+ if (opmode == IEEE80211_M_IBSS) { >+ WPI_VAP_LOCK_INIT(wvp); > wpi_init_beacon(wvp); >+ } > > /* Override with driver methods. */ > vap->iv_key_alloc = wpi_key_alloc; >@@ -649,6 +651,8 @@ > if (opmode == IEEE80211_M_IBSS) { > if (bcn->m != NULL) > m_freem(bcn->m); >+ >+ WPI_VAP_LOCK_DESTROY(wvp); > } > > free(wvp, M_80211_VAP); >@@ -2340,8 +2344,6 @@ > bus_dma_segment_t *seg, segs[WPI_MAX_SCATTER]; > int error, i, hdrlen, nsegs, totlen, pad; > >- WPI_LOCK_ASSERT(sc); >- > WPI_TXQ_LOCK(sc); > > KASSERT(buf->size <= sizeof(buf->data), ("buffer overflow")); >@@ -3967,7 +3969,7 @@ > > DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_DOING, __func__); > >- WPI_LOCK_ASSERT(sc); >+ WPI_VAP_LOCK_ASSERT(wvp); > > cmd->len = htole16(bcn->m->m_pkthdr.len); > cmd->plcp = (ic->ic_curmode == IEEE80211_MODE_11A) ? >@@ -4025,6 +4027,7 @@ > return ENOMEM; > } > >+ WPI_VAP_LOCK(wvp); > if (bcn->m != NULL) > m_freem(bcn->m); > >@@ -4031,6 +4034,7 @@ > bcn->m = m; > > error = wpi_config_beacon(wvp); >+ WPI_VAP_UNLOCK(wvp); > > return error; > } >@@ -4047,21 +4051,21 @@ > > DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_BEGIN, __func__); > >- WPI_LOCK(sc); >+ WPI_VAP_LOCK(wvp); > if (bcn->m == NULL) { > bcn->m = ieee80211_beacon_alloc(ni, bo); > if (bcn->m == NULL) { > device_printf(sc->sc_dev, > "%s: could not allocate beacon frame\n", __func__); >- WPI_UNLOCK(sc); > > DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END_ERR, > __func__); > >+ WPI_VAP_UNLOCK(wvp); > return; > } > } >- WPI_UNLOCK(sc); >+ WPI_VAP_UNLOCK(wvp); > > if (item == IEEE80211_BEACON_TIM) > mcast = 1; /* TODO */ >@@ -4069,9 +4073,9 @@ > setbit(bo->bo_flags, item); > ieee80211_beacon_update(ni, bo, bcn->m, mcast); > >- WPI_LOCK(sc); >+ WPI_VAP_LOCK(wvp); > wpi_config_beacon(wvp); >- WPI_UNLOCK(sc); >+ WPI_VAP_UNLOCK(wvp); > > DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__); > } >Index: if_wpivar.h >=================================================================== >--- sys/dev/wpi/if_wpivar.h (revision 279775) >+++ sys/dev/wpi/if_wpivar.h (working copy) >@@ -125,6 +125,7 @@ > > struct wpi_buf wv_bcbuf; > struct ieee80211_beacon_offsets wv_boff; >+ struct mtx wv_mtx; > > int (*wv_newstate)(struct ieee80211vap *, > enum ieee80211_state, int); >@@ -131,6 +132,14 @@ > }; > #define WPI_VAP(vap) ((struct wpi_vap *)(vap)) > >+#define WPI_VAP_LOCK_INIT(_wvp) \ >+ mtx_init(&(_wvp)->wv_mtx, "lock for wv_bcbuf/wv_boff structures", \ >+ NULL, MTX_DEF) >+#define WPI_VAP_LOCK(_wvp) mtx_lock(&(_wvp)->wv_mtx) >+#define WPI_VAP_UNLOCK(_wvp) mtx_unlock(&(_wvp)->wv_mtx) >+#define WPI_VAP_LOCK_ASSERT(_wvp) mtx_assert(&(_wvp)->wv_mtx, MA_OWNED) >+#define WPI_VAP_LOCK_DESTROY(_wvp) mtx_destroy(&(_wvp)->wv_mtx) >+ > struct wpi_fw_part { > const uint8_t *text; > uint32_t textsz; >@@ -224,7 +233,7 @@ > char domain[4]; /* Regulatory domain. */ > }; > >-/* WPI_LOCK > WPI_NT_LOCK > WPI_TXQ_LOCK */ >+/* WPI_LOCK > WPI_NT_LOCK / WPI_VAP_LOCK > WPI_TXQ_LOCK */ > > #define WPI_LOCK_INIT(_sc) \ > mtx_init(&(_sc)->sc_mtx, device_get_nameunit((_sc)->sc_dev), \
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 197143
:
152282
|
152662
|
152977
|
153911
|
153977
|
153983
|
153985
|
153999
|
154000
|
154002
|
154006
|
154007
|
154009
|
154010
|
154011
|
154013
|
154015
|
154016
|
154017
|
154019
|
154020
|
154021
|
154022
|
154024
|
154026
|
154030
|
154032
|
154033
|
154328
|
154329
|
154330
|
154332
|
154334
|
154335
|
154336
|
154337
|
154338
|
154340
|
154341
|
154343
|
154346
|
154347
|
154348
| 154349 |
154350
|
154351
|
154352
|
154353
|
154354
|
154355
|
154356
|
154357
|
154358
|
154359
|
154360
|
154361
|
154362
|
154363
|
154364
|
154365
|
154366
|
154368
|
154369
|
154370
|
154371
|
154372
|
154373
|
154374
|
154375
|
154378
|
154379
|
154380
|
154381
|
154382
|
154383
|
154384
|
155332
|
155333
|
156164
|
156165
|
156166
|
156167
|
156168
|
156169
|
156170
|
156171
|
156172
|
156173
|
156174
|
156175
|
156176
|
156177
|
156178
|
156179
|
156180
|
156181
|
156182
|
156183
|
156184
|
156185
|
156186
|
156187
|
156188
|
156189
|
156190
|
156191
|
156192
|
156193
|
156194
|
156195