Please note: This project is no longer active. The website is kept online for historic purposes only.
If you´re looking for a Linux driver for your Atheros WLAN device, you should continue here .

Ticket #2156 (new enhancement)

Opened 14 years ago

Last modified 14 years ago

changing regdomain on AR242x

Reported by: alex@digriz.org.uk Assigned to:
Priority: minor Milestone:
Component: madwifi: documentation Version: trunk
Keywords: regdomain ath_info Cc:
Patch is attached: 0 Pending: 0

Description

For those plagued with an ill-regioned wifi card such as mine (was in 0x3A, for the US):

0c:00.0 Ethernet controller: Atheros Communications Inc. AR242x 802.11abg Wireless PCI Express Adapter (rev 01)
        Subsystem: Fujitsu Limited. Device 139c
        Flags: bus master, fast devsel, latency 0, IRQ 18
        Memory at fc200000 (64-bit, non-prefetchable) [size=64K]
        Capabilities: <access denied>
        Kernel driver in use: ath_pci
        Kernel modules: ath_pci

Running the following works nicely. I finally have channel 13...."welcome to jolly ol' england lappy":

ath_info -v -g 3:0 -w fc200000 regdomain 0x00

Some possible interesting spiel:

berk:/home/alex# ath_info -v fc200000 
#DBG main: sleep_ctl reg 00000000   reset_ctl reg 00000000
 -==Device Information==-
MAC Revision: 5414  (0xa3)
Warning: Invalid EEPROM Magic number!
Device type:  3
5GHz PHY Revision: 5424  (0xa2)
2GHz PHY Revision: 5424  (0xa2)

/============== EEPROM Information =============\
| EEPROM Version:   5.3 | EEPROM Size:   4 kbit |
| EEMAP:              2 | Reg. Domain:     0x00 |
|================= Capabilities ================|
| 802.11a Support:  yes | Turbo-A disabled: yes |
| 802.11b Support:  yes | Turbo-G disabled: yes |
| 802.11g Support:  yes | 2GHz XR disabled: no  |
| RFKill  Support:  yes | 5GHz XR disabled: no  |
| 32kHz   Crystal:  no  |                       |
\===============================================/
[snipped]
GPIO registers: CR 0x00000303, DO 0x00000000, DI 0x00000008
STA_ID0: 00:1b:9e:6b:f6:df
STA_ID1: 0x1a80dff6, AP: 0, IBSS: 0, KeyCache Disable: 0
TIMER0: 0x00002834, TBTT: 10292, TU: 0x00012834
TIMER1: 0x000141df, DMAb: 10299, TU: 0x0001283b (+7)
TIMER2: 0x01ffffff, SWBA: 65535, TU: 0x003fffff (+4118475)
TIMER3: 0x0000286d, ATIM: 10349, TU: 0x0001286d (+57)
TSF: 0x0000000004a05a48, TSFTU: 10262, TU: 0x00012816
BEACON: 0x00000064
LAST_TSTP: 0x049ed18d

Thanks for the great work folks.

Cheers

Alex

Change History

11/10/08 22:02:25 changed by jc@praud.com

Hi,

I'm not so lucky with my eeepc (bought in France and not set for french regulations) :

root@nyarlathotep:/root/madwifi-hal-0.10.5.6-r3875-20081105/tools/ath_info# ./ath_info -v -g 3:0 -w 0xfbef0000 regdomain 0x00
#DBG main: sleep_ctl reg 00000000   reset_ctl reg 00000000
 -==Device Information==-
MAC Revision: 2425  (0xe2)
Warning: Invalid EEPROM Magic number!
Device type:  3

/============== EEPROM Information =============\
| EEPROM Version:   5.3 | EEPROM Size:   4 kbit |
| EEMAP:              2 | Reg. Domain:     0x60 |
|================= Capabilities ================|
| 802.11a Support:  no  | Turbo-A disabled: yes |
| 802.11b Support:  no  | Turbo-G disabled: yes |
| 802.11g Support:  yes | 2GHz XR disabled: yes |
| RFKill  Support:  yes | 5GHz XR disabled: yes |
| 32kHz   Crystal:  no  |                       |
\===============================================/

/=========================================================\
|          Calibration data common for all modes          |
|=========================================================|
|          CCK/OFDM gain delta:             1             |
|          CCK/OFDM power delta:            5             |
|          Scaled CCK delta:                5             |
|          2GHz Antenna gain:               1             |
|          5GHz Antenna gain:               4             |
|          Turbo 2W maximum dBm:           38             |
|          Target power start:          0x16e             |
|          EAR Start:                   0x1b8             |
\=========================================================/

