Bug 17501 - Unable to set txpower on rt2860 mini-pci wifi card
Summary: Unable to set txpower on rt2860 mini-pci wifi card
Status: CLOSED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: network-wireless (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_network-wireless@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-30 19:20 UTC by jd1008
Modified: 2010-09-13 19:34 UTC (History)
3 users (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments
output of dmesg (242.16 KB, text/plain)
2010-08-30 19:32 UTC, jd1008
Details
boot log (4.98 KB, text/plain)
2010-08-30 19:33 UTC, jd1008
Details
bz17501-2.6.35.patch (10.29 KB, patch)
2010-08-30 22:41 UTC, John W. Linville
Details | Diff

Description jd1008 2010-08-30 19:20:14 UTC
wifi card: Sparklan wmir-200N
http://www.sparklan.com/product.php?func=view&prod_id=43
Chipset: RT2860/RT2850

The Datasheet says:

Output Power
802.11a: 12.5dBm ± 1.5dBm
802.11b: 17dBm ± 1.5dBm
802.11g: 14dBm ± 1.5dBm
802.11an: 14dBm ± 1.5dBm
802.11gn: 14dBm ± 1.5dBm

I am running in g mode (54megabits/s)

$ sudo iwconfig wlan0
wlan0     IEEE 802.11abgn  ESSID:"Deleted"
          Mode:Managed  Frequency:2.462 GHz  Access Point: aa:bb:cc:dd:ee:ff
          Bit Rate=54 Mb/s   Tx-Power=8 dBm <<<=====
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:on
          Link Quality=70/70  Signal level=58 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

I tried to set txpower to 14 per datasheet spec:

$ sudo iwconfig wlan0 txpower 14dBm
Error for wireless request "Set Tx Power" (8B26) :
    SET failed on device wlan0 ; Invalid argument.

The drivers that are loaded for this wifi card are:

rt2800pci               7931  0
rt2800lib              27818  1 rt2800pci
rt2x00pci               5799  1 rt2800pci
rt2x00lib              25936  3 rt2800pci,rt2800lib,rt2x00pci
mac80211              182154  2 rt2x00pci,rt2x00lib
cfg80211              135626  2 rt2x00lib,mac80211
eeprom_93cx6            1305  1 rt2800pci
crc_ccitt               1311  2 rt2800pci,irda

Either wext driver or the rt2xxx drivers are causing this.

Setting txpower to a low value of 8 works find - but that is too feeble and causes the card to disconnect and reconnect.
Comment 1 jd1008 2010-08-30 19:22:21 UTC
Should have added:

Stable Kernel 2.6.35.4
Comment 2 John W. Linville 2010-08-30 19:25:12 UTC
Please include the output of running 'dmesg'.
Comment 3 jd1008 2010-08-30 19:32:23 UTC
Created attachment 28531 [details]
output of dmesg
Comment 4 jd1008 2010-08-30 19:33:06 UTC
Created attachment 28541 [details]
boot log
Comment 5 John W. Linville 2010-08-30 19:54:57 UTC
My first guess has to be that this is respecting the info that the rt2800 driver read from the EEPROM on the hardware.  Ivo and/or Gertjan, is there any reasonably easy way to dump that information?
Comment 6 Ivo van Doorn 2010-08-30 20:07:11 UTC
Actually all it needs is this patch:
    8d1331b37d5b656a7a8e561f8e9d7661dd00c910
    rt2x00: Fix max TX power settings

which you merged into wireless-testing.git on August 25.

I suggest trying the most recent compat-wireless package to get it working using the maximum TX power.
Comment 7 jd1008 2010-08-30 20:21:37 UTC
Where do I download most recent compat-wireless package from?
Comment 8 jd1008 2010-08-30 20:46:22 UTC
I found the patch at
http://www.spinics.net/lists/linux-wireless/msg54636.html

and I applied it to 2.6.35.4. A few hunks failed:

$ patch -l -p 1 -i ../compat\-wireless.patch 
patching file drivers/net/wireless/rt2x00/rt2400pci.c
Hunk #1 succeeded at 1462 (offset -25 lines).
patching file drivers/net/wireless/rt2x00/rt2500pci.c
Hunk #1 succeeded at 1780 (offset -21 lines).
patching file drivers/net/wireless/rt2x00/rt2500usb.c
Hunk #1 succeeded at 1690 (offset -16 lines).
patching file drivers/net/wireless/rt2x00/rt2800.h
Hunk #1 succeeded at 1770 (offset -89 lines).
patching file drivers/net/wireless/rt2x00/rt2800lib.c
Hunk #1 FAILED at 1239.
Hunk #2 FAILED at 1295.
Hunk #3 FAILED at 1324.
Hunk #4 succeeded at 2226 (offset -503 lines).
Hunk #5 succeeded at 2473 (offset -502 lines).
Hunk #6 succeeded at 2574 (offset -518 lines).
3 out of 6 hunks FAILED -- saving rejects to file drivers/net/wireless/rt2x00/rt2800lib.c.rej
patching file drivers/net/wireless/rt2x00/rt2x00.h
Hunk #1 succeeded at 211 (offset -2 lines).
patching file drivers/net/wireless/rt2x00/rt2x00dev.c
Hunk #1 succeeded at 605 (offset -106 lines).
patching file drivers/net/wireless/rt2x00/rt61pci.c
Hunk #1 succeeded at 2605 (offset -51 lines).
patching file drivers/net/wireless/rt2x00/rt73usb.c
Hunk #1 succeeded at 2092 (offset 2 lines).
Comment 9 jd1008 2010-08-30 21:57:44 UTC
Hey guys ... please,
do you have a patch for 2.6.35.4 ???
Comment 10 John W. Linville 2010-08-30 22:41:01 UTC
Created attachment 28581 [details]
bz17501-2.6.35.patch
Comment 11 jd1008 2010-08-30 23:04:59 UTC
Thanx a lot. Will apply and rebuild.
I will keep you informed of the result.
Comment 12 jd1008 2010-08-31 05:33:37 UTC
I applied the patch to 2.6.35.4, rebuilt and rebooted.
I can confirm that 
iwconfig wlan0 txpower 14 does indeed work.

However, it is not clear if the wifi card is
actually Tx'ing at this power setting as I have
no means of testing the Tx signal strength.
I will see if over a perios of 24-48 hours, I will
loose contact with the base unit, as I have been
over the past few days.

Thank you so very much for the patch.
It is very well appreciated.

On Wed, (after tomorrow) I will post an update about whether or not I had
a steadier connection with the router.
Comment 13 jd1008 2010-09-02 20:35:58 UTC
I would like to report that with the patches provided by John Linville
are working like a charm. I have not had any disconnect/reconnect glitches.
Furthermore, the driver is far far superior to the one provided by Ralinktech,
which would take anywhere from 1 to 20 minutes to actually login to the Router
and bring up the link. In addition, for some reason i do not understand, the Ralinktech driver would always show that my Link Quality was always very poor.
There are two thick walls between my room and the room where the router is.
The rt2xxx driver shows Link Quality=70/70

Thank you very very much for your excellent work.

Best regards,

JD
Comment 14 jd1008 2010-09-02 23:32:00 UTC

(In reply to comment #13)
> I would like to report that with the patches provided by John Linville
> are working like a charm. I have not had any disconnect/reconnect glitches.
> Furthermore, the driver is far far superior to the one provided by
> Ralinktech,
> which would take anywhere from 1 to 20 minutes to actually login to the
> Router
> and bring up the link. In addition, for some reason i do not understand, the
> Ralinktech driver would always show that my Link Quality was always very
> poor.
> There are two thick walls between my room and the room where the router is.
> The rt2xxx driver shows Link Quality=70/70
> 
> Thank you very very much for your excellent work.
> 
> Best regards,
> 
> JD

Spoke too soon :(
I just got the dreaded disconnect and it took at least 5 to 10 minutes to re-connect.
I believe there is a source of a powerful 2.4GHz signal that is causing this
interference and disconnect. Not sure where it is coming from.
Comment 15 John W. Linville 2010-09-13 15:09:22 UTC
I'm not really sure what we can do about your interference?  Setting your txpower might help the AP hear you, but it won't do anything to help you hear the AP...
Comment 16 jd1008 2010-09-13 19:01:04 UTC
Please close this bug as fixed by the patch provided.
I agree - there is not a whole lot that can be done about
the interference.

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