2008-11-08 10:03:50

by Kalle Valo

[permalink] [raw]
Subject: iwconfig power timeout

Hello,

I'm trying to set power save timeout for mac80211 with iwconfig, but
I'm having problems with iwconfig on Nokia N810:

Nokia-N810-35-3:~# iwconfig wlan0 power timeout 500m
Error for wireless request "Set Power Management" (8B2C) :
invalid argument "500m".
Nokia-N810-35-3:~# iwconfig wlan0 power timeout 3
Error for wireless request "Set Power Management" (8B2C) :
invalid argument "3".
Nokia-N810-35-3:~#

Looking at iwconfig sources the error means that either my syntax is
wrong or iwconfig has a bug in the parser. I'm guessing the latter
based on reading iwconfig(5). But before I will start investigating
iwconfig's magic, has anyone else seen this?

I'm using wireless-tools 29~pre21-2.osso1 on my N810, but I see a
similar error with wireless-tools 29-1.1 on my laptop running debian
unstable.

--
Kalle Valo


2008-11-08 11:06:50

by Kalle Valo

[permalink] [raw]
Subject: Re: iwconfig power timeout

Johannes Berg <[email protected]> writes:

> On Sat, 2008-11-08 at 12:03 +0200, Kalle Valo wrote:
>> Hello,
>>
>> I'm trying to set power save timeout for mac80211 with iwconfig, but
>> I'm having problems with iwconfig on Nokia N810:
>>
>> Nokia-N810-35-3:~# iwconfig wlan0 power timeout 500m
>> Error for wireless request "Set Power Management" (8B2C) :
>> invalid argument "500m".
>> Nokia-N810-35-3:~# iwconfig wlan0 power timeout 3
>> Error for wireless request "Set Power Management" (8B2C) :
>> invalid argument "3".
>> Nokia-N810-35-3:~#
>>
>> Looking at iwconfig sources the error means that either my syntax is
>> wrong or iwconfig has a bug in the parser. I'm guessing the latter
>> based on reading iwconfig(5). But before I will start investigating
>> iwconfig's magic, has anyone else seen this?
>
> Looks like mac80211 is rejecting that setting with -EINVAL, and that may
> well be true.

I don't think so. If mac80211 responds with -EINVAL the error would be
something like this:

$ iwconfig wlan0 power 5m
Error for wireless request "Set Power Management" (8B2C) :
SET failed on device wlan0 ; Operation not permitted.

So the error seems to happen happen during argument parsing. Oh yeah,
and I even had a printk in mac80211 and it wasn't printed. I'm going
to investigate this with gdb and try to understand how iwconfig really
parses the arguments.

--
Kalle Valo

2008-11-08 19:54:44

by Tomas Winkler

[permalink] [raw]
Subject: Re: iwconfig power timeout

On Sat, Nov 8, 2008 at 1:10 PM, Johannes Berg <[email protected]> wrote:
> On Sat, 2008-11-08 at 13:06 +0200, Kalle Valo wrote:
>
>> I don't think so. If mac80211 responds with -EINVAL the error would be
>> something like this:
>>
>> $ iwconfig wlan0 power 5m
>> Error for wireless request "Set Power Management" (8B2C) :
>> SET failed on device wlan0 ; Operation not permitted.
>
> That looks like -EPERM. But then iwconfig always had messed up error
> handling.
>
>> So the error seems to happen happen during argument parsing. Oh yeah,
>> and I even had a printk in mac80211 and it wasn't printed.
>
> Ok I'm convinced then :)
>
>> I'm going
>> to investigate this with gdb and try to understand how iwconfig really
>> parses the arguments.
>
> Well there is source code too ;)

There bugs in command parsing in v29 grab v30 beta where this bugs are fixed.
Tomas

2008-11-08 10:35:37

by Johannes Berg

[permalink] [raw]
Subject: Re: iwconfig power timeout

On Sat, 2008-11-08 at 12:03 +0200, Kalle Valo wrote:
> Hello,
>
> I'm trying to set power save timeout for mac80211 with iwconfig, but
> I'm having problems with iwconfig on Nokia N810:
>
> Nokia-N810-35-3:~# iwconfig wlan0 power timeout 500m
> Error for wireless request "Set Power Management" (8B2C) :
> invalid argument "500m".
> Nokia-N810-35-3:~# iwconfig wlan0 power timeout 3
> Error for wireless request "Set Power Management" (8B2C) :
> invalid argument "3".
> Nokia-N810-35-3:~#
>
> Looking at iwconfig sources the error means that either my syntax is
> wrong or iwconfig has a bug in the parser. I'm guessing the latter
> based on reading iwconfig(5). But before I will start investigating
> iwconfig's magic, has anyone else seen this?

Looks like mac80211 is rejecting that setting with -EINVAL, and that may
well be true.

johannes


Attachments:
signature.asc (836.00 B)
This is a digitally signed message part

2008-11-09 14:00:35

by Kalle Valo

[permalink] [raw]
Subject: Re: iwconfig power timeout

Tomas Winkler <[email protected]> writes:

>>> I'm going
>>> to investigate this with gdb and try to understand how iwconfig really
>>> parses the arguments.
>>
>> Well there is source code too ;)
>
> There bugs in command parsing in v29 grab v30 beta where this bugs
> are fixed.

Thanks, v30 beta indeed had a fix for this. It's working now for me.

--
Kalle Valo

2008-11-08 11:10:19

by Johannes Berg

[permalink] [raw]
Subject: Re: iwconfig power timeout

On Sat, 2008-11-08 at 13:06 +0200, Kalle Valo wrote:

> I don't think so. If mac80211 responds with -EINVAL the error would be
> something like this:
>
> $ iwconfig wlan0 power 5m
> Error for wireless request "Set Power Management" (8B2C) :
> SET failed on device wlan0 ; Operation not permitted.

That looks like -EPERM. But then iwconfig always had messed up error
handling.

> So the error seems to happen happen during argument parsing. Oh yeah,
> and I even had a printk in mac80211 and it wasn't printed.

Ok I'm convinced then :)

> I'm going
> to investigate this with gdb and try to understand how iwconfig really
> parses the arguments.

Well there is source code too ;)

johannes


Attachments:
signature.asc (836.00 B)
This is a digitally signed message part