Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ath/ath_rate/sample/sample.c
Show First 20 Lines • Show All 482 Lines • ▼ Show 20 Lines | ath_rate_findrate(struct ath_softc *sc, struct ath_node *an, | ||||
int shortPreamble, size_t frameLen, | int shortPreamble, size_t frameLen, | ||||
u_int8_t *rix0, int *try0, u_int8_t *txrate) | u_int8_t *rix0, int *try0, u_int8_t *txrate) | ||||
{ | { | ||||
#define DOT11RATE(ix) (rt->info[ix].dot11Rate & IEEE80211_RATE_VAL) | #define DOT11RATE(ix) (rt->info[ix].dot11Rate & IEEE80211_RATE_VAL) | ||||
#define MCS(ix) (rt->info[ix].dot11Rate | IEEE80211_RATE_MCS) | #define MCS(ix) (rt->info[ix].dot11Rate | IEEE80211_RATE_MCS) | ||||
#define RATE(ix) (DOT11RATE(ix) / 2) | #define RATE(ix) (DOT11RATE(ix) / 2) | ||||
struct sample_node *sn = ATH_NODE_SAMPLE(an); | struct sample_node *sn = ATH_NODE_SAMPLE(an); | ||||
struct sample_softc *ssc = ATH_SOFTC_SAMPLE(sc); | struct sample_softc *ssc = ATH_SOFTC_SAMPLE(sc); | ||||
struct ifnet *ifp = sc->sc_ifp; | struct ieee80211com *ic = &sc->sc_ic; | ||||
struct ieee80211com *ic = ifp->if_l2com; | |||||
const HAL_RATE_TABLE *rt = sc->sc_currates; | const HAL_RATE_TABLE *rt = sc->sc_currates; | ||||
const int size_bin = size_to_bin(frameLen); | const int size_bin = size_to_bin(frameLen); | ||||
int rix, mrr, best_rix, change_rates; | int rix, mrr, best_rix, change_rates; | ||||
unsigned average_tx_time; | unsigned average_tx_time; | ||||
ath_rate_update_static_rix(sc, &an->an_node); | ath_rate_update_static_rix(sc, &an->an_node); | ||||
if (sn->currates != sc->sc_currates) { | if (sn->currates != sc->sc_currates) { | ||||
▲ Show 20 Lines • Show All 350 Lines • ▼ Show 20 Lines | device_printf(sc->sc_dev, | ||||
series, hwrate, tries, status); | series, hwrate, tries, status); | ||||
} | } | ||||
void | void | ||||
ath_rate_tx_complete(struct ath_softc *sc, struct ath_node *an, | ath_rate_tx_complete(struct ath_softc *sc, struct ath_node *an, | ||||
const struct ath_rc_series *rc, const struct ath_tx_status *ts, | const struct ath_rc_series *rc, const struct ath_tx_status *ts, | ||||
int frame_size, int nframes, int nbad) | int frame_size, int nframes, int nbad) | ||||
{ | { | ||||
struct ifnet *ifp = sc->sc_ifp; | struct ieee80211com *ic = &sc->sc_ic; | ||||
struct ieee80211com *ic = ifp->if_l2com; | |||||
struct sample_node *sn = ATH_NODE_SAMPLE(an); | struct sample_node *sn = ATH_NODE_SAMPLE(an); | ||||
int final_rix, short_tries, long_tries; | int final_rix, short_tries, long_tries; | ||||
const HAL_RATE_TABLE *rt = sc->sc_currates; | const HAL_RATE_TABLE *rt = sc->sc_currates; | ||||
int status = ts->ts_status; | int status = ts->ts_status; | ||||
int mrr; | int mrr; | ||||
final_rix = rt->rateCodeToIndex[ts->ts_rate]; | final_rix = rt->rateCodeToIndex[ts->ts_rate]; | ||||
short_tries = ts->ts_shortretry; | short_tries = ts->ts_shortretry; | ||||
▲ Show 20 Lines • Show All 429 Lines • ▼ Show 20 Lines | for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) { | ||||
} | } | ||||
} | } | ||||
} | } | ||||
static int | static int | ||||
ath_rate_sysctl_stats(SYSCTL_HANDLER_ARGS) | ath_rate_sysctl_stats(SYSCTL_HANDLER_ARGS) | ||||
{ | { | ||||
struct ath_softc *sc = arg1; | struct ath_softc *sc = arg1; | ||||
struct ifnet *ifp = sc->sc_ifp; | struct ieee80211com *ic = &sc->sc_ic; | ||||
struct ieee80211com *ic = ifp->if_l2com; | |||||
int error, v; | int error, v; | ||||
v = 0; | v = 0; | ||||
error = sysctl_handle_int(oidp, &v, 0, req); | error = sysctl_handle_int(oidp, &v, 0, req); | ||||
if (error || !req->newptr) | if (error || !req->newptr) | ||||
return error; | return error; | ||||
ieee80211_iterate_nodes(&ic->ic_sta, sample_stats, sc); | ieee80211_iterate_nodes(&ic->ic_sta, sample_stats, sc); | ||||
return 0; | return 0; | ||||
▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines |