diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-02-13 04:51:08 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-02-13 04:56:33 -0500 |
commit | a0497f9f57478c5a37c5628eb32833dd9729a821 (patch) | |
tree | ba36d9fd8aa48161af7d997ecefe360032c4171e /net/mac80211/rc80211_minstrel.c | |
parent | 6719429dd61cde1fe30d9644d0aa2369eefc9005 (diff) |
mac80211/minstrel_ht: add support for using CCK rates
When MCS rates start to get bad in 2.4 GHz because of long range or
strong interference, CCK rates can be a lot more robust.
This patch adds a pseudo MCS group containing CCK rates (long preamble
in the lower 4 slots, short preamble in the upper slots).
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
[make minstrel_ht_get_stats static]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/rc80211_minstrel.c')
-rw-r--r-- | net/mac80211/rc80211_minstrel.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c index 8c5acdc06226..eea45a2c7c35 100644 --- a/net/mac80211/rc80211_minstrel.c +++ b/net/mac80211/rc80211_minstrel.c | |||
@@ -494,6 +494,33 @@ minstrel_free_sta(void *priv, struct ieee80211_sta *sta, void *priv_sta) | |||
494 | kfree(mi); | 494 | kfree(mi); |
495 | } | 495 | } |
496 | 496 | ||
497 | static void | ||
498 | minstrel_init_cck_rates(struct minstrel_priv *mp) | ||
499 | { | ||
500 | static const int bitrates[4] = { 10, 20, 55, 110 }; | ||
501 | struct ieee80211_supported_band *sband; | ||
502 | int i, j; | ||
503 | |||
504 | sband = mp->hw->wiphy->bands[IEEE80211_BAND_2GHZ]; | ||
505 | if (!sband) | ||
506 | return; | ||
507 | |||
508 | for (i = 0, j = 0; i < sband->n_bitrates; i++) { | ||
509 | struct ieee80211_rate *rate = &sband->bitrates[i]; | ||
510 | |||
511 | if (rate->flags & IEEE80211_RATE_ERP_G) | ||
512 | continue; | ||
513 | |||
514 | for (j = 0; j < ARRAY_SIZE(bitrates); j++) { | ||
515 | if (rate->bitrate != bitrates[j]) | ||
516 | continue; | ||
517 | |||
518 | mp->cck_rates[j] = i; | ||
519 | break; | ||
520 | } | ||
521 | } | ||
522 | } | ||
523 | |||
497 | static void * | 524 | static void * |
498 | minstrel_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) | 525 | minstrel_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) |
499 | { | 526 | { |
@@ -539,6 +566,8 @@ minstrel_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) | |||
539 | S_IRUGO | S_IWUGO, debugfsdir, &mp->fixed_rate_idx); | 566 | S_IRUGO | S_IWUGO, debugfsdir, &mp->fixed_rate_idx); |
540 | #endif | 567 | #endif |
541 | 568 | ||
569 | minstrel_init_cck_rates(mp); | ||
570 | |||
542 | return mp; | 571 | return mp; |
543 | } | 572 | } |
544 | 573 | ||