aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorJanusz Dziedzic <janusz.dziedzic@tieto.com>2013-12-05 04:02:14 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-12-05 10:37:08 -0500
commitb9243ab0c9e3e4dbd54ae8f44cf0cdb5838c8746 (patch)
tree1fba6662ecfc80019df5b0dc7b8e0252481f2d87 /net/wireless
parentb01711be4bff93d16ac921350d2ada1a60ecc160 (diff)
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: Janusz Dziedzic <janusz.dziedzic@tieto.com> [rephrase commit message] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/nl80211.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 6989989de092..f61b74c40d28 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -7327,9 +7327,6 @@ static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb,
7327 struct nlattr *tx_rates; 7327 struct nlattr *tx_rates;
7328 struct ieee80211_supported_band *sband; 7328 struct ieee80211_supported_band *sband;
7329 7329
7330 if (info->attrs[NL80211_ATTR_TX_RATES] == NULL)
7331 return -EINVAL;
7332
7333 if (!rdev->ops->set_bitrate_mask) 7330 if (!rdev->ops->set_bitrate_mask)
7334 return -EOPNOTSUPP; 7331 return -EOPNOTSUPP;
7335 7332
@@ -7347,6 +7344,10 @@ static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb,
7347 sizeof(mask.control[i].mcs)); 7344 sizeof(mask.control[i].mcs));
7348 } 7345 }
7349 7346
7347 /* if no rates are given set it back to the defaults */
7348 if (!info->attrs[NL80211_ATTR_TX_RATES])
7349 goto out;
7350
7350 /* 7351 /*
7351 * The nested attribute uses enum nl80211_band as the index. This maps 7352 * The nested attribute uses enum nl80211_band as the index. This maps
7352 * directly to the enum ieee80211_band values used in cfg80211. 7353 * 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 } 7397 }
7397 } 7398 }
7398 7399
7400out:
7399 return rdev_set_bitrate_mask(rdev, dev, NULL, &mask); 7401 return rdev_set_bitrate_mask(rdev, dev, NULL, &mask);
7400} 7402}
7401 7403