mirror of
https://github.com/proski/madwifi
synced 2024-11-22 22:41:33 +03:00
port of r2879 from madwifi-dfs
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2980 0192ed92-7a03-0410-a25b-9323aeb14dbd
This commit is contained in:
parent
ebcc658008
commit
4df2d580a7
20
ath/if_ath.c
20
ath/if_ath.c
@ -4246,6 +4246,14 @@ ath_beaconq_config(struct ath_softc *sc)
|
||||
}
|
||||
#undef ATH_EXPONENT_TO_VALUE
|
||||
}
|
||||
/* Return 1 if beacon was already allocated, 0 otherwise. */
|
||||
static int
|
||||
ath_beacon_allocated(struct ath_softc *sc, struct ieee80211_node *ni) {
|
||||
return ni != NULL &&
|
||||
ni->ni_vap != NULL &&
|
||||
ATH_VAP(ni->ni_vap)->av_bcbuf != NULL &&
|
||||
ATH_VAP(ni->ni_vap)->av_bcbuf->bf_skb != NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate and setup an initial beacon frame.
|
||||
@ -4260,6 +4268,8 @@ ath_beacon_alloc(struct ath_softc *sc, struct ieee80211_node *ni)
|
||||
struct ath_buf *bf;
|
||||
struct sk_buff *skb;
|
||||
|
||||
KASSERT(!ath_beacon_allocated(sc, ni), ("beacon alloc called twice!"));
|
||||
|
||||
/*
|
||||
* release the previous beacon's skb if it already exists.
|
||||
*/
|
||||
@ -4448,6 +4458,7 @@ ath_beacon_generate(struct ath_softc *sc, struct ieee80211vap *vap, int *needmar
|
||||
struct ath_vap *avp;
|
||||
struct sk_buff *skb;
|
||||
unsigned int curlen, ncabq;
|
||||
u_int8_t tim_bitctl;
|
||||
|
||||
if (vap->iv_state != IEEE80211_S_RUN) {
|
||||
DPRINTF(sc, ATH_DEBUG_BEACON_PROC, "%s: skip VAP in %s state\n",
|
||||
@ -4511,7 +4522,8 @@ ath_beacon_generate(struct ath_softc *sc, struct ieee80211vap *vap, int *needmar
|
||||
* the cabq so that the current VAPs CAB traffic can be scheduled.
|
||||
* XXX: Need to handle the last MORE_DATA bit here.
|
||||
*/
|
||||
if (ncabq && (avp->av_boff.bo_tim[4] & 1) && sc->sc_cabq->axq_depth) {
|
||||
tim_bitctl = ((struct ieee80211_tim_ie *)avp->av_boff.bo_tim)->tim_bitctl;
|
||||
if (ncabq && (tim_bitctl & BITCTL_BUFD_MCAST) && sc->sc_cabq->axq_depth) {
|
||||
if (sc->sc_nvaps > 1 && sc->sc_stagbeacons) {
|
||||
ath_tx_draintxq(sc, sc->sc_cabq);
|
||||
DPRINTF(sc, ATH_DEBUG_BEACON,
|
||||
@ -4530,8 +4542,8 @@ ath_beacon_generate(struct ath_softc *sc, struct ieee80211vap *vap, int *needmar
|
||||
/*
|
||||
* Enable the CAB queue before the beacon queue to
|
||||
* ensure cab frames are triggered by this beacon.
|
||||
*/
|
||||
if (avp->av_boff.bo_tim[4] & 1) { /* NB: only at DTIM */
|
||||
* We only set BITCTL_BUFD_MCAST bit when its DTIM */
|
||||
if (tim_bitctl & BITCTL_BUFD_MCAST) {
|
||||
struct ath_txq *cabq = sc->sc_cabq;
|
||||
struct ath_buf *bfmcast;
|
||||
/*
|
||||
@ -8568,9 +8580,11 @@ ath_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
|
||||
ni->ni_ath_defkeyindex = vap->iv_def_txkey;
|
||||
}
|
||||
|
||||
if (!ath_beacon_allocated(sc,ni)) {
|
||||
error = ath_beacon_alloc(sc, ni);
|
||||
if (error < 0)
|
||||
goto bad;
|
||||
}
|
||||
/*
|
||||
* if the turbo flags have changed, then beacon and turbo
|
||||
* need to be reconfigured.
|
||||
|
@ -714,6 +714,9 @@ enum {
|
||||
};
|
||||
|
||||
#define IEEE80211_CHANSWITCHANN_BYTES 5
|
||||
#define BITCTL_BUFD_MCAST 1
|
||||
#define BITCTL_BUFD_UCAST_AID_MASK ((u_int8_t)~(BITCTL_BUFD_MCAST))
|
||||
#define BITCTL_BUFD_UCAST_AID_SHIFT 1
|
||||
|
||||
struct ieee80211_tim_ie {
|
||||
u_int8_t tim_ie; /* IEEE80211_ELEMID_TIM */
|
||||
|
@ -422,7 +422,7 @@ ieee80211_beacon_update(struct ieee80211_node *ni,
|
||||
timoff = 128; /* impossibly large */
|
||||
for (i = 0; i < vap->iv_tim_len; i++)
|
||||
if (vap->iv_tim_bitmap[i]) {
|
||||
timoff = i &~ 1;
|
||||
timoff = i & BITCTL_BUFD_UCAST_AID_MASK;
|
||||
break;
|
||||
}
|
||||
KASSERT(timoff != 128, ("tim bitmap empty!"));
|
||||
@ -473,9 +473,9 @@ ieee80211_beacon_update(struct ieee80211_node *ni,
|
||||
tie->tim_count--;
|
||||
/* update state for buffered multicast frames on DTIM */
|
||||
if (mcast && (tie->tim_count == 0))
|
||||
tie->tim_bitctl |= 1;
|
||||
tie->tim_bitctl |= BITCTL_BUFD_MCAST;
|
||||
else
|
||||
tie->tim_bitctl &= ~1;
|
||||
tie->tim_bitctl &= BITCTL_BUFD_UCAST_AID_MASK;
|
||||
|
||||
if ((ic->ic_flags & IEEE80211_F_DOTH) &&
|
||||
(ic->ic_flags & IEEE80211_F_CHANSWITCH)) {
|
||||
|
Loading…
Reference in New Issue
Block a user