While determining the maxrate for ieee80211_media_setup() honor

the device capabilities.
This commit is contained in:
Bernhard Schmidt 2011-03-13 11:47:43 +00:00
parent bffb67e30f
commit 6f897ba9dd

View File

@ -1076,10 +1076,18 @@ ieee80211_media_setup(struct ieee80211com *ic,
isset(ic->ic_modecaps, IEEE80211_MODE_11NG)) {
addmedia(media, caps, addsta,
IEEE80211_MODE_AUTO, IFM_IEEE80211_MCS);
/* XXX could walk htrates */
/* XXX known array size */
if (ieee80211_htrates[15].ht40_rate_400ns > maxrate)
maxrate = ieee80211_htrates[15].ht40_rate_400ns;
i = ic->ic_txstream * 8 - 1;
if ((ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) &&
(ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI40))
rate = ieee80211_htrates[i].ht40_rate_400ns;
else if ((ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40))
rate = ieee80211_htrates[i].ht40_rate_800ns;
else if ((ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI20))
rate = ieee80211_htrates[i].ht20_rate_400ns;
else
rate = ieee80211_htrates[i].ht20_rate_800ns;
if (rate > maxrate)
maxrate = rate;
}
return maxrate;
}