Add a new method to the rate control modules which extract out the

three other rates and try counts.

The 11n rate scenario path wants to take a list of rate and tries,
rather than calling setupxtxdesc().
This commit is contained in:
Adrian Chadd 2011-02-01 08:10:18 +00:00
parent 4b44f6f275
commit 710c377821
4 changed files with 77 additions and 0 deletions

View File

@ -114,6 +114,30 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_node *an,
*txrate = amn->amn_tx_rate0;
}
/*
* Get the TX rates.
*
* The short preamble bits aren't set here; the caller should augment
* the returned rate with the relevant preamble rate flag.
*/
void
ath_rate_getxtxrates(struct ath_softc *sc, struct ath_node *an,
uint8_t rix0, uint8_t *rix, uint8_t *try)
{
struct amrr_node *amn = ATH_NODE_AMRR(an);
/* rix[0] = amn->amn_tx_rate0; */
rix[1] = amn->amn_tx_rate1;
rix[2] = amn->amn_tx_rate2;
rix[3] = amn->amn_tx_rate3;
try[0] = amn->amn_tx_try0;
try[1] = amn->amn_tx_try1;
try[2] = amn->amn_tx_try2;
try[3] = amn->amn_tx_try3;
}
void
ath_rate_setupxtxdesc(struct ath_softc *sc, struct ath_node *an,
struct ath_desc *ds, int shortPreamble, u_int8_t rix)

View File

@ -122,6 +122,29 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_node *an,
*txrate = on->on_tx_rate0;
}
/*
* Get the TX rates.
*
* The short preamble bits aren't set here; the caller should augment
* the returned rate with the relevant preamble rate flag.
*/
void
ath_rate_getxtxrates(struct ath_softc *sc, struct ath_node *an,
uint8_t rix0, uint8_t *rix, uint8_t *try)
{
struct onoe_node *on = ATH_NODE_ONOE(an);
/* rix[0] = on->on_tx_rate0; */
rix[1] = on->on_tx_rate1;
rix[2] = on->on_tx_rate2;
rix[3] = on->on_tx_rate3;
try[0] = on->on_tx_try0;
try[1] = 2;
try[2] = 2;
try[3] = 2;
}
void
ath_rate_setupxtxdesc(struct ath_softc *sc, struct ath_node *an,
struct ath_desc *ds, int shortPreamble, u_int8_t rix)

View File

@ -363,6 +363,30 @@ done:
#undef RATE
}
/*
* Get the TX rates. Don't fiddle with short preamble flags for them;
* the caller can do that.
*/
void
ath_rate_getxtxrates(struct ath_softc *sc, struct ath_node *an,
uint8_t rix0, uint8_t *rix, uint8_t *try)
{
struct sample_node *sn = ATH_NODE_SAMPLE(an);
const struct txschedule *sched = &sn->sched[rix0];
KASSERT(rix0 == sched->r0, ("rix0 (%x) != sched->r0 (%x)!\n", rix0, sched->r0));
/* rix[0] = sched->r0; */
rix[1] = sched->r1;
rix[2] = sched->r2;
rix[3] = sched->r3;
try[0] = sched->t0;
try[1] = sched->t1;
try[2] = sched->t2;
try[3] = sched->t3;
}
void
ath_rate_setupxtxdesc(struct ath_softc *sc, struct ath_node *an,
struct ath_desc *ds, int shortPreamble, u_int8_t rix)

View File

@ -101,6 +101,12 @@ void ath_rate_newassoc(struct ath_softc *, struct ath_node *,
/*
* Transmit handling.
*/
/*
* Return the four TX rate index and try counts for the current data packet.
*/
void ath_rate_getxtxrates(struct ath_softc *sc, struct ath_node *an,
uint8_t rix0, uint8_t *rix, uint8_t *try);
/*
* Return the transmit info for a data packet. If multi-rate state
* is to be setup then try0 should contain a value other than ATH_TXMATRY