summaryrefslogtreecommitdiffstats
path: root/sys/dev/ath
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2003-08-19 21:24:16 +0000
committersam <sam@FreeBSD.org>2003-08-19 21:24:16 +0000
commitcd6c255bc51f7b71eeb00ea9019b80f87332d99c (patch)
tree9816499daec1e86e9510df70f7690c3d8506d322 /sys/dev/ath
parent895f841f53a195064dd3cf17710e9e3fcc522bb0 (diff)
downloadFreeBSD-src-cd6c255bc51f7b71eeb00ea9019b80f87332d99c.zip
FreeBSD-src-cd6c255bc51f7b71eeb00ea9019b80f87332d99c.tar.gz
maintain a table for mapping hardware rate codes to 802.11 rates for
calculating the rate for each rx'd frame
Diffstat (limited to 'sys/dev/ath')
-rw-r--r--sys/dev/ath/if_ath.c8
-rw-r--r--sys/dev/ath/if_athvar.h1
2 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index 9d07c7c..df63be8 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -1521,10 +1521,9 @@ ath_rx_proc(void *arg, int npending)
m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = m->m_len = len;
if (IFF_DUMPPKTS(ifp)) {
- struct ieee80211com *ic = &sc->sc_ic;
- const HAL_RATE_TABLE *rt = sc->sc_rates[ic->ic_curmode];
ieee80211_dump_pkt(mtod(m, u_int8_t *), len,
- rt ? rt->info[rt->rateCodeToIndex[ds->ds_rxstat.rs_rate]].dot11Rate & IEEE80211_RATE_VAL : 0,
+ sc->sc_hwmap[ds->ds_rxstat.rs_rate] &
+ IEEE80211_RATE_VAL,
ds->ds_rxstat.rs_rssi);
}
m_adj(m, -IEEE80211_CRC_LEN);
@@ -2393,6 +2392,9 @@ ath_setcurmode(struct ath_softc *sc, enum ieee80211_phymode mode)
KASSERT(rt != NULL, ("no h/w rate set for phy mode %u", mode));
for (i = 0; i < rt->rateCount; i++)
sc->sc_rixmap[rt->info[i].dot11Rate & IEEE80211_RATE_VAL] = i;
+ memset(sc->sc_hwmap, 0, sizeof(sc->sc_hwmap));
+ for (i = 0; i < 32; i++)
+ sc->sc_hwmap[i] = rt->info[rt->rateCodeToIndex[i]].dot11Rate;
sc->sc_currates = rt;
sc->sc_curmode = mode;
}
diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h
index ea27809..dac204a 100644
--- a/sys/dev/ath/if_athvar.h
+++ b/sys/dev/ath/if_athvar.h
@@ -95,6 +95,7 @@ struct ath_softc {
const HAL_RATE_TABLE *sc_currates; /* current rate table */
enum ieee80211_phymode sc_curmode; /* current phy mode */
u_int8_t sc_rixmap[256]; /* IEEE to h/w rate table ix */
+ u_int8_t sc_hwmap[32]; /* h/w rate ix to IEEE table */
HAL_INT sc_imask; /* interrupt mask copy */
struct ath_desc *sc_desc; /* TX/RX descriptors */
OpenPOWER on IntegriCloud