wireless: set correct mandatory rate flags

According to IEEE Std 802.11-2016 (16.2.3.4 Long PHY SIGNAL field) all of
the following rates are mandatory for a HR/DSSS PHY: 1 Mb/s, 2 Mb/s,
5.5 Mb/s and 11 Mb/s. Set IEEE80211_RATE_MANDATORY_B flag for all of these
instead of just 1 Mb/s to correctly reflect this.

Signed-off-by: Richard Schütz <rschuetz@uni-koblenz.de>
[johannes: use switch statement]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Richard Schütz 2017-09-07 17:47:43 +02:00 committed by Johannes Berg
parent d405fd8cc8
commit 1bd773c077
1 changed files with 14 additions and 16 deletions

View File

@ -157,32 +157,30 @@ static void set_mandatory_flags_band(struct ieee80211_supported_band *sband)
case NL80211_BAND_2GHZ:
want = 7;
for (i = 0; i < sband->n_bitrates; i++) {
if (sband->bitrates[i].bitrate == 10) {
switch (sband->bitrates[i].bitrate) {
case 10:
case 20:
case 55:
case 110:
sband->bitrates[i].flags |=
IEEE80211_RATE_MANDATORY_B |
IEEE80211_RATE_MANDATORY_G;
want--;
}
if (sband->bitrates[i].bitrate == 20 ||
sband->bitrates[i].bitrate == 55 ||
sband->bitrates[i].bitrate == 110 ||
sband->bitrates[i].bitrate == 60 ||
sband->bitrates[i].bitrate == 120 ||
sband->bitrates[i].bitrate == 240) {
break;
case 60:
case 120:
case 240:
sband->bitrates[i].flags |=
IEEE80211_RATE_MANDATORY_G;
want--;
}
if (sband->bitrates[i].bitrate != 10 &&
sband->bitrates[i].bitrate != 20 &&
sband->bitrates[i].bitrate != 55 &&
sband->bitrates[i].bitrate != 110)
/* fall through */
default:
sband->bitrates[i].flags |=
IEEE80211_RATE_ERP_G;
break;
}
}
WARN_ON(want != 0 && want != 3 && want != 6);
WARN_ON(want != 0 && want != 3);
break;
case NL80211_BAND_60GHZ:
/* check for mandatory HT MCS 1..4 */