2010-10-08 16:45:49

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [ath9k-devel] trying to set tx power (using txpower option)

On Fri, Oct 8, 2010 at 9:23 AM, At Santos <[email protected]> wrote:
>
>
>> Actually, you can set tx power with iw now:
>>
>> http://wireless.kernel.org/en/users/Documentation/iw#Setting_TX_power
>>
>> I will note you will need 2.6.36, or compat-wireless-2.6.36, otherwise
>> you have to use iwconfig, setting txpower with nl80211 was only added
>> as of 2.6.36.
>>
>> Luis
>
> Thanks for the response.
>
> I'm running with compat-wireless-2.6.36-rc3-1 and I'm finding that iw
> doesn't work with fixed or limit:
>
> $ sudo iw wlan0 set txpower fixed 20
> command failed: Operation not supported (-95)
>
> So it seems it's broken at the moment.
> To where should I report the bug?

You can use bugzilla.kernel.org please report it there and we can fix
it. I can't look into right now though as I'm looking into another
issue. If someone else has cycles it would be appreciated.

Luis


2010-10-08 17:07:41

by Ben Greear

[permalink] [raw]
Subject: Re: [ath9k-devel] trying to set tx power (using txpower option)

On 10/08/2010 09:52 AM, Luis R. Rodriguez wrote:
> On Fri, Oct 08, 2010 at 09:48:48AM -0700, Ben Greear wrote:

>>> You can use bugzilla.kernel.org please report it there and we can fix
>>> it. I can't look into right now though as I'm looking into another
>>> issue. If someone else has cycles it would be appreciated.
>>
>> I might be able to work on this,
>
> awesome, thanks!
>
>> in wireless-testing tree at least.
>
> All development is assumed to take places on wireless-testing.git anyway, and
> to send a fix for older kernels we first must address it there so indeed
> its always the right place to do development, even for stable.

This doesn't seem to be an ath9k issue.

Well, the command fails because of this check (mbm is 20 in his case)
cfg.c:
case NL80211_TX_POWER_FIXED:
if (mbm < 0 || (mbm % 100))
return -EOPNOTSUPP;

That mbm % 100 looks quite strange to me..any idea what that is supposed to
accomplish?

Thanks,
Ben

--
Ben Greear <[email protected]>
Candela Technologies Inc http://www.candelatech.com


2010-10-08 17:25:33

by Ben Greear

[permalink] [raw]
Subject: Re: [ath9k-devel] trying to set tx power (using txpower option)

On 10/08/2010 10:12 AM, Johannes Berg wrote:
> On Fri, 2010-10-08 at 10:07 -0700, Ben Greear wrote:
>
>> Well, the command fails because of this check (mbm is 20 in his case)
>> cfg.c:
>> case NL80211_TX_POWER_FIXED:
>> if (mbm< 0 || (mbm % 100))
>> return -EOPNOTSUPP;
>>
>> That mbm % 100 looks quite strange to me..any idea what that is supposed to
>> accomplish?
>
> There's a later division by 100 to go from mBm to dBm ... I think you
> want 2000, not 20.

Well, it's documented in iw to be 'mBm', though I surely wouldn't have known
what that stood for (nothing useful shows up on google for 'mBm units').

Thanks,
Ben

>
> johannes


--
Ben Greear <[email protected]>
Candela Technologies Inc http://www.candelatech.com


2010-10-08 18:08:00

by David Lamparter

[permalink] [raw]
Subject: Re: [ath9k-devel] trying to set tx power (using txpower option)

On Fri, Oct 08, 2010 at 10:24:50AM -0700, Ben Greear wrote:
> On 10/08/2010 10:12 AM, Johannes Berg wrote:
> > On Fri, 2010-10-08 at 10:07 -0700, Ben Greear wrote:
> >
> >> Well, the command fails because of this check (mbm is 20 in his case)
> >> cfg.c:
> >> case NL80211_TX_POWER_FIXED:
> >> if (mbm< 0 || (mbm % 100))
> >> return -EOPNOTSUPP;
> >>
> >> That mbm % 100 looks quite strange to me..any idea what that is supposed to
> >> accomplish?
> >
> > There's a later division by 100 to go from mBm to dBm ... I think you
> > want 2000, not 20.
>
> Well, it's documented in iw to be 'mBm', though I surely wouldn't have known
> what that stood for (nothing useful shows up on google for 'mBm units').

