o add IEEE80211_RATE_MCS to use instead of naked constant (for marking MCS)
o correct ieee80211_rate2media handling of MCS o correct rate HT announcements for 11n devices Approved by: re (blanket wireless)
This commit is contained in:
parent
b337fbc435
commit
f0ee92d585
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=172226
@ -288,6 +288,8 @@ struct ieee80211_htrateset {
|
||||
uint8_t rs_rates[IEEE80211_HTRATE_MAXSIZE];
|
||||
};
|
||||
|
||||
#define IEEE80211_RATE_MCS 0x80
|
||||
|
||||
/*
|
||||
* Roaming state visible to user space. There are two
|
||||
* thresholds that control whether roaming is considered;
|
||||
|
@ -1119,14 +1119,16 @@ ieee80211_rate2media(struct ieee80211com *ic, int rate, enum ieee80211_phymode m
|
||||
* Check 11n rates first for match as an MCS.
|
||||
*/
|
||||
if (mode == IEEE80211_MODE_11NA) {
|
||||
if ((rate & IEEE80211_RATE_BASIC) == 0) {
|
||||
if (rate & IEEE80211_RATE_MCS) {
|
||||
rate &= ~IEEE80211_RATE_MCS;
|
||||
m = findmedia(htrates, N(htrates), rate);
|
||||
if (m != IFM_AUTO)
|
||||
return m | IFM_IEEE80211_11NA;
|
||||
}
|
||||
} else if (mode == IEEE80211_MODE_11NG) {
|
||||
/* NB: 12 is ambiguous, it will be treated as an MCS */
|
||||
if ((rate & IEEE80211_RATE_BASIC) == 0) {
|
||||
if (rate & IEEE80211_RATE_MCS) {
|
||||
rate &= ~IEEE80211_RATE_MCS;
|
||||
m = findmedia(htrates, N(htrates), rate);
|
||||
if (m != IFM_AUTO)
|
||||
return m | IFM_IEEE80211_11NG;
|
||||
|
@ -155,7 +155,8 @@ ht_announce(struct ieee80211com *ic, int mode,
|
||||
|
||||
if_printf(ifp, "%s MCS: ", ieee80211_phymode_name[mode]);
|
||||
for (i = 0; i < rs->rs_nrates; i++) {
|
||||
mword = ieee80211_rate2media(ic, rs->rs_rates[i], mode);
|
||||
mword = ieee80211_rate2media(ic,
|
||||
rs->rs_rates[i] | IEEE80211_RATE_MCS, mode);
|
||||
if (IFM_SUBTYPE(mword) != IFM_IEEE80211_MCS)
|
||||
continue;
|
||||
rate = ieee80211_htrates[rs->rs_rates[i]];
|
||||
|
Loading…
Reference in New Issue
Block a user