summaryrefslogtreecommitdiffstats
path: root/sys/dev/ral
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2013-07-04 21:16:49 +0000
committeradrian <adrian@FreeBSD.org>2013-07-04 21:16:49 +0000
commit1724725351eecf54f5bef13e26ebaf0bfe28fd50 (patch)
tree86ccd407ab7baf589b507d268c141171983167c7 /sys/dev/ral
parent083dd1de651813c2c5b040ffe3cba771aa583df1 (diff)
downloadFreeBSD-src-1724725351eecf54f5bef13e26ebaf0bfe28fd50.zip
FreeBSD-src-1724725351eecf54f5bef13e26ebaf0bfe28fd50.tar.gz
Implement basic 802.11n awareness in the PHY and AMRR rate control code.
* Add 802.11n 2ghz and 5ghz tables, including legacy rates and up to MCS23 rates (3x3.) * Populate the rate code -> rate index lookup table with MCS _and_ normal rates, but _not_ the basic rate flag. Since the basic rate flag is the same as the MCS flag, we can only use one. * Introduce some accessor inlines that do PLCP and rate table lookup/access and enforce that it doesn't set the basic rate bit. They're not designed for MCS rates, so it will panic. * Start converting drivers that use the rate table stuff to use the accessor inlines and strip the basic flag. * Teach AMRR about basic 11n - it's still as crap for MCS as it is being used by iwn, so it's not a step _backwardS_. * Convert iwn over to accept 11n MCS rates rather than 'translate' legacy to MCS rates. It doesn't use a lookup table any longer; instead it's a function which takes the current node (for HT parameters) and the rate code, and returns the hardware PLCP code to use. Tested: * ath - it's a no-op, and it works that way * iwn - both 11n and non-11n
Diffstat (limited to 'sys/dev/ral')
-rw-r--r--sys/dev/ral/rt2560.c2
-rw-r--r--sys/dev/ral/rt2661.c2
-rw-r--r--sys/dev/ral/rt2860.c7
3 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/ral/rt2560.c b/sys/dev/ral/rt2560.c
index c67f1f7..7c1b9de 100644
--- a/sys/dev/ral/rt2560.c
+++ b/sys/dev/ral/rt2560.c
@@ -2370,7 +2370,7 @@ rt2560_set_basicrates(struct rt2560_softc *sc,
if (!(rate & IEEE80211_RATE_BASIC))
continue;
- mask |= 1 << ic->ic_rt->rateCodeToIndex[RV(rate)];
+ mask |= 1 << ieee80211_legacy_rate_lookup(ic->ic_rt, RV(rate));
}
RAL_WRITE(sc, RT2560_ARSP_PLCP_1, mask);
diff --git a/sys/dev/ral/rt2661.c b/sys/dev/ral/rt2661.c
index 8ae2515..70c30f1 100644
--- a/sys/dev/ral/rt2661.c
+++ b/sys/dev/ral/rt2661.c
@@ -1923,7 +1923,7 @@ rt2661_set_basicrates(struct rt2661_softc *sc,
if (!(rate & IEEE80211_RATE_BASIC))
continue;
- mask |= 1 << ic->ic_rt->rateCodeToIndex[RV(rate)];
+ mask |= 1 << ieee80211_legacy_rate_lookup(ic->ic_rt, RV(rate));
}
RAL_WRITE(sc, RT2661_TXRX_CSR5, mask);
diff --git a/sys/dev/ral/rt2860.c b/sys/dev/ral/rt2860.c
index 4207d75..3bdd01d 100644
--- a/sys/dev/ral/rt2860.c
+++ b/sys/dev/ral/rt2860.c
@@ -1528,7 +1528,7 @@ rt2860_tx(struct rt2860_softc *sc, struct mbuf *m, struct ieee80211_node *ni)
tid = 0;
}
ring = &sc->txq[qid];
- ridx = ic->ic_rt->rateCodeToIndex[rate];
+ ridx = ieee80211_legacy_rate_lookup(ic->ic_rt, rate);
/* get MCS code from rate index */
mcs = rt2860_rates[ridx].mcs;
@@ -1779,7 +1779,8 @@ rt2860_tx_raw(struct rt2860_softc *sc, struct mbuf *m,
/* Choose a TX rate index. */
rate = params->ibp_rate0;
- ridx = ic->ic_rt->rateCodeToIndex[rate];
+ ridx = ieee80211_legacy_rate_lookup(ic->ic_rt,
+ rate & IEEE80211_RATE_VAL);
if (ridx == (uint8_t)-1) {
/* XXX fall back to mcast/mgmt rate? */
m_freem(m);
@@ -2311,7 +2312,7 @@ rt2860_set_basicrates(struct rt2860_softc *sc,
if (!(rate & IEEE80211_RATE_BASIC))
continue;
- mask |= 1 << ic->ic_rt->rateCodeToIndex[RV(rate)];
+ mask |= 1 << ieee80211_legacy_rate_lookup(ic->ic_rt, RV(rate));
}
RAL_WRITE(sc, RT2860_LEGACY_BASIC_RATE, mask);
OpenPOWER on IntegriCloud