d-B-m is deci-Bel-milliWatt, so a mBm ostensibly is a
milli-Bel-milliWatt...

(yes, the "m" really encodes "mW"...)


-David


2010-10-08 23:10:45

by David Willmore

[permalink] [raw]
Subject: Re: [ath9k-devel] trying to set tx power (using txpower option)

On Fri, Oct 8, 2010 at 2:05 PM, Johannes Berg <[email protected]> wrote:
> No, the d in dB already means it's 1/10 B, and mB is (was meant to be)
> 1/1000 B -- so the conversion factor is 100.

I stand corrected! Well said.

Cheers,
David

2010-10-08 16:52:35

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [ath9k-devel] trying to set tx power (using txpower option)

On Fri, Oct 08, 2010 at 09:48:48AM -0700, Ben Greear wrote:
> On 10/08/2010 09:45 AM, Luis R. Rodriguez wrote:
> > On Fri, Oct 8, 2010 at 9:23 AM, At Santos<[email protected]> wrote:
> >>
> >>
> >>> Actually, you can set tx power with iw now:
> >>>
> >>> http://wireless.kernel.org/en/users/Documentation/iw#Setting_TX_power
> >>>
> >>> I will note you will need 2.6.36, or compat-wireless-2.6.36, otherwise
> >>> you have to use iwconfig, setting txpower with nl80211 was only added
> >>> as of 2.6.36.
> >>>
> >>> Luis
> >>
> >> Thanks for the response.
> >>
> >> I'm running with compat-wireless-2.6.36-rc3-1 and I'm finding that iw
> >> doesn't work with fixed or limit:
> >>
> >> $ sudo iw wlan0 set txpower fixed 20
> >> command failed: Operation not supported (-95)
> >>
> >> So it seems it's broken at the moment.
> >> To where should I report the bug?
> >
> > You can use bugzilla.kernel.org please report it there and we can fix
> > it. I can't look into right now though as I'm looking into another
> > issue. If someone else has cycles it would be appreciated.
>
> I might be able to work on this,

awesome, thanks!

> in wireless-testing tree at least.

All development is assumed to take places on wireless-testing.git anyway, and
to send a fix for older kernels we first must address it there so indeed
its always the right place to do development, even for stable.

Luis

2010-10-08 17:28:24

by Johannes Berg

[permalink] [raw]
Subject: Re: [ath9k-devel] trying to set tx power (using txpower option)

On Fri, 2010-10-08 at 10:24 -0700, Ben Greear wrote:

> > There's a later division by 100 to go from mBm to dBm ... I think you
> > want 2000, not 20.
>
> Well, it's documented in iw to be 'mBm', though I surely wouldn't have known
> what that stood for (nothing useful shows up on google for 'mBm units').

Suck. I don't even know why we did that in iw though, couldn't we have
used dBm floats?

johannes


2010-10-08 16:48:53

by Ben Greear

[permalink] [raw]
Subject: Re: [ath9k-devel] trying to set tx power (using txpower option)

On 10/08/2010 09:45 AM, Luis R. Rodriguez wrote:
> On Fri, Oct 8, 2010 at 9:23 AM, At Santos<[email protected]> wrote:
>>
>>
>>> Actually, you can set tx power with iw now:
>>>
>>> http://wireless.kernel.org/en/users/Documentation/iw#Setting_TX_power
>>>
>>> I will note you will need 2.6.36, or compat-wireless-2.6.36, otherwise
>>> you have to use iwconfig, setting txpower with nl80211 was only added
>>> as of 2.6.36.
>>>
>>> Luis
>>
>> Thanks for the response.
>>
>> I'm running with compat-wireless-2.6.36-rc3-1 and I'm finding that iw
>> doesn't work with fixed or limit:
>>
>> $ sudo iw wlan0 set txpower fixed 20
>> command failed: Operation not supported (-95)
>>
>> So it seems it's broken at the moment.
>> To where should I report the bug?
>
> You can use bugzilla.kernel.org please report it there and we can fix
> it. I can't look into right now though as I'm looking into another
> issue. If someone else has cycles it would be appreciated.

