Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 183308
b: refs/heads/master
c: 2c7e6bc
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Dec 22, 2009
1 parent 936e94d commit 2ef4496
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d80050c4c321a74cea28c6ef9695d8427a928417
refs/heads/master: 2c7e6bc9ac7cb518cf037495932d80f71a1596f2
36 changes: 22 additions & 14 deletions trunk/net/mac80211/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1399,15 +1399,25 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy,
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
int i, err = -EINVAL;
int i;
u32 target_rate;
struct ieee80211_supported_band *sband;

/*
* This _could_ be supported by providing a hook for
* drivers for this function, but at this point it
* doesn't seem worth bothering.
*/
if (local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL)
return -EOPNOTSUPP;

sband = local->hw.wiphy->bands[local->hw.conf.channel->band];

/* target_rate = -1, rate->fixed = 0 means auto only, so use all rates
/*
* target_rate = -1, rate->fixed = 0 means auto only, so use all rates
* target_rate = X, rate->fixed = 1 means only rate X
* target_rate = X, rate->fixed = 0 means all rates <= X */
* target_rate = X, rate->fixed = 0 means all rates <= X
*/
sdata->max_ratectrl_rateidx = -1;
sdata->force_unicast_rateidx = -1;

Expand All @@ -1418,20 +1428,18 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy,
else
return 0;

for (i=0; i< sband->n_bitrates; i++) {
struct ieee80211_rate *brate = &sband->bitrates[i];
int this_rate = brate->bitrate;
for (i = 0; i< sband->n_bitrates; i++) {
if (target_rate != sband->bitrates[i].bitrate)
continue;

if (target_rate == this_rate) {
sdata->max_ratectrl_rateidx = i;
if (mask->fixed)
sdata->force_unicast_rateidx = i;
err = 0;
break;
}
/* requested bitrate found */
sdata->max_ratectrl_rateidx = i;
if (mask->fixed)
sdata->force_unicast_rateidx = i;
return 0;
}

return err;
return -EINVAL;
}

struct cfg80211_ops mac80211_config_ops = {
Expand Down

0 comments on commit 2ef4496

Please sign in to comment.