diff options
author | Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de> | 2013-07-08 10:55:54 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-07-16 02:58:07 -0400 |
commit | 74608aca4d82e2855b1a6a2cd60331d1a98f2d6a (patch) | |
tree | 43fdcc2e5cfa602c37bdd196cd583b10551c52ff /net/wireless/util.c | |
parent | 2103dec14792be2c2194a454630b01120d30e5cb (diff) |
cfg80211/mac80211: get mandatory rates based on scan width
Mandatory rates for 5 and 10 MHz are different from the rates used for
20 MHz in 2.4 GHz mode, as they use OFDM only.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Diffstat (limited to 'net/wireless/util.c')
-rw-r--r-- | net/wireless/util.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/net/wireless/util.c b/net/wireless/util.c index 74458b7f61eb..ce090c1c5e4f 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c | |||
@@ -33,7 +33,8 @@ ieee80211_get_response_rate(struct ieee80211_supported_band *sband, | |||
33 | } | 33 | } |
34 | EXPORT_SYMBOL(ieee80211_get_response_rate); | 34 | EXPORT_SYMBOL(ieee80211_get_response_rate); |
35 | 35 | ||
36 | u32 ieee80211_mandatory_rates(struct ieee80211_supported_band *sband) | 36 | u32 ieee80211_mandatory_rates(struct ieee80211_supported_band *sband, |
37 | enum nl80211_bss_scan_width scan_width) | ||
37 | { | 38 | { |
38 | struct ieee80211_rate *bitrates; | 39 | struct ieee80211_rate *bitrates; |
39 | u32 mandatory_rates = 0; | 40 | u32 mandatory_rates = 0; |
@@ -43,10 +44,15 @@ u32 ieee80211_mandatory_rates(struct ieee80211_supported_band *sband) | |||
43 | if (WARN_ON(!sband)) | 44 | if (WARN_ON(!sband)) |
44 | return 1; | 45 | return 1; |
45 | 46 | ||
46 | if (sband->band == IEEE80211_BAND_2GHZ) | 47 | if (sband->band == IEEE80211_BAND_2GHZ) { |
47 | mandatory_flag = IEEE80211_RATE_MANDATORY_B; | 48 | if (scan_width == NL80211_BSS_CHAN_WIDTH_5 || |
48 | else | 49 | scan_width == NL80211_BSS_CHAN_WIDTH_10) |
50 | mandatory_flag = IEEE80211_RATE_MANDATORY_G; | ||
51 | else | ||
52 | mandatory_flag = IEEE80211_RATE_MANDATORY_B; | ||
53 | } else { | ||
49 | mandatory_flag = IEEE80211_RATE_MANDATORY_A; | 54 | mandatory_flag = IEEE80211_RATE_MANDATORY_A; |
55 | } | ||
50 | 56 | ||
51 | bitrates = sband->bitrates; | 57 | bitrates = sband->bitrates; |
52 | for (i = 0; i < sband->n_bitrates; i++) | 58 | for (i = 0; i < sband->n_bitrates; i++) |