I might be able to work on this, in wireless-testing tree at least.

Thanks,
Ben

>
> Luis
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html


--
Ben Greear <[email protected]>
Candela Technologies Inc http://www.candelatech.com


2010-10-08 17:12:26

by Johannes Berg

[permalink] [raw]
Subject: Re: [ath9k-devel] trying to set tx power (using txpower option)

On Fri, 2010-10-08 at 10:07 -0700, Ben Greear wrote:

> Well, the command fails because of this check (mbm is 20 in his case)
> cfg.c:
> case NL80211_TX_POWER_FIXED:
> if (mbm < 0 || (mbm % 100))
> return -EOPNOTSUPP;
>
> That mbm % 100 looks quite strange to me..any idea what that is supposed to
> accomplish?

There's a later division by 100 to go from mBm to dBm ... I think you
want 2000, not 20.

johannes


2010-10-08 18:00:56

by David Willmore

[permalink] [raw]
Subject: Re: [ath9k-devel] trying to set tx power (using txpower option)

On Fri, Oct 8, 2010 at 1:41 PM, David Lamparter <[email protected]> wrote:
> d-B-m is deci-Bel-milliWatt, so a mBm ostensibly is a
> milli-Bel-milliWatt...
>
> (yes, the "m" really encodes "mW"...)

The value is a "Power", so the base unit of Watts is implicit.

This particular unit has always confused the heck out of me.
It's *not* milli-Bel-milliWatt or the division would be by 1000,
so it's really centi-Bel-milliWatt, no?

Cheers,
David

2010-10-08 18:05:49

by Johannes Berg

[permalink] [raw]
Subject: Re: [ath9k-devel] trying to set tx power (using txpower option)

On Fri, 2010-10-08 at 14:00 -0400, David Willmore wrote:
> On Fri, Oct 8, 2010 at 1:41 PM, David Lamparter <[email protected]> wrote:
> > d-B-m is deci-Bel-milliWatt, so a mBm ostensibly is a
> > milli-Bel-milliWatt...
> >
> > (yes, the "m" really encodes "mW"...)
>
> The value is a "Power", so the base unit of Watts is implicit.
>
> This particular unit has always confused the heck out of me.
> It's *not* milli-Bel-milliWatt or the division would be by 1000,
> so it's really centi-Bel-milliWatt, no?

No, the d in dB already means it's 1/10 B, and mB is (was meant to be)
1/1000 B -- so the conversion factor is 100.

johannes


2010-10-08 17:38:36

by Ben Greear

[permalink] [raw]
Subject: Re: [ath9k-devel] trying to set tx power (using txpower option)

On 10/08/2010 10:28 AM, Johannes Berg wrote:
> On Fri, 2010-10-08 at 10:24 -0700, Ben Greear wrote:
>
>>> There's a later division by 100 to go from mBm to dBm ... I think you
>>> want 2000, not 20.
>>
>> Well, it's documented in iw to be 'mBm', though I surely wouldn't have known
>> what that stood for (nothing useful shows up on google for 'mBm units').
>
> Suck. I don't even know why we did that in iw though, couldn't we have
> used dBm floats?

Looks like this iw change has been out there a while.

Maybe change iw:

* If value is < 100, assume it's dBm and convert for user.
* Warn them?

* If it's a float, convert to dBm for user.

Otherwise, leave it as is.

For what it's worth, 'iwconfig' works as is (using dBm units).

Thanks,
Ben

>
> johannes


--
Ben Greear <[email protected]>
Candela Technologies Inc http://www.candelatech.com