Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ath/if_ath_beacon.c
Show First 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Setup the transmit queue parameters for the beacon queue. | * Setup the transmit queue parameters for the beacon queue. | ||||
*/ | */ | ||||
int | int | ||||
ath_beaconq_config(struct ath_softc *sc) | ath_beaconq_config(struct ath_softc *sc) | ||||
{ | { | ||||
#define ATH_EXPONENT_TO_VALUE(v) ((1<<(v))-1) | #define ATH_EXPONENT_TO_VALUE(v) ((1<<(v))-1) | ||||
struct ieee80211com *ic = sc->sc_ifp->if_l2com; | struct ieee80211com *ic = &sc->sc_ic; | ||||
struct ath_hal *ah = sc->sc_ah; | struct ath_hal *ah = sc->sc_ah; | ||||
HAL_TXQ_INFO qi; | HAL_TXQ_INFO qi; | ||||
ath_hal_gettxqueueprops(ah, sc->sc_bhalq, &qi); | ath_hal_gettxqueueprops(ah, sc->sc_bhalq, &qi); | ||||
if (ic->ic_opmode == IEEE80211_M_HOSTAP || | if (ic->ic_opmode == IEEE80211_M_HOSTAP || | ||||
ic->ic_opmode == IEEE80211_M_MBSS) { | ic->ic_opmode == IEEE80211_M_MBSS) { | ||||
/* | /* | ||||
* Always burst out beacon and CAB traffic. | * Always burst out beacon and CAB traffic. | ||||
▲ Show 20 Lines • Show All 313 Lines • ▼ Show 20 Lines | if (sc->sc_bmisscount != 0) { | ||||
sc->sc_bmisscount = 0; | sc->sc_bmisscount = 0; | ||||
#ifdef ATH_DEBUG_ALQ | #ifdef ATH_DEBUG_ALQ | ||||
if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_RESUME_BEACON)) | if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_RESUME_BEACON)) | ||||
if_ath_alq_post(&sc->sc_alq, ATH_ALQ_RESUME_BEACON, 0, NULL); | if_ath_alq_post(&sc->sc_alq, ATH_ALQ_RESUME_BEACON, 0, NULL); | ||||
#endif | #endif | ||||
} | } | ||||
if (sc->sc_stagbeacons) { /* staggered beacons */ | if (sc->sc_stagbeacons) { /* staggered beacons */ | ||||
struct ieee80211com *ic = sc->sc_ifp->if_l2com; | struct ieee80211com *ic = &sc->sc_ic; | ||||
uint32_t tsftu; | uint32_t tsftu; | ||||
tsftu = ath_hal_gettsf32(ah) >> 10; | tsftu = ath_hal_gettsf32(ah) >> 10; | ||||
/* XXX lintval */ | /* XXX lintval */ | ||||
slot = ((tsftu % ic->ic_lintval) * ATH_BCBUF) / ic->ic_lintval; | slot = ((tsftu % ic->ic_lintval) * ATH_BCBUF) / ic->ic_lintval; | ||||
vap = sc->sc_bslot[(slot+1) % ATH_BCBUF]; | vap = sc->sc_bslot[(slot+1) % ATH_BCBUF]; | ||||
bfaddr = 0; | bfaddr = 0; | ||||
if (vap != NULL && vap->iv_state >= IEEE80211_S_RUN) { | if (vap != NULL && vap->iv_state >= IEEE80211_S_RUN) { | ||||
▲ Show 20 Lines • Show All 436 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
void | void | ||||
ath_beacon_config(struct ath_softc *sc, struct ieee80211vap *vap) | ath_beacon_config(struct ath_softc *sc, struct ieee80211vap *vap) | ||||
{ | { | ||||
#define TSF_TO_TU(_h,_l) \ | #define TSF_TO_TU(_h,_l) \ | ||||
((((u_int32_t)(_h)) << 22) | (((u_int32_t)(_l)) >> 10)) | ((((u_int32_t)(_h)) << 22) | (((u_int32_t)(_l)) >> 10)) | ||||
#define FUDGE 2 | #define FUDGE 2 | ||||
struct ath_hal *ah = sc->sc_ah; | struct ath_hal *ah = sc->sc_ah; | ||||
struct ieee80211com *ic = sc->sc_ifp->if_l2com; | struct ieee80211com *ic = &sc->sc_ic; | ||||
struct ieee80211_node *ni; | struct ieee80211_node *ni; | ||||
u_int32_t nexttbtt, intval, tsftu; | u_int32_t nexttbtt, intval, tsftu; | ||||
u_int32_t nexttbtt_u8, intval_u8; | u_int32_t nexttbtt_u8, intval_u8; | ||||
u_int64_t tsf, tsf_beacon; | u_int64_t tsf, tsf_beacon; | ||||
if (vap == NULL) | if (vap == NULL) | ||||
vap = TAILQ_FIRST(&ic->ic_vaps); /* XXX */ | vap = TAILQ_FIRST(&ic->ic_vaps); /* XXX */ | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 260 Lines • Show Last 20 Lines |