public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/3] nl80211: back to default bitrate_mask correctly
@ 2013-12-05  9:02 Janusz Dziedzic
  2013-12-05  9:02 ` [PATCH v2 2/3] nl80211/cfg80211: bitrate_mask, rename mcs to ht_mcs Janusz Dziedzic
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Janusz Dziedzic @ 2013-12-05  9:02 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, j, Janusz Dziedzic

In case of empty NL80211_ATTR_TX_RATES attribute
in nl80211_set_tx_bitrate_mask() function back to
default bitrate mask, to be able to reset the
state.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
---
 net/wireless/nl80211.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index c6401a8..072b60d 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -7311,9 +7311,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;
 
@@ -7331,6 +7328,10 @@ static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb,
 		       sizeof(mask.control[i].mcs));
 	}
 
+	/* Back to default settings */
+	if (info->attrs[NL80211_ATTR_TX_RATES] == NULL)
+		goto out;
+
 	/*
 	 * The nested attribute uses enum nl80211_band as the index. This maps
 	 * directly to the enum ieee80211_band values used in cfg80211.
@@ -7380,6 +7381,7 @@ static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb,
 		}
 	}
 
+out:
 	return rdev_set_bitrate_mask(rdev, dev, NULL, &mask);
 }
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-12-06  9:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-05  9:02 [PATCH v2 1/3] nl80211: back to default bitrate_mask correctly Janusz Dziedzic
2013-12-05  9:02 ` [PATCH v2 2/3] nl80211/cfg80211: bitrate_mask, rename mcs to ht_mcs Janusz Dziedzic
2013-12-05  9:02 ` [PATCH v2 3/3] nl80211: add VHT support for set_bitrate_mask Janusz Dziedzic
2013-12-05 15:42   ` Johannes Berg
2013-12-05  9:02 ` [PATCH v2] iw: add VHT MCS/NSS set support to set bitrates Janusz Dziedzic
2013-12-05 15:43   ` Johannes Berg
2013-12-05 17:30   ` Karl Beldan
2013-12-06  9:08     ` Karl Beldan
2013-12-05 15:40 ` [PATCH v2 1/3] nl80211: back to default bitrate_mask correctly Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox