diff options
author | sam <sam@FreeBSD.org> | 2005-06-07 00:12:40 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2005-06-07 00:12:40 +0000 |
commit | 8e259ce3edbd12a8f54c5f71af4ac0d5e6bb66b1 (patch) | |
tree | f453b72861ef9a332b030bc1fc4dbb6919fa7c6d /sys/dev/ath | |
parent | 24d4beb3125f1ce03c160786e02a7f5e0264ca61 (diff) | |
download | FreeBSD-src-8e259ce3edbd12a8f54c5f71af4ac0d5e6bb66b1.zip FreeBSD-src-8e259ce3edbd12a8f54c5f71af4ac0d5e6bb66b1.tar.gz |
Set the correct IFS parameters for the beacon tx queue
when operating in ap and adhoc modes.
Diffstat (limited to 'sys/dev/ath')
-rw-r--r-- | sys/dev/ath/if_ath.c | 46 | ||||
-rw-r--r-- | sys/dev/ath/if_athvar.h | 4 |
2 files changed, 49 insertions, 1 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index a8a54b7..41d58a9 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -1721,11 +1721,53 @@ 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. */ static int @@ -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; diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h index 26faa83..6980291 100644 --- a/sys/dev/ath/if_athvar.h +++ b/sys/dev/ath/if_athvar.h @@ -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. |