Bug 339 - iwconfig eht1 txpower 10 - sets power to '-7dBm'
: iwconfig eht1 txpower 10 - sets power to '-7dBm'
Status: VERIFIED TO_BE_DOCUMENTED
: IPW2100
IBSS
: 0.57
: All All
: P1 normal
Assigned To:
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2004-11-04 15:09 by
Modified: 2006-02-17 05:38 (History)


Attachments
set and get tx power (1.19 KB, patch)
2005-04-25 03:25, Liu, Hong
Details | Diff
patch against ipw2100-1.1.3 (771 bytes, patch)
2005-11-22 18:57, Liu, Hong
Details | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2004-11-04 15:09:28
New bug that came out of the bug scrub on 11/4/04 (log here: 
http://www.bughost.org/bugscrub/04NOV04.txt)

setting txpower it with "iwconfig eht1 txpower 10" sets the power to "-7dBm" 
and not to 10 dBm

Notes from bug scrub:

soopel		in ibss it works but quite strange - setting it with command - 
iwconfig eht1 txpower 10 - sets power to "-7dBm"
logics_sbux	i believe the readme.ipw2100 documents that behavior
soopel		and not to 10 dBm
logics_sbux	if you put 10dBm does it work?
soopel		yes
logics_sbux	it could be that w/out the dBm its providing an index
soopel		but it sets to different value
logics_sbux	0-16 is the range for the index
soopel		no
soopel		range is from "-12" to 16
soopel		without dBm
soopel		when setting value to -12 iwconfig will show 16 dBm
logics_sbux	hmmm.
logics_sbux	does -12dBm do as it should?
soopel		when setting value to 16 iwconfig will show "-12"
soopel		as far as i remember no
logics_sbux	ok; sounds like the values are reversed in the mapping
------- Comment #1 From 2004-11-04 22:57:53 -------
this bug still exist in 0.59.
test this on suse 9.2 rc2, 2.6.8-22-default kernel, IBM R50, with 0.59 driver 
installed.
steps:
% modprobe ipw2100
% iwconfig eth1 mode ad-hoc
% iwlist eth1 txpower
it shows like this:
eth1   8 available transmit-powers:
       16 dBm    (39 mW)
       ...
% iwconfig eth1 txpower 16
% iwconfig 
  we can see Tx-Power is set to -12dBm. 
------- Comment #2 From 2004-11-04 23:49:09 -------
Fixed in 0.60
------- Comment #3 From 2004-11-07 22:58:12 -------
this bug still exist in 0.60.
test this on suse 9.2 rc2, 2.6.8-22-default kernel, IBM R50, with 0.60 driver 
installed.
steps:
% modprobe ipw2100
% iwconfig eth1 mode ad-hoc
% iwlist eth1 txpower
it shows like this:
eth1   8 available transmit-powers:
       16 dBm    (39 mW)
       ...
% iwconfig eth1 txpower 16
% iwconfig 
  we can see Tx-Power is set to 16dBm. 

BUT, if % iwconfig eth1 txpower 16dbm
        % iwconfig
        we can see Tx-Power is set to 12dBm.
if % iwconfig eth1 txpower 12
   % iwconfig
   we can see Tx-Power is set to 10dBm.
if % iwconfig eth1 txpower 12dbm
   % iwconfig
   we can see Tx-Power is also set to 10dBm.
if % iwconfig eth1 txpower 10
   % iwconfig
   we can see Tx-Power is set to 9 dBm.
------- Comment #4 From 2005-03-03 19:36:53 -------
The bug still existed in 1.0.5.
Wireless tools have been upgraded to 28-pre4 (beta). 

Seems setting txpower is using mW instead of dBm, but the mapping from mW to 
dBm is not correct. 
------- Comment #5 From 2005-04-25 03:25:04 -------
Created an attachment (id=355) [details]
set and get tx power
------- Comment #6 From 2005-04-25 03:28:20 -------
The problem is ipw2100 firmware accepts [0-16] when setting the tx power.
But the iwconfig tool will pass [-12dbm, 16dbm] to the driver.

So when setting the tx power, the driver first scales down the user passed 
value to fit in [0-16] range.
x --> (x-(-12))/(16-(-12)) * 16

When getting the tx power, it also scales up the value to fit in [-12, 16].
x --> x/16 * (16 - (-12)) - 12

During this transformation, we will lost some precisions.

So there are two solutions:
1. we document this phenomenon in the README file, tell the user not to be 
surprised that the tx power gotten is not the same as he set

2. we don't record the transformed value in the driver, just record the user 
passed value. Only using the transformed value when setting the hardware card, 
return the user passed value when the user requests it. Thus the user will 
happily see the same value. (the attached patch)
------- Comment #7 From 2005-06-23 07:51:51 -------
re-opening to set to TESTED_PATCH_EXISTS so we can have the patch merged
------- Comment #8 From 2005-06-23 07:53:01 -------
Marking as TESTED_PATCH_EXISTS
------- Comment #9 From 2005-08-08 22:46:19 -------
patch already in 1.1.2
------- Comment #10 From 2005-11-10 00:12:13 -------
this problem still exists in 1.1.3, so reopen it.
------- Comment #11 From 2005-11-22 18:57:14 -------
Created an attachment (id=621) [details]
patch against ipw2100-1.1.3
------- Comment #12 From 2005-11-22 18:58:39 -------
marked as tested_patch_exists
------- Comment #13 From 2005-11-30 21:50:17 -------
to remark
------- Comment #14 From 2005-11-30 21:50:39 -------
fixed
------- Comment #15 From 2006-01-13 00:19:24 -------
This problem still exist on 1.1.4. reopen it.
------- Comment #16 From 2006-01-26 17:43:44 -------
It's a problem of iwconfig, because the criteria of the check is
    ismwatt = (index(args[i], 'm') != NULL);


If you use "iwconfig eth1 txpower xx", the default txpower unit is dbm and the 
behavior of the driver is right.

But if you use "iwconfig eth1 txpower xxdbm", iwconfig will deem the txpower 
is in mW unit. So it will change the xx to dbm and send the changed value to 
the driver.

I am not sure if it is an expected behavior of iwconfig (not appending dbm if 
you want to use dbm as the unit).
------- Comment #17 From 2006-02-12 23:56:01 -------
remark
------- Comment #18 From 2006-02-13 18:50:43 -------
The problem is fixed in wireless tools 28-pre14.
------- Comment #19 From 2006-02-17 05:38:01 -------
document it in ipw2100_1.2.0.