aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c32
1 files changed, 3 insertions, 29 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 976014c5e742..e5dda6fb8dff 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1406,8 +1406,6 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy,
1406 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 1406 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1407 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); 1407 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
1408 int i; 1408 int i;
1409 u32 target_rate;
1410 struct ieee80211_supported_band *sband;
1411 1409
1412 /* 1410 /*
1413 * This _could_ be supported by providing a hook for 1411 * This _could_ be supported by providing a hook for
@@ -1417,35 +1415,11 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy,
1417 if (local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) 1415 if (local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL)
1418 return -EOPNOTSUPP; 1416 return -EOPNOTSUPP;
1419 1417
1420 sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
1421
1422 /*
1423 * target_rate = -1, rate->fixed = 0 means auto only, so use all rates
1424 * target_rate = X, rate->fixed = 1 means only rate X
1425 * target_rate = X, rate->fixed = 0 means all rates <= X
1426 */
1427 sdata->max_ratectrl_rateidx = -1;
1428 sdata->force_unicast_rateidx = -1;
1429 1418
1430 if (mask->fixed) 1419 for (i = 0; i < IEEE80211_NUM_BANDS; i++)
1431 target_rate = mask->fixed / 100; 1420 sdata->rc_rateidx_mask[i] = mask->control[i].legacy;
1432 else if (mask->maxrate)
1433 target_rate = mask->maxrate / 100;
1434 else
1435 return 0;
1436 1421
1437 for (i = 0; i< sband->n_bitrates; i++) { 1422 return 0;
1438 if (target_rate != sband->bitrates[i].bitrate)
1439 continue;
1440
1441 /* requested bitrate found */
1442 sdata->max_ratectrl_rateidx = i;
1443 if (mask->fixed)
1444 sdata->force_unicast_rateidx = i;
1445 return 0;
1446 }
1447
1448 return -EINVAL;
1449} 1423}
1450 1424
1451static int ieee80211_remain_on_channel(struct wiphy *wiphy, 1425static int ieee80211_remain_on_channel(struct wiphy *wiphy,