From 40432d369a8536714fc11f3e91b6f19bdc29cfcf Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Thu, 19 Feb 2009 04:33:36 +0000 Subject: [PATCH] instead of special casing lookups for the 11na/g legacy rate set, just install the rates once when creating the com structure --- sys/net80211/ieee80211.c | 9 +++------ sys/net80211/ieee80211_ioctl.c | 3 +-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index 6de00aec5c8c..0a1c256e9356 100644 --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -185,6 +185,8 @@ ieee80211_chan_init(struct ieee80211com *ic) DEFAULTRATES(IEEE80211_MODE_TURBO_A, ieee80211_rateset_11a); DEFAULTRATES(IEEE80211_MODE_TURBO_G, ieee80211_rateset_11g); DEFAULTRATES(IEEE80211_MODE_STURBO_A, ieee80211_rateset_11a); + DEFAULTRATES(IEEE80211_MODE_11NA, ieee80211_rateset_11a); + DEFAULTRATES(IEEE80211_MODE_11NG, ieee80211_rateset_11g); /* * Set auto mode to reset active channel state and any desired channel. @@ -1011,12 +1013,7 @@ ieee80211_get_suprates(struct ieee80211com *ic, const struct ieee80211_channel * return &ieee80211_rateset_half; if (IEEE80211_IS_CHAN_QUARTER(c)) return &ieee80211_rateset_quarter; - if (IEEE80211_IS_CHAN_HTA(c)) - return &ic->ic_sup_rates[IEEE80211_MODE_11A]; - if (IEEE80211_IS_CHAN_HTG(c)) { - /* XXX does this work for basic rates? */ - return &ic->ic_sup_rates[IEEE80211_MODE_11G]; - } + /* XXX does this work for 11ng basic rates? */ return &ic->ic_sup_rates[ieee80211_chan2mode(c)]; } diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index 7f7417ece6cb..10f3c729cb03 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -2121,8 +2121,7 @@ ieee80211_ioctl_settxparams(struct ieee80211vap *vap, continue; src = &parms.params[i]; dst = &vap->iv_txparms[i]; - rs = &ic->ic_sup_rates[i == IEEE80211_MODE_11NA ? - IEEE80211_MODE_11A : IEEE80211_MODE_11G]; + rs = &ic->ic_sup_rates[i]; if (src->ucastrate != dst->ucastrate) { if (!checkmcs(src->ucastrate) && !checkrate(rs, src->ucastrate))