aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-04-16 07:38:42 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-04-16 17:42:29 -0400
commit2ffbe6d333664a089f17b13aa79eefe38f794bb7 (patch)
tree29927d762aff0f9d8a8eea57784fb0067fb58ca7 /net/mac80211/cfg.c
parentdad6330d034a24a22008ee28b8ec447cbb0961c9 (diff)
mac80211: fix and optimize MCS mask handling
Currently the code always copies the configured MCS mask (even if it is set to default), but only uses it if legacy rates were also masked out. Fix this by adding a flag that tracks whether the configured MCS mask is set to default or not. Optimize the code further by storing a pointer to the configured rate mask in txrc instead of using memcpy. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index fdd95bd751a1..72ab1c0e3ca7 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2417,9 +2417,22 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy,
2417 } 2417 }
2418 2418
2419 for (i = 0; i < IEEE80211_NUM_BANDS; i++) { 2419 for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
2420 struct ieee80211_supported_band *sband = wiphy->bands[i];
2421 int j;
2422
2420 sdata->rc_rateidx_mask[i] = mask->control[i].legacy; 2423 sdata->rc_rateidx_mask[i] = mask->control[i].legacy;
2421 memcpy(sdata->rc_rateidx_mcs_mask[i], mask->control[i].mcs, 2424 memcpy(sdata->rc_rateidx_mcs_mask[i], mask->control[i].mcs,
2422 sizeof(mask->control[i].mcs)); 2425 sizeof(mask->control[i].mcs));
2426
2427 sdata->rc_has_mcs_mask[i] = false;
2428 if (!sband)
2429 continue;
2430
2431 for (j = 0; j < IEEE80211_HT_MCS_MASK_LEN; j++)
2432 if (~sdata->rc_rateidx_mcs_mask[i][j]) {
2433 sdata->rc_has_mcs_mask[i] = true;
2434 break;
2435 }
2423 } 2436 }
2424 2437
2425 return 0; 2438 return 0;