Set the correct IFS parameters for the beacon tx queue
when operating in ap and adhoc modes.
This commit is contained in:
parent
6aa57182d3
commit
0f2e86fb2a
@ -1721,10 +1721,52 @@ ath_beaconq_setup(struct ath_hal *ah)
|
||||
qi.tqi_aifs = HAL_TXQ_USEDEFAULT;
|
||||
qi.tqi_cwmin = HAL_TXQ_USEDEFAULT;
|
||||
qi.tqi_cwmax = HAL_TXQ_USEDEFAULT;
|
||||
/* NB: don't enable any interrupts */
|
||||
/* NB: for dynamic turbo, don't enable any other interrupts */
|
||||
qi.tqi_qflags = TXQ_FLAG_TXDESCINT_ENABLE;
|
||||
return ath_hal_setuptxqueue(ah, HAL_TX_QUEUE_BEACON, &qi);
|
||||
}
|
||||
|
||||
/*
|
||||
* Setup the transmit queue parameters for the beacon queue.
|
||||
*/
|
||||
static int
|
||||
ath_beaconq_config(struct ath_softc *sc)
|
||||
{
|
||||
#define ATH_EXPONENT_TO_VALUE(v) ((1<<(v))-1)
|
||||
struct ieee80211com *ic = &sc->sc_ic;
|
||||
struct ath_hal *ah = sc->sc_ah;
|
||||
HAL_TXQ_INFO qi;
|
||||
|
||||
ath_hal_gettxqueueprops(ah, sc->sc_bhalq, &qi);
|
||||
if (ic->ic_opmode == IEEE80211_M_HOSTAP) {
|
||||
/*
|
||||
* Always burst out beacon and CAB traffic.
|
||||
*/
|
||||
qi.tqi_aifs = ATH_BEACON_AIFS_DEFAULT;
|
||||
qi.tqi_cwmin = ATH_BEACON_CWMIN_DEFAULT;
|
||||
qi.tqi_cwmax = ATH_BEACON_CWMAX_DEFAULT;
|
||||
} else {
|
||||
struct wmeParams *wmep =
|
||||
&ic->ic_wme.wme_chanParams.cap_wmeParams[WME_AC_BE];
|
||||
/*
|
||||
* Adhoc mode; important thing is to use 2x cwmin.
|
||||
*/
|
||||
qi.tqi_aifs = wmep->wmep_aifsn;
|
||||
qi.tqi_cwmin = 2*ATH_EXPONENT_TO_VALUE(wmep->wmep_logcwmin);
|
||||
qi.tqi_cwmax = ATH_EXPONENT_TO_VALUE(wmep->wmep_logcwmax);
|
||||
}
|
||||
|
||||
if (!ath_hal_settxqueueprops(ah, sc->sc_bhalq, &qi)) {
|
||||
device_printf(sc->sc_dev, "unable to update parameters for "
|
||||
"beacon hardware queue!\n");
|
||||
return 0;
|
||||
} else {
|
||||
ath_hal_resettxqueue(ah, sc->sc_bhalq); /* push to h/w */
|
||||
return 1;
|
||||
}
|
||||
#undef ATH_EXPONENT_TO_VALUE
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate and setup an initial beacon frame.
|
||||
*/
|
||||
@ -2111,6 +2153,7 @@ ath_beacon_config(struct ath_softc *sc)
|
||||
intval |= HAL_BEACON_ENA;
|
||||
if (!sc->sc_hasveol)
|
||||
sc->sc_imask |= HAL_INT_SWBA;
|
||||
ath_beaconq_config(sc);
|
||||
} else if (ic->ic_opmode == IEEE80211_M_HOSTAP) {
|
||||
/*
|
||||
* In AP mode we enable the beacon timers and
|
||||
@ -2118,6 +2161,7 @@ ath_beacon_config(struct ath_softc *sc)
|
||||
*/
|
||||
intval |= HAL_BEACON_ENA;
|
||||
sc->sc_imask |= HAL_INT_SWBA; /* beacon prepare */
|
||||
ath_beaconq_config(sc);
|
||||
}
|
||||
ath_hal_beaconinit(ah, nexttbtt, intval);
|
||||
sc->sc_bmisscount = 0;
|
||||
|
@ -57,6 +57,10 @@
|
||||
#define ATH_TXMAXTRY 11 /* max number of transmit attempts */
|
||||
#define ATH_TXINTR_PERIOD 5 /* max number of batched tx descriptors */
|
||||
|
||||
#define ATH_BEACON_AIFS_DEFAULT 0 /* default aifs for ap beacon q */
|
||||
#define ATH_BEACON_CWMIN_DEFAULT 0 /* default cwmin for ap beacon q */
|
||||
#define ATH_BEACON_CWMAX_DEFAULT 0 /* default cwmax for ap beacon q */
|
||||
|
||||
/*
|
||||
* The key cache is used for h/w cipher state and also for
|
||||
* tracking station state such as the current tx antenna.
|
||||
|
Loading…
Reference in New Issue
Block a user