Lines 617-624
Link Here
|
617 |
vap = &wvp->wv_vap; |
617 |
vap = &wvp->wv_vap; |
618 |
ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid, mac); |
618 |
ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid, mac); |
619 |
|
619 |
|
620 |
if (opmode == IEEE80211_M_IBSS) |
620 |
if (opmode == IEEE80211_M_IBSS) { |
|
|
621 |
WPI_VAP_LOCK_INIT(wvp); |
621 |
wpi_init_beacon(wvp); |
622 |
wpi_init_beacon(wvp); |
|
|
623 |
} |
622 |
|
624 |
|
623 |
/* Override with driver methods. */ |
625 |
/* Override with driver methods. */ |
624 |
vap->iv_key_alloc = wpi_key_alloc; |
626 |
vap->iv_key_alloc = wpi_key_alloc; |
Lines 649-654
Link Here
|
649 |
if (opmode == IEEE80211_M_IBSS) { |
651 |
if (opmode == IEEE80211_M_IBSS) { |
650 |
if (bcn->m != NULL) |
652 |
if (bcn->m != NULL) |
651 |
m_freem(bcn->m); |
653 |
m_freem(bcn->m); |
|
|
654 |
|
655 |
WPI_VAP_LOCK_DESTROY(wvp); |
652 |
} |
656 |
} |
653 |
|
657 |
|
654 |
free(wvp, M_80211_VAP); |
658 |
free(wvp, M_80211_VAP); |
Lines 2340-2347
Link Here
|
2340 |
bus_dma_segment_t *seg, segs[WPI_MAX_SCATTER]; |
2344 |
bus_dma_segment_t *seg, segs[WPI_MAX_SCATTER]; |
2341 |
int error, i, hdrlen, nsegs, totlen, pad; |
2345 |
int error, i, hdrlen, nsegs, totlen, pad; |
2342 |
|
2346 |
|
2343 |
WPI_LOCK_ASSERT(sc); |
|
|
2344 |
|
2345 |
WPI_TXQ_LOCK(sc); |
2347 |
WPI_TXQ_LOCK(sc); |
2346 |
|
2348 |
|
2347 |
KASSERT(buf->size <= sizeof(buf->data), ("buffer overflow")); |
2349 |
KASSERT(buf->size <= sizeof(buf->data), ("buffer overflow")); |
Lines 3967-3973
Link Here
|
3967 |
|
3969 |
|
3968 |
DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_DOING, __func__); |
3970 |
DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_DOING, __func__); |
3969 |
|
3971 |
|
3970 |
WPI_LOCK_ASSERT(sc); |
3972 |
WPI_VAP_LOCK_ASSERT(wvp); |
3971 |
|
3973 |
|
3972 |
cmd->len = htole16(bcn->m->m_pkthdr.len); |
3974 |
cmd->len = htole16(bcn->m->m_pkthdr.len); |
3973 |
cmd->plcp = (ic->ic_curmode == IEEE80211_MODE_11A) ? |
3975 |
cmd->plcp = (ic->ic_curmode == IEEE80211_MODE_11A) ? |
Lines 4025-4030
Link Here
|
4025 |
return ENOMEM; |
4027 |
return ENOMEM; |
4026 |
} |
4028 |
} |
4027 |
|
4029 |
|
|
|
4030 |
WPI_VAP_LOCK(wvp); |
4028 |
if (bcn->m != NULL) |
4031 |
if (bcn->m != NULL) |
4029 |
m_freem(bcn->m); |
4032 |
m_freem(bcn->m); |
4030 |
|
4033 |
|
Lines 4031-4036
Link Here
|
4031 |
bcn->m = m; |
4034 |
bcn->m = m; |
4032 |
|
4035 |
|
4033 |
error = wpi_config_beacon(wvp); |
4036 |
error = wpi_config_beacon(wvp); |
|
|
4037 |
WPI_VAP_UNLOCK(wvp); |
4034 |
|
4038 |
|
4035 |
return error; |
4039 |
return error; |
4036 |
} |
4040 |
} |
Lines 4047-4067
Link Here
|
4047 |
|
4051 |
|
4048 |
DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_BEGIN, __func__); |
4052 |
DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_BEGIN, __func__); |
4049 |
|
4053 |
|
4050 |
WPI_LOCK(sc); |
4054 |
WPI_VAP_LOCK(wvp); |
4051 |
if (bcn->m == NULL) { |
4055 |
if (bcn->m == NULL) { |
4052 |
bcn->m = ieee80211_beacon_alloc(ni, bo); |
4056 |
bcn->m = ieee80211_beacon_alloc(ni, bo); |
4053 |
if (bcn->m == NULL) { |
4057 |
if (bcn->m == NULL) { |
4054 |
device_printf(sc->sc_dev, |
4058 |
device_printf(sc->sc_dev, |
4055 |
"%s: could not allocate beacon frame\n", __func__); |
4059 |
"%s: could not allocate beacon frame\n", __func__); |
4056 |
WPI_UNLOCK(sc); |
|
|
4057 |
|
4060 |
|
4058 |
DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END_ERR, |
4061 |
DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END_ERR, |
4059 |
__func__); |
4062 |
__func__); |
4060 |
|
4063 |
|
|
|
4064 |
WPI_VAP_UNLOCK(wvp); |
4061 |
return; |
4065 |
return; |
4062 |
} |
4066 |
} |
4063 |
} |
4067 |
} |
4064 |
WPI_UNLOCK(sc); |
4068 |
WPI_VAP_UNLOCK(wvp); |
4065 |
|
4069 |
|
4066 |
if (item == IEEE80211_BEACON_TIM) |
4070 |
if (item == IEEE80211_BEACON_TIM) |
4067 |
mcast = 1; /* TODO */ |
4071 |
mcast = 1; /* TODO */ |
Lines 4069-4077
Link Here
|
4069 |
setbit(bo->bo_flags, item); |
4073 |
setbit(bo->bo_flags, item); |
4070 |
ieee80211_beacon_update(ni, bo, bcn->m, mcast); |
4074 |
ieee80211_beacon_update(ni, bo, bcn->m, mcast); |
4071 |
|
4075 |
|
4072 |
WPI_LOCK(sc); |
4076 |
WPI_VAP_LOCK(wvp); |
4073 |
wpi_config_beacon(wvp); |
4077 |
wpi_config_beacon(wvp); |
4074 |
WPI_UNLOCK(sc); |
4078 |
WPI_VAP_UNLOCK(wvp); |
4075 |
|
4079 |
|
4076 |
DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__); |
4080 |
DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_END, __func__); |
4077 |
} |
4081 |
} |