From 6865ea1cbd4baf025546ac34c65808fe3dadd9f4 Mon Sep 17 00:00:00 2001 From: sam Date: Thu, 19 Feb 2009 04:46:09 +0000 Subject: o consolidate loops to eliminate assumptions about ordering of modes o replace 0x80 by IEEE80211_RATE_MCS --- sys/net80211/ieee80211_proto.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'sys/net80211/ieee80211_proto.c') diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index b31d3af..3268624 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -182,22 +182,19 @@ ieee80211_proto_vattach(struct ieee80211vap *vap) * max retry count. These settings can be changed by the * driver and/or user applications. */ - for (i = IEEE80211_MODE_11A; i < IEEE80211_MODE_11NA; i++) { + for (i = IEEE80211_MODE_11A; i < IEEE80211_MODE_MAX; i++) { const struct ieee80211_rateset *rs = &ic->ic_sup_rates[i]; vap->iv_txparms[i].ucastrate = IEEE80211_FIXED_RATE_NONE; - /* NB: we default to min supported rate for channel */ - vap->iv_txparms[i].mgmtrate = - rs->rs_rates[0] & IEEE80211_RATE_VAL; - vap->iv_txparms[i].mcastrate = - rs->rs_rates[0] & IEEE80211_RATE_VAL; - vap->iv_txparms[i].maxretry = IEEE80211_TXMAX_DEFAULT; - } - for (; i < IEEE80211_MODE_MAX; i++) { - vap->iv_txparms[i].ucastrate = IEEE80211_FIXED_RATE_NONE; - /* NB: default to MCS 0 */ - vap->iv_txparms[i].mgmtrate = 0 | 0x80; - vap->iv_txparms[i].mcastrate = 0 | 0x80; + if (i == IEEE80211_MODE_11NA || i == IEEE80211_MODE_11NG) { + vap->iv_txparms[i].mgmtrate = 0 | IEEE80211_RATE_MCS; + vap->iv_txparms[i].mcastrate = 0 | IEEE80211_RATE_MCS; + } else { + vap->iv_txparms[i].mgmtrate = + rs->rs_rates[0] & IEEE80211_RATE_VAL; + vap->iv_txparms[i].mcastrate = + rs->rs_rates[0] & IEEE80211_RATE_VAL; + } vap->iv_txparms[i].maxretry = IEEE80211_TXMAX_DEFAULT; } vap->iv_roaming = IEEE80211_ROAMING_AUTO; -- cgit v1.1