Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ath/if_ath.c
Show First 20 Lines • Show All 4,166 Lines • ▼ Show 20 Lines | |||||
int | int | ||||
ath_tx_findrix(const struct ath_softc *sc, uint8_t rate) | ath_tx_findrix(const struct ath_softc *sc, uint8_t rate) | ||||
{ | { | ||||
int rix = sc->sc_rixmap[rate]; | int rix = sc->sc_rixmap[rate]; | ||||
/* NB: return lowest rix for invalid rate */ | /* NB: return lowest rix for invalid rate */ | ||||
return (rix == 0xff ? 0 : rix); | return (rix == 0xff ? 0 : rix); | ||||
} | } | ||||
/* | |||||
* The same as above, but takes rate index on input instead. | |||||
*/ | |||||
int | |||||
ath_tx_findrix_byidx(const struct ath_softc *sc, uint16_t rate_idx) | |||||
{ | |||||
const struct ieee80211_rate_t *rate; | |||||
rate = ieee80211_get_rate_safe(rate_idx); | |||||
if (!rate) | |||||
return (0); | |||||
return (ath_tx_findrix(sc, rate->value)); | |||||
} | |||||
static void | static void | ||||
ath_tx_update_stats(struct ath_softc *sc, struct ath_tx_status *ts, | ath_tx_update_stats(struct ath_softc *sc, struct ath_tx_status *ts, | ||||
struct ath_buf *bf) | struct ath_buf *bf) | ||||
{ | { | ||||
struct ieee80211_node *ni = bf->bf_node; | struct ieee80211_node *ni = bf->bf_node; | ||||
struct ieee80211com *ic = &sc->sc_ic; | struct ieee80211com *ic = &sc->sc_ic; | ||||
int sr, lr, pri; | int sr, lr, pri; | ||||
▲ Show 20 Lines • Show All 1,994 Lines • ▼ Show 20 Lines | |||||
* param tells us if this is the first time or not. | * param tells us if this is the first time or not. | ||||
*/ | */ | ||||
static void | static void | ||||
ath_newassoc(struct ieee80211_node *ni, int isnew) | ath_newassoc(struct ieee80211_node *ni, int isnew) | ||||
{ | { | ||||
struct ath_node *an = ATH_NODE(ni); | struct ath_node *an = ATH_NODE(ni); | ||||
struct ieee80211vap *vap = ni->ni_vap; | struct ieee80211vap *vap = ni->ni_vap; | ||||
struct ath_softc *sc = vap->iv_ic->ic_softc; | struct ath_softc *sc = vap->iv_ic->ic_softc; | ||||
const struct ieee80211_txparam *tp = ni->ni_txparms; | const struct ieee80211_txparam_vht *tp = ni->ni_txparms; | ||||
an->an_mcastrix = ath_tx_findrix(sc, tp->mcastrate); | an->an_mcastrix = ath_tx_findrix_byidx(sc, tp->mcastrate); | ||||
an->an_mgmtrix = ath_tx_findrix(sc, tp->mgmtrate); | an->an_mgmtrix = ath_tx_findrix_byidx(sc, tp->mgmtrate); | ||||
DPRINTF(sc, ATH_DEBUG_NODE, "%s: %6D: reassoc; isnew=%d, is_powersave=%d\n", | DPRINTF(sc, ATH_DEBUG_NODE, "%s: %6D: reassoc; isnew=%d, is_powersave=%d\n", | ||||
__func__, | __func__, | ||||
ni->ni_macaddr, | ni->ni_macaddr, | ||||
":", | ":", | ||||
isnew, | isnew, | ||||
an->an_is_powersave); | an->an_is_powersave); | ||||
▲ Show 20 Lines • Show All 810 Lines • Show Last 20 Lines |