/=========================================================\
|          Calibration data for 802.11g operation         |
|=========================================================|
| I power:              0x00 | Q power:              0x0f |
| Use fixed bias:       0x01 | Max turbo power:      0x26 |
| Max XR power:         0x20 | Switch Settling Time: 0x28 |
| Tx/Rx attenuation:    0x19 | TX end to XLNA On:    0x00 |
| TX end to XPA Off:    0x00 | TX end to XPA On:     0x0e |
| 62db Threshold:       0x1c | XLNA gain:            0x00 |
| XPD:                  0x01 | XPD gain:             0x0a |
| I gain:               0x00 | Tx/Rx margin:         0x01 |
| False detect backoff: 0x00 | Noise Floor Threshold:  -1 |
| ADC desired size:      -38 | PGA desired size:      -80 |
|=========================================================|
| Antenna control   0:  0x00 | Antenna control   1:  0x01 |
| Antenna control   2:  0x22 | Antenna control   3:  0x22 |
| Antenna control   4:  0x00 | Antenna control   5:  0x00 |
| Antenna control   6:  0x02 | Antenna control   7:  0x21 |
| Antenna control   8:  0x21 | Antenna control   9:  0x00 |
| Antenna control  10:  0x00 | Antenna control  11:  0x02 |
|=========================================================|
| Octave Band 0:           3 | db 0:                    3 |
| Octave Band 1:           4 | db 1:                    4 |
| Octave Band 2:           0 | db 2:                    0 |
| Octave Band 3:           0 | db 3:                    0 |
\=========================================================/
/==================== Turbo mode infos ===================\
| Switch Settling time: 0x28 | Tx/Rx margin:         0x01 |
| Tx/Rx attenuation:    0x19 | ADC desired size:      -32 |
| PGA desired size:      -80 |                            |
\=========================================================/
/============== Per rate power calibration ===========\
| Freq | 6-24Mbit/s | 36Mbit/s |  48Mbit/s | 54Mbit/s |
|======|============|==========|===========|==========|
| 2412 |    16.00   |  15.00   |   14.00   |  13.00   |
|======|============|==========|===========|==========|
| 2437 |    16.00   |  15.00   |   14.00   |  13.00   |
|======|============|==========|===========|==========|
| 2472 |    16.00   |  15.00   |   14.00   |  13.00   |
\=====================================================/
/====================== Per channel power calibration ===================\
| Freq |  pwr_i  |    pwr_0    |    pwr_1    |    pwr_2    |    pwr_3    |
|      | pddac_i |   pddac_0   |   pddac_1   |   pddac_2   |   pddac_3   |
|======|=========|=============|=============|=============|=============|
| 2412 |         |             |             |             |             |
|------|---------|-------------|-------------|-------------|-------------|
|      |     0   |     4.00    |     8.50    |    13.00    |     0.00    |
|      |    10   |       15    |       27    |       52    |        0    |
|------|---------|-------------|-------------|-------------|-------------|
|      |    10   |    12.50    |    16.00    |    19.00    |    21.50    |
|      |     6   |       13    |       25    |       41    |       56    |
|======|=========|=============|=============|=============|=============|
| 2472 |         |             |             |             |             |
|------|---------|-------------|-------------|-------------|-------------|
|      |     0   |     4.50    |     9.00    |    12.00    |     0.00    |
|      |    10   |       15    |       20    |       34    |        0    |
|------|---------|-------------|-------------|-------------|-------------|
|      |    10   |    12.50    |    15.00    |    18.00    |    21.50    |
|      |     4   |        8    |       15    |       27    |       40    |
|======|=========|=============|=============|=============|=============|
| 2484 |         |             |             |             |             |
|------|---------|-------------|-------------|-------------|-------------|
|      |     0   |     4.00    |     8.50    |    13.00    |     0.00    |
|      |    10   |       15    |       20    |       41    |        0    |
|------|---------|-------------|-------------|-------------|-------------|
|      |    10   |    14.00    |    16.00    |    19.50    |    21.50    |
|      |     7   |       12    |       19    |       33    |       41    |
\========================================================================/

GPIO registers: CR 0x0000000c, DO 0x00000002, DI 0x00000003
#DBG main: old GPIO CR 0000000c DO 00000002 DI 00000003
#DBG main: GPIO CR c -> cc
#DBG main: new GPIO CR 000000cc DO 00000002 DI 00000003
           regdomain (0x00bf) := 0x0000
WARNING: The write function may easy brick your device or
violate state regulation on frequency usage.
Proceed on your own risk!
Shall I write the above value(s)? (y/n)
y
#DBG do_write_pairs: writing *0x00bf := 0x0000
#ERR do_write_pairs: offset 0x00bf: wrote 0x0000 but read 0x0060
#DBG main: restoring GPIO CR cc -> c


So no channel>11, it kills about 1/2 of wifi lans in France :( (murphy's law ponderated) I thought it was due to the magic number warning, but you have it, too...

Regards,

JC

11/10/08 23:19:13 changed by jc@praud.com

It worked with:

./ath_info -v -g 1:0 -w 0xfbef0000 regdomain 0x00

now works well on channels>11 :)

Regards,