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

* Re: [PATCH] iw: Allow configuring empty legacy and ht ratesets.
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Janusz Dziedzic @ 2015-03-11  6:10 UTC (permalink / raw)
  To: Ben Greear; +Cc: linux-wireless, Johannes Berg

On 11 March 2015 at 00:00,  <greearb@candelatech.com> wrote:
> 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.
>

Hello,

But iw already support setting single rate with ath10k.
This is example from ath10k commit log:

    Example:
    iw wlanX set bitrates legacy-5 ht-mcs-5 vht-mcs-5 2:9
    will setup VHT, nss=2, mcs=9

    iw wlanX set bitrates legacy-5 18 ht-mcs-5 vht-mcs-5
    will setup legacy, 18Mbps

    iw wlanX set bitrates legacy-5 ht-mcs-5 3 vht-mcs-5
    will setup HT, nss=1, mcs=3

    iw wlanX set bitrate legacy-5 ht-mcs-5 vht-mcs-5 1:0-9
    will setup nss=1

    iw wlanX set bitrate legacy-5 ht-mcs-5 vht-mcs-5 1:0-9 2:0-9
    will setup nss=2

BR
Janusz

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

* Re: [PATCH] iw: Allow configuring empty legacy and ht ratesets.
  2015-03-11  6:10 ` Janusz Dziedzic
@ 2015-03-11 15:53   ` Ben Greear
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Greear @ 2015-03-11 15:53 UTC (permalink / raw)
  To: Janusz Dziedzic; +Cc: linux-wireless, Johannes Berg

On 03/10/2015 11:10 PM, Janusz Dziedzic wrote:
> On 11 March 2015 at 00:00,  <greearb@candelatech.com> wrote:
>> 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.
>>
> 
> Hello,
> 
> But iw already support setting single rate with ath10k.
> This is example from ath10k commit log:

Ahh, I see.  I was confused about what syntax to use for 'iw', must have
typo'd something early on and then though the limitation was in the parser.

Thanks,
Ben

> 
>     Example:
>     iw wlanX set bitrates legacy-5 ht-mcs-5 vht-mcs-5 2:9
>     will setup VHT, nss=2, mcs=9
> 
>     iw wlanX set bitrates legacy-5 18 ht-mcs-5 vht-mcs-5
>     will setup legacy, 18Mbps
> 
>     iw wlanX set bitrates legacy-5 ht-mcs-5 3 vht-mcs-5
>     will setup HT, nss=1, mcs=3
> 
>     iw wlanX set bitrate legacy-5 ht-mcs-5 vht-mcs-5 1:0-9
>     will setup nss=1
> 
>     iw wlanX set bitrate legacy-5 ht-mcs-5 vht-mcs-5 1:0-9 2:0-9
>     will setup nss=2
> 
> BR
> Janusz
> 


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


^ permalink raw reply	[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).