Modify

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#21345 closed defect (not_a_bug)

Wi-Fi power limited for channels 1 and 11 in newer TP-LINK TL-MR3020 v1.9 routers

Reported by: VittGam Owned by: developers
Priority: normal Milestone:
Component: packages Version: Trunk
Keywords: ath9k, tp-link, txpower Cc:

Description

Hello,

I'm having a weird problem with TX power being limited on newer TP-LINK TL-MR3020 v1.9 routers.

Channel 1 and 11 maximum actual TX power is 15 dBm for the "broken" new routers, seen from both iwinfo and from a STA.

Channel 1 and 11 maximum actual TX power is 18 dBm for the "good" older routers, instead.

Other channels 2-10 and 12-13 actual TX power is 18 dBm for both kinds of routers.

This is the relevant part of iw list from a "broken" router running CC release:

                Frequencies:
                        * 2412 MHz [1] (15.0 dBm)
                        * 2417 MHz [2] (18.0 dBm)
                        * 2422 MHz [3] (18.0 dBm)
                        * 2427 MHz [4] (18.0 dBm)
                        * 2432 MHz [5] (18.0 dBm)
                        * 2437 MHz [6] (18.0 dBm)
                        * 2442 MHz [7] (18.0 dBm)
                        * 2447 MHz [8] (18.0 dBm)
                        * 2452 MHz [9] (18.0 dBm)
                        * 2457 MHz [10] (18.0 dBm)
                        * 2462 MHz [11] (15.0 dBm)
                        * 2467 MHz [12] (18.0 dBm)
                        * 2472 MHz [13] (18.0 dBm)
                        * 2484 MHz [14] (disabled)

This is the relevant part from an older revision of the same model:

                Frequencies:
                        * 2412 MHz [1] (18.0 dBm)
                        * 2417 MHz [2] (18.0 dBm)
                        * 2422 MHz [3] (18.0 dBm)
                        * 2427 MHz [4] (18.0 dBm)
                        * 2432 MHz [5] (18.0 dBm)
                        * 2437 MHz [6] (18.0 dBm)
                        * 2442 MHz [7] (18.0 dBm)
                        * 2447 MHz [8] (18.0 dBm)
                        * 2452 MHz [9] (18.0 dBm)
                        * 2457 MHz [10] (18.0 dBm)
                        * 2462 MHz [11] (18.0 dBm)
                        * 2467 MHz [12] (18.0 dBm)
                        * 2472 MHz [13] (18.0 dBm)
                        * 2484 MHz [14] (disabled)

You can clearly see that there is some error in the calibration data for the newer routers.

(I live in Europe, so I've patched the ath.ko driver to have it see the 0x3a regdmn code as my country code instead of US.)

How could this problem be fixed for the newer revision of routers?

Thank you!

Attachments (0)

Change History (12)

comment:1 Changed 2 years ago by nbd

  • Resolution set to not_a_bug
  • Status changed from new to closed

This is not a bug in the driver, the power is limited by the conformance test limit (CTL) entries in the EEPROM, which reduce power around the edges to prevent sideband leakage.

comment:2 Changed 2 years ago by VittGam

But is this a new test that didn't exist before? The older routers don't have this problem...

By the way, the reduction on channel 11 doesn't make any sense in Europe, since I can use full power on channel 13 for instance.

comment:3 Changed 2 years ago by nbd

The channels for which power is being reduced are stored in EEPROM. Did you try flashing updated software on an older device that was currently not affected by this?
The test itself is not new...

comment:4 Changed 2 years ago by VittGam

Yes. The older routers even when running CC 15.05 r46767 precompiled sysupgrade image don't have this problem.

Only newer routers bought in 2015 have.

(For older revision I meant v1.6 of the hardware vs v1.9, not older OpenWrt revision.)

Would it be possible to move the channel 11 limit to channel 13 by modifying the EEPROM?

Last edited 2 years ago by VittGam (previous) (diff)

comment:5 Changed 2 years ago by nbd

Yes, it's possible. You need to look into it yourself though, I currently don't have time to read the code again and prepare the info for you.

comment:6 Changed 2 years ago by VittGam

No problem, I'm going to dig into the ath9k driver code to see how the EEPROM is structured and where I need to modify it in order to fix the limits. Thank you for your time, by the way!

comment:7 Changed 2 years ago by VittGam

Okay, I've understood the EEPROM format.

Older routers have default CTL data (set to 30 dBm for all frequencies), while the newer routers have more specific CTL data, which sets the edges around channel 1 and 11 to 14.5 dBm, and the rest to 18 dBm.

It seems that the CTL bins are set around frequency limits for regdomain 0, so the logic in ath9k will obviously not correct it when I force the regdomain 0x00 -> 0x3a to be mapped to my country code instead of US.

I don't know if we want to somehow fix this in ath9k or not?

comment:8 follow-up: Changed 2 years ago by finas

is is possible to download the eeprom, edit it and flash it back ?

comment:9 in reply to: ↑ 8 Changed 2 years ago by VittGam

Replying to finas:

is is possible to download the eeprom, edit it and flash it back ?

Yes, but you need to modify the kernel in order to make the ART partition read/write. But beware, if you lose or corrupt your ART partition then your WLAN will stop working; there's a reason if the partition is set to be read-only by default...

comment:10 Changed 2 years ago by finas

I made a dump of the ART partition ( I'm using an archer c5 ) and when I open it with a hex editor I see two "blocks" of data but none of them contain the mac address of the 2.4 and 5ghz radios. Maybe it is encrypted.

comment:11 Changed 2 years ago by finas

I just found this absolutly superb tool:

https://github.com/pepe2k/ar9300_eeprom

it's not 100% compatible with my archer C5 ( only detects and changes the 2.4GHZ tables, but it may be compatible with yours. maybe you can try it.

comment:12 Changed 2 years ago by VittGam

The MAC address is not specified in the ART partition but in the u-boot one, at least for TP-LINK routers. You will find garbage such as 00:02:03:04:05:06 as MAC address in the ART partition.

Furthermore I think that the 5 GHz tables for ath10k are of a different format than the ath9k tables, so you will not be able to edit them with ar9300_eeprom.

Great finding, by the way! The tool is compatible with all the routers I have (TP-LINK, ath9k based).

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.