linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iw:  Allow configuring empty legacy and ht ratesets.
@ 2015-03-10 23:00 greearb
  2015-03-11  6:10 ` Janusz Dziedzic
  0 siblings, 1 reply; 3+ messages in thread
From: greearb @ 2015-03-10 23:00 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, Ben Greear

From: Ben Greear <greearb@candelatech.com>

This allows one to configure exactly one rate for drivers
such as ath10k that will only allow a single rate to be
configured.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 bitrate.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bitrate.c b/bitrate.c
index 4df6185..21217bf 100644
--- a/bitrate.c
+++ b/bitrate.c
@@ -176,6 +176,8 @@ static int handle_bitrates(struct nl80211_state *state,
 			tmpd = strtod(argv[i], &end);
 			if (*end != '\0')
 				return 1;
+                        if (tmpd == -1) /* terminator, could be empty list */
+                           break;
 			if (tmpd < 1 || tmpd > 255 * 2)
 				return 1;
 			legacy[(*n_legacy)++] = tmpd * 2;
@@ -184,6 +186,8 @@ static int handle_bitrates(struct nl80211_state *state,
 			tmpl = strtol(argv[i], &end, 0);
 			if (*end != '\0')
 				return 1;
+                        if (tmpl == -1) /* terminator, could be empty list */
+                           break;
 			if (tmpl < 0 || tmpl > 255)
 				return 1;
 			mcs[(*n_mcs)++] = tmpl;
-- 
1.9.3


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

end of thread, other threads:[~2015-03-11 15:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-10 23:00 [PATCH] iw: Allow configuring empty legacy and ht ratesets greearb
2015-03-11  6:10 ` Janusz Dziedzic
2015-03-11 15:53   ` Ben Greear

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).