diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-09-10 18:01:57 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-15 16:48:22 -0400 |
commit | 96dd22ac06b0dbfb069fdf530c72046a941e9694 (patch) | |
tree | 4dbf19921a1d4add0ca03a0ff1d7db37c4ecb8be /net/mac80211/util.c | |
parent | ccd7b36286f8c42b3fa95c5a8d402162ffab41df (diff) |
mac80211: inform driver of basic rateset
Drivers need to know the basic rateset to be able to configure
the ACK/CTS programming in hardware correctly.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r-- | net/mac80211/util.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index a7968df9dac..d6aca91e612 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -640,3 +640,31 @@ int ieee80211_set_freq(struct ieee80211_sub_if_data *sdata, int freqMHz) | |||
640 | 640 | ||
641 | return ret; | 641 | return ret; |
642 | } | 642 | } |
643 | |||
644 | u64 ieee80211_mandatory_rates(struct ieee80211_local *local, | ||
645 | enum ieee80211_band band) | ||
646 | { | ||
647 | struct ieee80211_supported_band *sband; | ||
648 | struct ieee80211_rate *bitrates; | ||
649 | u64 mandatory_rates; | ||
650 | enum ieee80211_rate_flags mandatory_flag; | ||
651 | int i; | ||
652 | |||
653 | sband = local->hw.wiphy->bands[band]; | ||
654 | if (!sband) { | ||
655 | WARN_ON(1); | ||
656 | sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; | ||
657 | } | ||
658 | |||
659 | if (band == IEEE80211_BAND_2GHZ) | ||
660 | mandatory_flag = IEEE80211_RATE_MANDATORY_B; | ||
661 | else | ||
662 | mandatory_flag = IEEE80211_RATE_MANDATORY_A; | ||
663 | |||
664 | bitrates = sband->bitrates; | ||
665 | mandatory_rates = 0; | ||
666 | for (i = 0; i < sband->n_bitrates; i++) | ||
667 | if (bitrates[i].flags & mandatory_flag) | ||
668 | mandatory_rates |= BIT(i); | ||
669 | return mandatory_rates; | ||
670 | } | ||