Commit b9243ab0 authored by Janusz Dziedzic's avatar Janusz Dziedzic Committed by Johannes Berg

nl80211: allow setting bitrate mask back to default

Allow setting the bitrate masks back to default by
omitting the NL80211_ATTR_TX_RATES attribute.
Signed-off-by: default avatarJanusz Dziedzic <janusz.dziedzic@tieto.com>
[rephrase commit message]
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent b01711be
...@@ -7327,9 +7327,6 @@ static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb, ...@@ -7327,9 +7327,6 @@ static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb,
struct nlattr *tx_rates; struct nlattr *tx_rates;
struct ieee80211_supported_band *sband; struct ieee80211_supported_band *sband;
if (info->attrs[NL80211_ATTR_TX_RATES] == NULL)
return -EINVAL;
if (!rdev->ops->set_bitrate_mask) if (!rdev->ops->set_bitrate_mask)
return -EOPNOTSUPP; return -EOPNOTSUPP;
...@@ -7347,6 +7344,10 @@ static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb, ...@@ -7347,6 +7344,10 @@ static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb,
sizeof(mask.control[i].mcs)); 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 * The nested attribute uses enum nl80211_band as the index. This maps
* directly to the enum ieee80211_band values used in cfg80211. * directly to the enum ieee80211_band values used in cfg80211.
...@@ -7396,6 +7397,7 @@ static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb, ...@@ -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); return rdev_set_bitrate_mask(rdev, dev, NULL, &mask);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment