Index: head/sys/dev/ath/if_ath_beacon.c =================================================================== --- head/sys/dev/ath/if_ath_beacon.c +++ head/sys/dev/ath/if_ath_beacon.c @@ -199,7 +199,7 @@ * we assume the mbuf routines will return us something * with this alignment (perhaps should assert). */ - m = ieee80211_beacon_alloc(ni, &avp->av_boff); + m = ieee80211_beacon_alloc(ni, &vap->iv_bcn_off); if (m == NULL) { device_printf(sc->sc_dev, "%s: cannot get mbuf\n", __func__); sc->sc_stats.ast_be_nombuf++; @@ -374,7 +374,7 @@ void ath_beacon_update(struct ieee80211vap *vap, int item) { - struct ieee80211_beacon_offsets *bo = &ATH_VAP(vap)->av_boff; + struct ieee80211_beacon_offsets *bo = &vap->iv_bcn_off; setbit(bo->bo_flags, item); } @@ -713,7 +713,7 @@ /* XXX lock mcastq? */ nmcastq = avp->av_mcastq.axq_depth; - if (ieee80211_beacon_update(bf->bf_node, &avp->av_boff, m, nmcastq)) { + if (ieee80211_beacon_update(bf->bf_node, &vap->iv_bcn_off, m, nmcastq)) { /* XXX too conservative? */ bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); error = bus_dmamap_load_mbuf_sg(sc->sc_dmat, bf->bf_dmamap, m, @@ -726,7 +726,7 @@ return NULL; } } - if ((avp->av_boff.bo_tim[4] & 1) && cabq->axq_depth) { + if ((vap->iv_bcn_off.bo_tim[4] & 1) && cabq->axq_depth) { DPRINTF(sc, ATH_DEBUG_BEACON, "%s: cabq did not drain, mcastq %u cabq %u\n", __func__, nmcastq, cabq->axq_depth); @@ -764,7 +764,7 @@ * Enable the CAB queue before the beacon queue to * insure cab frames are triggered by this beacon. */ - if (avp->av_boff.bo_tim[4] & 1) { + if (vap->iv_bcn_off.bo_tim[4] & 1) { /* NB: only at DTIM */ ATH_TXQ_LOCK(&avp->av_mcastq); @@ -829,7 +829,7 @@ */ bf = avp->av_bcbuf; m = bf->bf_m; - if (ieee80211_beacon_update(bf->bf_node, &avp->av_boff, m, 0)) { + if (ieee80211_beacon_update(bf->bf_node, &vap->iv_bcn_off, m, 0)) { /* XXX too conservative? */ bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); error = bus_dmamap_load_mbuf_sg(sc->sc_dmat, bf->bf_dmamap, m, Index: head/sys/dev/ath/if_ath_tdma.c =================================================================== --- head/sys/dev/ath/if_ath_tdma.c +++ head/sys/dev/ath/if_ath_tdma.c @@ -548,7 +548,7 @@ * slot position changes) because ieee80211_add_tdma * skips over the data. */ - memcpy(ATH_VAP(vap)->av_boff.bo_tdma + + memcpy(vap->iv_bcn_off.bo_tdma + __offsetof(struct ieee80211_tdma_param, tdma_tstamp), &ni->ni_tstamp.data, 8); #if 0 Index: head/sys/dev/ath/if_athvar.h =================================================================== --- head/sys/dev/ath/if_athvar.h +++ head/sys/dev/ath/if_athvar.h @@ -477,7 +477,6 @@ struct ieee80211vap av_vap; /* base class */ int av_bslot; /* beacon slot index */ struct ath_buf *av_bcbuf; /* beacon buffer */ - struct ieee80211_beacon_offsets av_boff;/* dynamic update state */ struct ath_txq av_mcastq; /* buffered mcast s/w queue */ void (*av_recv_mgmt)(struct ieee80211_node *, Index: head/sys/dev/mwl/if_mwl.c =================================================================== --- head/sys/dev/mwl/if_mwl.c +++ head/sys/dev/mwl/if_mwl.c @@ -1834,10 +1834,10 @@ { struct mwl_hal_vap *hvap = MWL_VAP(vap)->mv_hvap; struct ieee80211_node *ni = vap->iv_bss; - struct ieee80211_beacon_offsets bo; + struct ieee80211_beacon_offsets *bo = &vap->iv_bcn_off; struct mbuf *m; - m = ieee80211_beacon_alloc(ni, &bo); + m = ieee80211_beacon_alloc(ni, bo); if (m == NULL) return ENOBUFS; mwl_hal_setbeacon(hvap, mtod(m, const void *), m->m_len); Index: head/sys/dev/ral/rt2560.c =================================================================== --- head/sys/dev/ral/rt2560.c +++ head/sys/dev/ral/rt2560.c @@ -768,7 +768,7 @@ if (vap->iv_opmode == IEEE80211_M_HOSTAP || vap->iv_opmode == IEEE80211_M_IBSS || vap->iv_opmode == IEEE80211_M_MBSS) { - m = ieee80211_beacon_alloc(ni, &rvp->ral_bo); + m = ieee80211_beacon_alloc(ni, &vap->iv_bcn_off); if (m == NULL) { device_printf(sc->sc_dev, "could not allocate beacon\n"); @@ -1273,8 +1273,7 @@ static void rt2560_beacon_update(struct ieee80211vap *vap, int item) { - struct rt2560_vap *rvp = RT2560_VAP(vap); - struct ieee80211_beacon_offsets *bo = &rvp->ral_bo; + struct ieee80211_beacon_offsets *bo = &vap->iv_bcn_off; setbit(bo->bo_flags, item); } @@ -1288,7 +1287,6 @@ { struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); - struct rt2560_vap *rvp = RT2560_VAP(vap); struct rt2560_tx_data *data; if (ic->ic_opmode != IEEE80211_M_IBSS && @@ -1307,7 +1305,7 @@ bus_dmamap_unload(sc->bcnq.data_dmat, data->map); /* XXX 1 =>'s mcast frames which means all PS sta's will wakeup! */ - ieee80211_beacon_update(data->ni, &rvp->ral_bo, data->m, 1); + ieee80211_beacon_update(data->ni, &vap->iv_bcn_off, data->m, 1); rt2560_tx_bcn(sc, data->m, data->ni); Index: head/sys/dev/ral/rt2560var.h =================================================================== --- head/sys/dev/ral/rt2560var.h +++ head/sys/dev/ral/rt2560var.h @@ -97,7 +97,6 @@ struct rt2560_vap { struct ieee80211vap ral_vap; - struct ieee80211_beacon_offsets ral_bo; int (*ral_newstate)(struct ieee80211vap *, enum ieee80211_state, int); Index: head/sys/dev/ral/rt2661.c =================================================================== --- head/sys/dev/ral/rt2661.c +++ head/sys/dev/ral/rt2661.c @@ -2626,12 +2626,12 @@ rt2661_prepare_beacon(struct rt2661_softc *sc, struct ieee80211vap *vap) { struct ieee80211com *ic = vap->iv_ic; - struct ieee80211_beacon_offsets bo; + struct ieee80211_beacon_offsets *bo = &vap->iv_bcn_off; struct rt2661_tx_desc desc; struct mbuf *m0; int rate; - m0 = ieee80211_beacon_alloc(vap->iv_bss, &bo); + m0 = ieee80211_beacon_alloc(vap->iv_bss, bo); if (m0 == NULL) { device_printf(sc->sc_dev, "could not allocate beacon frame\n"); return ENOBUFS; Index: head/sys/dev/ral/rt2860.c =================================================================== --- head/sys/dev/ral/rt2860.c +++ head/sys/dev/ral/rt2860.c @@ -4268,12 +4268,12 @@ rt2860_setup_beacon(struct rt2860_softc *sc, struct ieee80211vap *vap) { struct ieee80211com *ic = vap->iv_ic; - struct ieee80211_beacon_offsets bo; + struct ieee80211_beacon_offsets *bo = &vap->iv_bcn_off; struct rt2860_txwi txwi; struct mbuf *m; int ridx; - if ((m = ieee80211_beacon_alloc(vap->iv_bss, &bo)) == NULL) + if ((m = ieee80211_beacon_alloc(vap->iv_bss, bo)) == NULL) return ENOBUFS; memset(&txwi, 0, sizeof txwi); Index: head/sys/dev/usb/wlan/if_rsureg.h =================================================================== --- head/sys/dev/usb/wlan/if_rsureg.h +++ head/sys/dev/usb/wlan/if_rsureg.h @@ -724,7 +724,6 @@ struct rsu_vap { struct ieee80211vap vap; - struct ieee80211_beacon_offsets bo; int (*newstate)(struct ieee80211vap *, enum ieee80211_state, int); Index: head/sys/dev/usb/wlan/if_run.c =================================================================== --- head/sys/dev/usb/wlan/if_run.c +++ head/sys/dev/usb/wlan/if_run.c @@ -4811,13 +4811,13 @@ run_update_beacon(struct ieee80211vap *vap, int item) { struct ieee80211com *ic = vap->iv_ic; + struct ieee80211_beacon_offsets *bo = &vap->iv_bcn_off; + struct ieee80211_node *ni = vap->iv_bss; struct run_softc *sc = ic->ic_softc; struct run_vap *rvp = RUN_VAP(vap); int mcast = 0; uint32_t i; - KASSERT(vap != NULL, ("no beacon")); - switch (item) { case IEEE80211_BEACON_ERP: run_updateslot(ic); @@ -4832,14 +4832,13 @@ break; } - setbit(rvp->bo.bo_flags, item); + setbit(bo->bo_flags, item); if (rvp->beacon_mbuf == NULL) { - rvp->beacon_mbuf = ieee80211_beacon_alloc(vap->iv_bss, - &rvp->bo); + rvp->beacon_mbuf = ieee80211_beacon_alloc(ni, bo); if (rvp->beacon_mbuf == NULL) return; } - ieee80211_beacon_update(vap->iv_bss, &rvp->bo, rvp->beacon_mbuf, mcast); + ieee80211_beacon_update(ni, bo, rvp->beacon_mbuf, mcast); i = RUN_CMDQ_GET(&sc->cmdq_store); DPRINTF("cmdq_store=%d\n", i); @@ -4854,6 +4853,7 @@ run_update_beacon_cb(void *arg) { struct ieee80211vap *vap = arg; + struct ieee80211_node *ni = vap->iv_bss; struct run_vap *rvp = RUN_VAP(vap); struct ieee80211com *ic = vap->iv_ic; struct run_softc *sc = ic->ic_softc; @@ -4862,7 +4862,7 @@ uint16_t txwisize; uint8_t ridx; - if (vap->iv_bss->ni_chan == IEEE80211_CHAN_ANYC) + if (ni->ni_chan == IEEE80211_CHAN_ANYC) return; if (ic->ic_bsschan == IEEE80211_CHAN_ANYC) return; @@ -4872,8 +4872,8 @@ * is taking care of apropriate calls. */ if (rvp->beacon_mbuf == NULL) { - rvp->beacon_mbuf = ieee80211_beacon_alloc(vap->iv_bss, - &rvp->bo); + rvp->beacon_mbuf = ieee80211_beacon_alloc(ni, + &vap->iv_bcn_off); if (rvp->beacon_mbuf == NULL) return; } Index: head/sys/dev/usb/wlan/if_runvar.h =================================================================== --- head/sys/dev/usb/wlan/if_runvar.h +++ head/sys/dev/usb/wlan/if_runvar.h @@ -119,7 +119,6 @@ struct run_vap { struct ieee80211vap vap; - struct ieee80211_beacon_offsets bo; struct mbuf *beacon_mbuf; int (*newstate)(struct ieee80211vap *, Index: head/sys/dev/usb/wlan/if_ural.c =================================================================== --- head/sys/dev/usb/wlan/if_ural.c +++ head/sys/dev/usb/wlan/if_ural.c @@ -713,7 +713,7 @@ if (vap->iv_opmode == IEEE80211_M_HOSTAP || vap->iv_opmode == IEEE80211_M_IBSS) { - m = ieee80211_beacon_alloc(ni, &uvp->bo); + m = ieee80211_beacon_alloc(ni, &vap->iv_bcn_off); if (m == NULL) { device_printf(sc->sc_dev, "could not allocate beacon\n"); Index: head/sys/dev/usb/wlan/if_uralvar.h =================================================================== --- head/sys/dev/usb/wlan/if_uralvar.h +++ head/sys/dev/usb/wlan/if_uralvar.h @@ -73,7 +73,7 @@ struct ural_vap { struct ieee80211vap vap; - struct ieee80211_beacon_offsets bo; + struct usb_callout ratectl_ch; struct task ratectl_task; Index: head/sys/dev/usb/wlan/if_urtwnreg.h =================================================================== --- head/sys/dev/usb/wlan/if_urtwnreg.h +++ head/sys/dev/usb/wlan/if_urtwnreg.h @@ -1134,7 +1134,6 @@ struct urtwn_vap { struct ieee80211vap vap; - struct ieee80211_beacon_offsets bo; int (*newstate)(struct ieee80211vap *, enum ieee80211_state, int); Index: head/sys/dev/wi/if_wivar.h =================================================================== --- head/sys/dev/wi/if_wivar.h +++ head/sys/dev/wi/if_wivar.h @@ -58,7 +58,6 @@ struct wi_vap { struct ieee80211vap wv_vap; - struct ieee80211_beacon_offsets wv_bo; void (*wv_recv_mgmt)(struct ieee80211_node *, struct mbuf *, int, const struct ieee80211_rx_stats *rxs, int, int); Index: head/sys/dev/wpi/if_wpi.c =================================================================== --- head/sys/dev/wpi/if_wpi.c +++ head/sys/dev/wpi/if_wpi.c @@ -4309,8 +4309,9 @@ static int wpi_config_beacon(struct wpi_vap *wvp) { - struct ieee80211com *ic = wvp->wv_vap.iv_ic; - struct ieee80211_beacon_offsets *bo = &wvp->wv_boff; + struct ieee80211vap *vap = &wvp->wv_vap; + struct ieee80211com *ic = vap->iv_ic; + struct ieee80211_beacon_offsets *bo = &vap->iv_bcn_off; struct wpi_buf *bcn = &wvp->wv_bcbuf; struct wpi_softc *sc = ic->ic_softc; struct wpi_cmd_beacon *cmd = (struct wpi_cmd_beacon *)&bcn->data; @@ -4361,9 +4362,10 @@ static int wpi_setup_beacon(struct wpi_softc *sc, struct ieee80211_node *ni) { - struct wpi_vap *wvp = WPI_VAP(ni->ni_vap); + struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211_beacon_offsets *bo = &vap->iv_bcn_off; + struct wpi_vap *wvp = WPI_VAP(vap); struct wpi_buf *bcn = &wvp->wv_bcbuf; - struct ieee80211_beacon_offsets *bo = &wvp->wv_boff; struct mbuf *m; int error; @@ -4397,7 +4399,7 @@ struct wpi_softc *sc = vap->iv_ic->ic_softc; struct wpi_vap *wvp = WPI_VAP(vap); struct wpi_buf *bcn = &wvp->wv_bcbuf; - struct ieee80211_beacon_offsets *bo = &wvp->wv_boff; + struct ieee80211_beacon_offsets *bo = &vap->iv_bcn_off; struct ieee80211_node *ni = vap->iv_bss; int mcast = 0; Index: head/sys/dev/wpi/if_wpivar.h =================================================================== --- head/sys/dev/wpi/if_wpivar.h +++ head/sys/dev/wpi/if_wpivar.h @@ -125,7 +125,6 @@ struct ieee80211vap wv_vap; struct wpi_buf wv_bcbuf; - struct ieee80211_beacon_offsets wv_boff; struct mtx wv_mtx; uint32_t wv_gtk; Index: head/sys/dev/wtap/if_wtap.c =================================================================== --- head/sys/dev/wtap/if_wtap.c +++ head/sys/dev/wtap/if_wtap.c @@ -183,7 +183,7 @@ static void wtap_beacon_update(struct ieee80211vap *vap, int item) { - struct ieee80211_beacon_offsets *bo = &WTAP_VAP(vap)->av_boff; + struct ieee80211_beacon_offsets *bo = &vap->iv_bcn_off; DWTAP_PRINTF("%s\n", __func__); setbit(bo->bo_flags, item); @@ -205,7 +205,7 @@ * we assume the mbuf routines will return us something * with this alignment (perhaps should assert). */ - avp->beacon = ieee80211_beacon_alloc(ni, &avp->av_boff); + avp->beacon = ieee80211_beacon_alloc(ni, &vap->iv_bcn_off); if (avp->beacon == NULL) { printf("%s: cannot get mbuf\n", __func__); return ENOMEM; @@ -242,7 +242,7 @@ * of the TIM bitmap). */ m = m_dup(avp->beacon, M_NOWAIT); - if (ieee80211_beacon_update(avp->bf_node, &avp->av_boff, m, 0)) { + if (ieee80211_beacon_update(avp->bf_node, &vap->iv_bcn_off, m, 0)) { printf("%s, need to remap the memory because the beacon frame" " changed size.\n",__func__); } Index: head/sys/dev/wtap/if_wtapvar.h =================================================================== --- head/sys/dev/wtap/if_wtapvar.h +++ head/sys/dev/wtap/if_wtapvar.h @@ -116,7 +116,6 @@ struct wtap_medium *av_md; /* back pointer */ struct mbuf *beacon; /* beacon */ struct ieee80211_node *bf_node; /* pointer to the node */ - struct ieee80211_beacon_offsets av_boff;/* dynamic update state */ struct callout av_swba; /* software beacon alert */ uint32_t av_bcinterval; /* beacon interval */ void (*av_recv_mgmt)(struct ieee80211_node *, Index: head/sys/net80211/ieee80211_var.h =================================================================== --- head/sys/net80211/ieee80211_var.h +++ head/sys/net80211/ieee80211_var.h @@ -417,6 +417,7 @@ int iv_amsdu_limit; /* A-MSDU tx limit (bytes) */ u_int iv_ampdu_mintraffic[WME_NUM_AC]; + struct ieee80211_beacon_offsets iv_bcn_off; uint32_t *iv_aid_bitmap; /* association id map */ uint16_t iv_max_aid; uint16_t iv_sta_assoc; /* stations associated */