Skip to content

Commit

Permalink
nl80211: allow setting bitrate mask back to default
Browse files Browse the repository at this point in the history
Allow setting the bitrate masks back to default by
omitting the NL80211_ATTR_TX_RATES attribute.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
[rephrase commit message]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Janusz Dziedzic authored and Johannes Berg committed Dec 5, 2013
1 parent b01711b commit b9243ab
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -7327,9 +7327,6 @@ static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb,
struct nlattr *tx_rates;
struct ieee80211_supported_band *sband;

if (info->attrs[NL80211_ATTR_TX_RATES] == NULL)
return -EINVAL;

if (!rdev->ops->set_bitrate_mask)
return -EOPNOTSUPP;

Expand All @@ -7347,6 +7344,10 @@ static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb,
sizeof(mask.control[i].mcs));
}

/* if no rates are given set it back to the defaults */
if (!info->attrs[NL80211_ATTR_TX_RATES])
goto out;

/*
* The nested attribute uses enum nl80211_band as the index. This maps
* directly to the enum ieee80211_band values used in cfg80211.
Expand Down Expand Up @@ -7396,6 +7397,7 @@ static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb,
}
}

out:
return rdev_set_bitrate_mask(rdev, dev, NULL, &mask);
}

Expand Down

0 comments on commit b9243ab

Please sign in to comment.