Giter Site home page Giter Site logo

rsa9000 / atheepmgr Goto Github PK

View Code? Open in Web Editor NEW
20.0 3.0 8.0 381 KB

Atheros EEPROM manager, utility to dump and update the EEPROM content of Atheros based wireless NICs

License: ISC License

Makefile 0.38% C 99.62%
atheros qualcomm-atheros qca nic wireless ar5xxx ar9xxx qca9xxx eeprom

atheepmgr's Introduction

atheepmgr: Atheros EEPROM manager

This is a utility to dump and update the EEPROM content of Atheros based wireless NICs.

atheepmgr supports several operations such as parsing and printing the EEPROM content, updating the EEPROM contents and so on. The utility can access EEPROM content of a real NIC and can works with EEPROM data that has been dumped to the file. You can find a few usage examples below.

The following EEPROM content access techniques are supported:

  • via driver specific debug interface (using Linux ath9k/ath10k drivers)
  • via mapping of the PCI device I/O region (using libpciaccess)
  • via mapping of the directly specified device I/O region
  • file dump

The following OS(s) are tested/supported:

  • FreeBSD
  • GNU/Linux
  • OpenBSD

Warning

Using the utility may be potentially dangerous for your hardware and may cause a local laws violation. The utility is intended for use by qualified software developers and (or) radio engineers. So the

DISCLAIMER

The author(s) are in no case responsible for damaged hardware or violation of local laws by operating modified hardware.

Building

Utility building as simple as typing make (or gmake on BSD platforms). Builing requirements:

  • gcc
  • GNU make
  • pkg-config (optional, used only to build with libpciaccess support)
  • libpciaccess (optional, allows accessing PCI devices by specifing its location, e.g. bus and device numbers)

Usage examples

Print EEPROM content of PCI device

Accessing the device which was specified by its address at PCI bus is probably the most simple accessing method.

Example: to print the EEPROM content of a wireless NIC, which is located at PCI bus #1 device #3 just run:

# atheepmgr -P 1:3

NB: to access a hardware as a PCI device you should build the utility with the libpciaccess library support.

Print EEPROM content of device with known I/O region

Accessing the device's EEPROM by directly specifying the device I/O memory location can be useful for embedded platforms where using the libpciaccess library could be an overkill.

Example: print EEPROM content of an AR9220 based device, which I/O region starts at 0x21000000:

# atheepmgr -t AR9220 -M 0x21000000

or

# atheepmgr -t PCI:0029 -M 0x21000000

NB: Former form is useful when you do not know an exact chip type, but you are still able to obtain PCI Device Id via some side interface (e.g. pciconf(8), lspci(8) or pcidump(8) utility, or Linux sysfs). NB: To obtain the device I/O region location you can examine the output of the dmesg(1) command (or check the /proc/iomem file on GNU/Linux based platforms) .

Parse and print contents of an EEPROM file dump

Useful option for (re-) checking NIC configuration without really attaching it to a host.

Example: print data from a EEPROM dump in file eep.bin, which was extracted earlier from a AR9220 based wireless NIC:

# atheepmgr -t 5416 -F eep.bin

or using chip name instead of EEPROM map (layout) name:

# atheepmgr -t AR9220 -F eep.bin

NB: chip autodetection is not supported for file access, so you should specifiy EEPROM map (layout) or chip name manually. To see a full list of supported EEPROM maps use a -h option.

Print EEPROM content of a network interface via driver

NB: at the moment only Linux ath9k/ath10k debug interfaces are supported, you driver should be build with enabled debugfs support (true for OpenWrt distro).

This access method useful in case of your Linux kernel blocks device I/O memory access via the /dev/mem. To access device EEPROM you should specify either network interface:

# atheepmgr -t 5415 -D wlan0

or Linux ieee80211 phy name:

# atheepmgr -t 5416 -D phy1

Dump NIC EEPROM content to the file

Example: preserve a wireless NIC EEPROM content to the eep.bin file

# atheepmgr -t PCI:0029 -M 0x21000000 save eep.bin

TODO

  • Make the utility more scripts-friendly by adding an option to print EEPROM content in a more structured format
  • Add a support for loading a file content to the NIC EEPROM to restore somewhere corrupted EEPROM data
  • Add a support for automatically enable and wake-up the chip if it not yet active (e.g. if driver is not loaded, or if network interface is DOWN)
  • Add option to modify RfSilent settings

EEPROM info sources

History

Originally based on the edump utility from https://github.com/mcgrof/qca-swiss-army-knife project and then hardly reworked to add support for legacy chips, EEPROM modification, file dumps and so on.

License

This project is licensed under the terms of the ISC license. See the LICENSE file for license rights and limitations.

atheepmgr's People

Contributors

leo-pl avatar rsa9000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

atheepmgr's Issues

Support for AR9271

I am trying to read the EEPROM for an ALfa AWUS036NHA wifi adapter.
The output of lsusb is:

Bus 001 Device 006: ID 0cf3:9271 Qualcomm Atheros Communications AR9271 802.11n

I then try to run this tool with these arguments. The alfa card is wlan1

./atheepmgr -t AR9271 -D wlan1

In which case I get the output "Unknown EEPROM map type or chip name or chip Id: AR9271"

Is this card supported?

AR9380 mini pcie card - unable to read eeprom (32 bit PowerPC - bigendian)

Hi,

Thanks for writing this tool!

I have an AR9380 mini pcie card on a PowerPC 32bit system (openwrt - netgear wndap660).

I've tried to use the tool both directly via PCI (with the ath9k kernel modules unloaded):

root@wifi_660_1:~# /tmp/atheepmgr -v -t PCI:0030 -P 43:0 
Found Device: 168c:0030 (AR9380/AR9381/QCA9381/AR9382/AR9388/AR9390/AR9392)
Try to map 00000000-0001ffff I/O region to the process memory
Mapped IO region at: 0xb7be5000
Atheros AR???? MAC/BB (SREV: 0xff031c00)
Unable to configure chip GPIO support
Unable to determine EEPROM unlocking GPIO, the feature will be disabled
Unable to select EEPROM access ops due to unknown chip
No suitable data source in available via configured connector
Freeing Mapped IO region at: 0xb7be5000

... and also through the wireless device - both without luck:

root@wifi_660_1:~# /tmp/atheepmgr -v -D wlan0 -t 9300
Atheros AR9300 MAC/BB Rev:3 (SREV: 0x001c03ff)
EEPROM access ops: use AR9xxx ops
OTP access ops: use AR93xx ops
Use byteswapped EEPROM I/O
EEPROM magic found
Trying EEPROM access at Address 0x03ff
Found block at 3ff: comp=1 ref=21 length=1569 major=3 minor=34
Skipping bad header
Found block at 3fb: comp=0 ref=27 length=26 major=8 minor=5
Skipping block with bad checksum (got 0x0783, expect 0x030d)
Found block at 3f7: comp=5 ref=18 length=1353 major=12 minor=66
Skipping bad header
Found block at 3f3: comp=2 ref=14 length=517 major=4 minor=84
Skipping block with bad checksum (got 0x7c33, expect 0x1e16)
Found block at 3ef: comp=1 ref=14 length=1109 major=4 minor=78
Skipping bad header
Found block at 3eb: comp=2 ref=23 length=1349 major=3 minor=32
Skipping bad header
Found block at 3e7: comp=1 ref=13 length=1075 major=0 minor=52
Skipping bad header
Found block at 3e3: comp=2 ref=5 length=1255 major=2 minor=0
Skipping bad header
Found block at 3df: comp=0 ref=14 length=1776 major=13 minor=3
Skipping bad header
Found block at 3db: comp=0 ref=6 length=320 major=7 minor=8
Skipping block with bad checksum (got 0x4fbf, expect 0x0303)
Found block at 3d7: comp=0 ref=5 length=1280 major=0 minor=0
Skipping bad header
Found block at 3d3: comp=3 ref=6 length=1632 major=13 minor=6
Skipping bad header
Found block at 3cf: comp=1 ref=5 length=58 major=4 minor=0
Skipping block with bad checksum (got 0x127a, expect 0xac09)
Found block at 3cb: comp=0 ref=1 length=288 major=7 minor=205
Skipping block with bad checksum (got 0x47c3, expect 0x9103)
Found block at 3c7: comp=0 ref=1 length=16 major=8 minor=33
Skipping block with bad checksum (got 0x077a, expect 0x0091)
Found block at 3c3: comp=6 ref=62 length=1512 major=9 minor=112
Skipping bad header
Found block at 3bf: comp=7 ref=57 length=553 major=3 minor=0
Skipping block with bad checksum (got 0x77ec, expect 0x1c1a)
Found block at 3bb: comp=0 ref=3 length=48 major=0 minor=251
Skipping block with bad checksum (got 0x0d72, expect 0x2222)
Found block at 3b7: comp=0 ref=35 length=319 major=13 minor=3
Skipping block with bad checksum (got 0x4f13, expect 0xe08f)
Found block at 3b3: comp=4 ref=17 length=0 major=3 minor=3
Skipping block with bad checksum (got 0x0000, expect 0xf700)
Found block at 3af: comp=0 ref=32 length=1904 major=3 minor=145
Skipping bad header
Found block at 3ab: comp=7 ref=24 length=57 major=0 minor=0
Skipping block with bad checksum (got 0x0b17, expect 0x221c)
Found block at 3a7: comp=0 ref=3 length=48 major=0 minor=249
Skipping block with bad checksum (got 0x0992, expect 0x1c1a)
Found block at 3a3: comp=0 ref=35 length=255 major=6 minor=3
Skipping block with bad checksum (got 0x3c01, expect 0x0003)
Found block at 39f: comp=4 ref=19 length=0 major=3 minor=3
Skipping block with bad checksum (got 0x0000, expect 0xf700)
Found block at 39b: comp=0 ref=32 length=1904 major=3 minor=146
Skipping bad header
Found block at 397: comp=7 ref=24 length=57 major=2 minor=0
Skipping block with bad checksum (got 0x070f, expect 0x1e1c)
Found block at 393: comp=0 ref=1 length=64 major=9 minor=172
Skipping block with bad checksum (got 0x0781, expect 0x201e)
Found block at 38f: comp=1 ref=2 length=1202 major=2 minor=34
Skipping bad header
Found block at 38b: comp=1 ref=2 length=546 major=2 minor=34
Skipping block with bad checksum (got 0x6dd7, expect 0x1a18)
Found block at 387: comp=1 ref=2 length=545 major=14 minor=34
Skipping block with bad checksum (got 0x6d9f, expect 0x1616)
Found block at 383: comp=1 ref=2 length=417 major=14 minor=34
Skipping block with bad checksum (got 0x6149, expect 0x201a)
Found block at 37f: comp=1 ref=2 length=417 major=14 minor=34
Skipping block with bad checksum (got 0x613b, expect 0x1a1e)
Found block at 37b: comp=1 ref=2 length=417 major=14 minor=32
Skipping block with bad checksum (got 0x6133, expect 0x1a18)
Found block at 377: comp=0 ref=26 length=449 major=14 minor=24
Skipping block with bad checksum (got 0x643d, expect 0x1612)
Found block at 373: comp=0 ref=26 length=449 major=14 minor=24
Skipping block with bad checksum (got 0x6423, expect 0x1614)
Found block at 36f: comp=0 ref=26 length=450 major=2 minor=24
Skipping block with bad checksum (got 0x6413, expect 0x1016)
Found block at 36b: comp=0 ref=30 length=513 major=10 minor=28
Skipping block with bad checksum (got 0x6a0f, expect 0x1816)
Found block at 367: comp=0 ref=30 length=385 major=10 minor=28
Skipping block with bad checksum (got 0x5dc3, expect 0x1c1c)
Found block at 363: comp=0 ref=30 length=385 major=10 minor=28
Skipping block with bad checksum (got 0x5dbf, expect 0x201a)
Found block at 35f: comp=1 ref=2 length=385 major=14 minor=32
Skipping block with bad checksum (got 0x5db5, expect 0x1a1e)
Found block at 35b: comp=0 ref=26 length=449 major=14 minor=24
Skipping block with bad checksum (got 0x63a7, expect 0x1c14)
Found block at 357: comp=0 ref=26 length=449 major=14 minor=24
Skipping block with bad checksum (got 0x639f, expect 0x1c1a)
Found block at 353: comp=0 ref=26 length=450 major=0 minor=24
Skipping block with bad checksum (got 0x63af, expect 0x161a)
Found block at 34f: comp=0 ref=30 length=513 major=8 minor=28
Skipping block with bad checksum (got 0x698f, expect 0x1412)
Found block at 34b: comp=0 ref=30 length=321 major=8 minor=28
Skipping block with bad checksum (got 0x56f5, expect 0x1e16)
Found block at 347: comp=0 ref=30 length=321 major=8 minor=28
Skipping block with bad checksum (got 0x56fb, expect 0x1e1c)
Found block at 343: comp=0 ref=11 length=49 major=12 minor=30
Skipping block with bad checksum (got 0x0cc5, expect 0x7f8e)
Found block at 33f: comp=0 ref=20 length=385 major=12 minor=30
Skipping block with bad checksum (got 0x5db9, expect 0x1614)
Found block at 33b: comp=0 ref=20 length=385 major=12 minor=30
Skipping block with bad checksum (got 0x5dad, expect 0x1414)
Found block at 337: comp=0 ref=3 length=385 major=14 minor=11
Skipping block with bad checksum (got 0x5dc1, expect 0x1612)
Found block at 333: comp=0 ref=24 length=449 major=14 minor=20
Skipping block with bad checksum (got 0x63b5, expect 0x1c18)
Found block at 32f: comp=0 ref=24 length=449 major=14 minor=20
Skipping block with bad checksum (got 0x63b1, expect 0x181a)
Found block at 32b: comp=0 ref=24 length=448 major=1 minor=15
Skipping block with bad checksum (got 0x63b9, expect 0x161a)
Found block at 327: comp=0 ref=3 length=1959 major=10 minor=9
Skipping bad header
Found block at 323: comp=3 ref=48 length=551 major=10 minor=117
Skipping block with bad checksum (got 0x81b1, expect 0x6690)
Found block at 31f: comp=3 ref=58 length=552 major=4 minor=127
Skipping block with bad checksum (got 0x81f9, expect 0x9eae)
Found block at 31b: comp=0 ref=1 length=128 major=3 minor=184
Skipping block with bad checksum (got 0x2985, expect 0x0303)
Found block at 317: comp=5 ref=24 length=599 major=5 minor=112
Skipping block with bad checksum (got 0x9180, expect 0x1454)
Found block at 313: comp=5 ref=56 length=711 major=15 minor=112
Skipping block with bad checksum (got 0xf3d0, expect 0x00ff)
Found block at 30f: comp=5 ref=44 length=231 major=15 minor=112
Skipping block with bad checksum (got 0x44ef, expect 0x1a1a)
Found block at 30b: comp=5 ref=44 length=71 major=15 minor=112
Skipping block with bad checksum (got 0x1299, expect 0x6c44)
Found block at 307: comp=5 ref=44 length=71 major=15 minor=122
Skipping block with bad checksum (got 0x11b5, expect 0xbd7c)
Found block at 303: comp=5 ref=34 length=69 major=12 minor=27
Skipping block with bad checksum (got 0x1151, expect 0xeda4)
Found block at 2ff: comp=1 ref=0 length=1478 major=8 minor=27
Skipping bad header
Found block at 2fb: comp=0 ref=26 length=1670 major=8 minor=27
Skipping bad header
Found block at 2f7: comp=0 ref=26 length=1669 major=11 minor=25
Skipping bad header
Found block at 2f3: comp=0 ref=21 length=1456 major=1 minor=3
Skipping bad header
Found block at 2ef: comp=0 ref=3 length=1991 major=12 minor=5
Skipping bad header
Found block at 2eb: comp=3 ref=28 length=967 major=12 minor=60
Skipping bad header
Found block at 2e7: comp=0 ref=24 length=53 major=5 minor=124
Skipping block with bad checksum (got 0x0ff6, expect 0x9003)
Found block at 2e3: comp=2 ref=21 length=1365 major=11 minor=21
Skipping bad header
Found block at 2df: comp=2 ref=27 length=421 major=11 minor=27
Skipping block with bad checksum (got 0x4ce1, expect 0x100e)
Found block at 2db: comp=2 ref=27 length=405 major=9 minor=27
Skipping block with bad checksum (got 0x4b3f, expect 0x1410)
Found block at 2d7: comp=2 ref=25 length=1433 major=0 minor=25
Skipping bad header
Found block at 2d3: comp=0 ref=0 length=154 major=10 minor=0
Skipping block with bad checksum (got 0x3092, expect 0xc522)
Found block at 2cf: comp=0 ref=42 length=672 major=4 minor=13
Skipping block with bad checksum (got 0xe4cc, expect 0x4040)
Found block at 2cb: comp=0 ref=15 length=997 major=8 minor=80
Skipping bad header
Found block at 2c7: comp=0 ref=1 length=273 major=13 minor=222
Skipping block with bad checksum (got 0x3c1e, expect 0x1612)
Found block at 2c3: comp=1 ref=23 length=32 major=14 minor=68
Skipping block with bad checksum (got 0x0b53, expect 0xed00)
Found block at 2bf: comp=3 ref=12 length=152 major=12 minor=124
Skipping block with bad checksum (got 0x2e90, expect 0x1c1a)
Found block at 2bb: comp=5 ref=61 length=590 major=13 minor=205
Skipping block with bad checksum (got 0xb734, expect 0xffff)
Found block at 2b7: comp=4 ref=17 length=0 major=3 minor=3
Skipping block with bad checksum (got 0x0000, expect 0xf000)
Found block at 2b3: comp=0 ref=32 length=1792 major=3 minor=145
Skipping bad header
Found block at 2af: comp=7 ref=22 length=57 major=0 minor=0
Skipping block with bad checksum (got 0x115e, expect 0x9003)
Found block at 2ab: comp=0 ref=3 length=48 major=0 minor=244
Skipping block with bad checksum (got 0x0e09, expect 0xe900)
Found block at 2a7: comp=0 ref=35 length=287 major=1 minor=3
Skipping block with bad checksum (got 0x350d, expect 0x1c1a)
Found block at 2a3: comp=4 ref=15 length=0 major=3 minor=3
Skipping block with bad checksum (got 0x0000, expect 0xed00)
Found block at 29f: comp=0 ref=32 length=1744 major=3 minor=143
Skipping bad header
Found block at 29b: comp=7 ref=7 length=56 major=15 minor=0
Skipping block with bad checksum (got 0x1056, expect 0x03ea)
Found block at 297: comp=0 ref=3 length=48 major=0 minor=228
Skipping block with bad checksum (got 0x0dec, expect 0xeb00)
Found block at 293: comp=0 ref=35 length=254 major=4 minor=3
Skipping block with bad checksum (got 0x2dd9, expect 0x161c)
Found block at 28f: comp=4 ref=17 length=0 major=3 minor=3
Skipping block with bad checksum (got 0x0000, expect 0xe500)
Found block at 28b: comp=0 ref=32 length=1616 major=3 minor=145
Skipping bad header
Found block at 287: comp=7 ref=9 length=57 major=0 minor=0
Skipping block with bad checksum (got 0x1137, expect 0x9103)
Found block at 283: comp=0 ref=3 length=48 major=0 minor=234
Skipping block with bad checksum (got 0x0df4, expect 0xe200)
Found block at 27f: comp=0 ref=35 length=270 major=9 minor=3
Skipping block with bad checksum (got 0x2b5c, expect 0x141c)
Found block at 27b: comp=4 ref=16 length=0 major=3 minor=3
Skipping block with bad checksum (got 0x0000, expect 0xe900)
Found block at 277: comp=0 ref=32 length=1680 major=3 minor=143
Skipping bad header
Found block at 273: comp=7 ref=0 length=57 major=0 minor=0
Skipping block with bad checksum (got 0x1273, expect 0x22a0)
Trying EEPROM access at Address 0x01ff
Found block at 1ff: comp=0 ref=26 length=449 major=12 minor=24
Skipping block with bad checksum (got 0xac8d, expect 0x0117)
Found block at 1fb: comp=0 ref=24 length=418 major=0 minor=22
Skipping block with bad checksum (got 0x9b1f, expect 0xffff)
Found block at 1f7: comp=0 ref=30 length=481 major=10 minor=28
Skipping block with bad checksum (got 0xb097, expect 0x1250)
Found block at 1f3: comp=0 ref=30 length=385 major=10 minor=28
Skipping block with bad checksum (got 0x815a, expect 0xffff)
Found block at 1ef: comp=0 ref=28 length=385 major=8 minor=26
Skipping block with bad checksum (got 0x84f0, expect 0xffff)
Found block at 1eb: comp=1 ref=0 length=353 major=14 minor=30
Skipping block with bad checksum (got 0x689a, expect 0xffff)
Found block at 1e7: comp=0 ref=26 length=449 major=14 minor=24
Skipping block with bad checksum (got 0xad3b, expect 0x1b01)
Found block at 1e3: comp=0 ref=26 length=449 major=12 minor=24
Skipping block with bad checksum (got 0xacf3, expect 0x0040)
Found block at 1df: comp=0 ref=24 length=418 major=0 minor=22
Skipping block with bad checksum (got 0xa948, expect 0x3f01)
Found block at 1db: comp=0 ref=30 length=481 major=10 minor=28
Skipping bad header
Found block at 1d7: comp=0 ref=30 length=385 major=10 minor=28
Skipping block with bad checksum (got 0x9a4a, expect 0xffff)
Found block at 1d3: comp=0 ref=28 length=385 major=8 minor=26
Skipping block with bad checksum (got 0x9de0, expect 0xffff)
Found block at 1cf: comp=1 ref=0 length=353 major=12 minor=30
Skipping block with bad checksum (got 0x818c, expect 0xffff)
Found block at 1cb: comp=0 ref=24 length=417 major=12 minor=22
Skipping block with bad checksum (got 0xa9a1, expect 0x402e)
Found block at 1c7: comp=0 ref=24 length=417 major=10 minor=22
Skipping block with bad checksum (got 0xa9ef, expect 0x1b01)
Found block at 1c3: comp=0 ref=22 length=385 major=12 minor=20
Skipping block with bad checksum (got 0xa525, expect 0x9025)
Found block at 1bf: comp=0 ref=26 length=417 major=6 minor=24
Skipping block with bad checksum (got 0xa994, expect 0x7c00)
Found block at 1bb: comp=0 ref=26 length=321 major=6 minor=24
Skipping block with bad checksum (got 0x73b6, expect 0xffff)
Found block at 1b7: comp=0 ref=24 length=321 major=4 minor=22
Skipping block with bad checksum (got 0x775c, expect 0xffff)
Found block at 1b3: comp=0 ref=26 length=289 major=6 minor=24
Skipping block with bad checksum (got 0x5b1e, expect 0xffff)
Found block at 1af: comp=0 ref=18 length=321 major=6 minor=16
Skipping block with bad checksum (got 0x7eae, expect 0xffff)
Found block at 1ab: comp=0 ref=18 length=321 major=6 minor=16
Skipping block with bad checksum (got 0x825e, expect 0xffff)
Found block at 1a7: comp=0 ref=18 length=321 major=14 minor=16
Skipping block with bad checksum (got 0x8606, expect 0xffff)
Found block at 1a3: comp=0 ref=28 length=449 major=8 minor=26
Skipping bad header
Found block at 19f: comp=0 ref=28 length=353 major=8 minor=26
Skipping block with bad checksum (got 0xa331, expect 0x0117)
Found block at 19b: comp=0 ref=26 length=353 major=6 minor=24
Skipping block with bad checksum (got 0xa336, expect 0x0057)
Found block at 197: comp=0 ref=30 length=321 major=12 minor=28
Skipping block with bad checksum (got 0x9460, expect 0xffff)
Found block at 193: comp=0 ref=24 length=417 major=12 minor=22
Skipping bad header
Found block at 18f: comp=0 ref=24 length=417 major=10 minor=22
Skipping bad header
Found block at 18b: comp=0 ref=22 length=385 major=14 minor=20
Skipping block with bad checksum (got 0xa8aa, expect 0x0350)
Found block at 187: comp=0 ref=28 length=449 major=8 minor=26
Skipping bad header
Found block at 183: comp=0 ref=28 length=353 major=8 minor=26
Skipping block with bad checksum (got 0xa3cf, expect 0x0040)
Found block at 17f: comp=0 ref=26 length=353 major=6 minor=24
Skipping block with bad checksum (got 0xa3b4, expect 0x7c00)
Found block at 17b: comp=0 ref=30 length=321 major=12 minor=28
Skipping block with bad checksum (got 0xa010, expect 0x0057)
Found block at 177: comp=0 ref=24 length=417 major=12 minor=22
Skipping bad header
Found block at 173: comp=0 ref=24 length=417 major=10 minor=22
Skipping bad header
Found block at 16f: comp=0 ref=22 length=385 major=12 minor=20
Skipping bad header
Found block at 16b: comp=0 ref=26 length=417 major=8 minor=26
Skipping bad header
Found block at 167: comp=0 ref=26 length=353 major=8 minor=26
Skipping block with bad checksum (got 0xa57b, expect 0x5a00)
Found block at 163: comp=0 ref=26 length=353 major=6 minor=24
Skipping bad header
Found block at 15f: comp=0 ref=28 length=321 major=10 minor=26
Skipping block with bad checksum (got 0xa09c, expect 0x7c00)
Found block at 15b: comp=0 ref=22 length=385 major=10 minor=20
Skipping bad header
Found block at 157: comp=0 ref=22 length=385 major=8 minor=20
Skipping bad header
Found block at 153: comp=0 ref=20 length=353 major=10 minor=18
Skipping bad header
Found block at 14f: comp=0 ref=24 length=385 major=4 minor=22
Skipping bad header
Found block at 14b: comp=0 ref=24 length=289 major=4 minor=22
Skipping block with bad checksum (got 0x9dcd, expect 0x402e)
Found block at 147: comp=0 ref=22 length=289 major=2 minor=20
Skipping block with bad checksum (got 0x9e2f, expect 0x1b01)
Found block at 143: comp=0 ref=24 length=257 major=4 minor=22
Skipping block with bad checksum (got 0x9971, expect 0x9025)
Found block at 13f: comp=0 ref=16 length=289 major=4 minor=14
Skipping block with bad checksum (got 0x9dfe, expect 0x7c00)
Found block at 13b: comp=0 ref=0 length=289 major=0 minor=6
Skipping block with bad checksum (got 0x9f12, expect 0x0102)
Found block at 137: comp=0 ref=20 length=225 major=0 minor=18
Skipping block with bad checksum (got 0x8bec, expect 0xffff)
Found block at 133: comp=0 ref=10 length=229 major=0 minor=14
Skipping block with bad checksum (got 0x936e, expect 0xffff)
Found block at 12f: comp=2 ref=28 length=1419 major=13 minor=180
Skipping bad header
Found block at 12b: comp=6 ref=45 length=1045 major=8 minor=76
Skipping bad header
Found block at 127: comp=4 ref=12 length=1483 major=13 minor=180
Skipping bad header
Found block at 123: comp=0 ref=38 length=1050 major=14 minor=40
Skipping bad header
Found block at 11f: comp=6 ref=39 length=1013 major=4 minor=76
Skipping bad header
Found block at 11b: comp=3 ref=24 length=1674 major=0 minor=140
Skipping bad header
Found block at 117: comp=6 ref=45 length=917 major=4 minor=76
Skipping bad header
Found block at 113: comp=3 ref=24 length=1674 major=0 minor=140
Skipping bad header
Found block at 10f: comp=6 ref=45 length=917 major=4 minor=76
Skipping bad header
Found block at 10b: comp=3 ref=24 length=1674 major=0 minor=140
Skipping bad header
Found block at 107: comp=6 ref=45 length=917 major=8 minor=76
Skipping bad header
Found block at 103: comp=4 ref=12 length=1483 major=4 minor=144
Skipping bad header
Found block at ff: comp=6 ref=45 length=981 major=8 minor=76
Skipping bad header
Found block at fb: comp=4 ref=12 length=1472 major=6 minor=144
Skipping bad header
Found block at f7: comp=3 ref=6 length=1241 major=6 minor=142
Skipping bad header
Found block at f3: comp=5 ref=46 length=485 major=2 minor=81
Skipping bad header
Found block at ef: comp=2 ref=20 length=1302 major=7 minor=84
Skipping bad header
Found block at eb: comp=1 ref=0 length=1601 major=10 minor=90
Skipping bad header
Found block at e7: comp=2 ref=20 length=1350 major=7 minor=84
Skipping bad header
Found block at e3: comp=1 ref=0 length=1585 major=12 minor=22
Skipping bad header
Found block at df: comp=2 ref=20 length=1349 major=4 minor=84
Skipping bad header
Found block at db: comp=1 ref=0 length=631 major=12 minor=60
Skipping bad header
Found block at d7: comp=3 ref=28 length=967 major=12 minor=60
Skipping bad header
Found block at d3: comp=3 ref=28 length=967 major=12 minor=60
Skipping bad header
Found block at cf: comp=3 ref=28 length=967 major=12 minor=60
Skipping bad header
Found block at cb: comp=3 ref=28 length=967 major=12 minor=60
Skipping bad header
Found block at c7: comp=3 ref=28 length=967 major=12 minor=60
Skipping bad header
Found block at c3: comp=3 ref=28 length=961 major=15 minor=92
Skipping bad header
Found block at bf: comp=2 ref=20 length=1349 major=4 minor=84
Skipping bad header
Found block at bb: comp=0 ref=20 length=1345 major=13 minor=93
Skipping bad header
Found block at b7: comp=2 ref=20 length=1349 major=4 minor=84
Skipping bad header
Found block at b3: comp=0 ref=20 length=1345 major=12 minor=91
Skipping bad header
Found block at af: comp=2 ref=20 length=1349 major=4 minor=84
Skipping bad header
Found block at ab: comp=0 ref=20 length=1356 major=7 minor=30
Skipping bad header
Trying OTP access at Address 0x03ff
Trying OTP access at Address 0x01ff
Unable to load data from any sources

... am I doing something wrong? I can try and remove the card and access it through an x86_64 PC if that would be worth trying?

ath9280 unsupported?

I own a Compex WLE200NX card for which I would like to permanently change the regulatory domain. Thing is, I don't know where to start. I understand I will have to rebuild the kernel (I'm on debian), but then what?

Thanks

Compex WLE900VX

Hi!

I have a Compex VLE900VX as found at this link: https://compex.com.sg/shop/wifi-module/802-11ac-wave-1/wle900vx-2/
In case the first link does not work I bought mine at: https://teklager.se/en/products/router-components/wle900vx-wireless-wifi-kit

When I run the the atheepmgr I encounter the following errors:
me@wrap:~/src/atheepmgr$ sudo ./atheepmgr -v -P 1:0
Found Device: 168c:003c (QCA9860/QCA9862/QCA9880/QCA9882/QCA9890/QCA9892)
Try to map f7200000-f73fffff I/O region to the process memory
Mapped IO region at: 0x7f36cb65c000
Autodetected EEPROM map type is 9880
Atheros QCA9880 MAC/BB Rev:2 (SREV: 0x043202ff)
Unable to select GPIO access ops due to unsupported chip
Chip does not support EEPROM
OTP access ops: use QCA988x ops
Found block at 0: comp=3 ref=1 length=852 major=4 minor=4
can't find reference eeprom struct 1
Bad EEPROM length 0x53f0/0xf053 (expect 0x0844)
EEPROM check failed
Freeing Mapped IO region at: 0x7f36cb65c000

Do I use the program wrong or is my card unsupported?

Relevant parts of output of lspci:

01:00.0 Network controller: Qualcomm Atheros QCA986x/988x 802.11ac Wireless Network Adapter
05:00.0 Network controller: Qualcomm Atheros QCA986x/988x 802.11ac Wireless Network Adapter

As you can see there are two cards in the computer.

Relevant part of syslog:
Aug 25 13:44:00 wrap kernel: [ 19.184833] ath: EEPROM regdomain: 0x0
Aug 25 13:44:00 wrap kernel: [ 19.184853] ath: EEPROM indicates default country code should be used
Aug 25 13:44:00 wrap kernel: [ 19.184882] ath: doing EEPROM country->regdmn map search
Aug 25 13:44:00 wrap kernel: [ 19.184887] ath: country maps to regdmn code: 0x3a
Aug 25 13:44:00 wrap kernel: [ 19.184891] ath: Country alpha2 being used: US
Aug 25 13:44:00 wrap kernel: [ 19.184895] ath: Regpair used: 0x3a

The underlying problem is that my EEPROM indicates that I'm in the US but I live in Sweden and my access point is now using frequencies not allowed here. Earlier I think one could use the ìw reg set` -command to but since upgrading to jammy this does not work. I was hoping to solve this by reprogram the EEPROM to indicate the correct country. Another option could be to compile a custom database for regdom but the database must be signed and this is complication things. The crda-util is, as I understand it - obsolete on Ubuntu Jammy.

I appreciate any guidance, thank you for your time and efforts.
Regards, Lars

I dump a ar9462 card (5bwb222) from 0xf7d00000 but mmap failed?

I dump a ar9462 card (5bwb222) from 0xf7d00000 but mmap failed?

aet also this error.

root@debian:/media/allan/home_data/atheepmgr# ./atheepmgr -M f7d00000 save ar9462.bin
conmem: mmap of device at 0xf7d00000 for 0x00010000 bytes failed: Operation not permitted

Parameter list would be nice

I'm trying to update RegDomain1 on an AR5416 card and for the life of me I can't figure out what's the parameter name that atheepmgr expects. I know that in the EEPROM dump it's RegDomain1 in the base header.

So, I think it's fair to say that if the software could dump a parameter list for the specified map, that would enable users like myself to know which parameter it is they want to update.

Unable to build with libpciaccess on Ubuntu 18.04

I have libpciaccess0 and libpciaccess-dev installed, and building atheepmgr then fails with the following errors:

cc -Wall  -DCONFIG_CON_PCI -DCONFIG_CON_MEM -c atheepmgr.c -o atheepmgr.o
cc -Wall  -DCONFIG_CON_PCI -DCONFIG_CON_MEM -c con_file.c -o con_file.o
cc -Wall  -DCONFIG_CON_PCI -DCONFIG_CON_MEM -c eep_5211.c -o eep_5211.o
cc -Wall  -DCONFIG_CON_PCI -DCONFIG_CON_MEM -c eep_5416.c -o eep_5416.o
cc -Wall  -DCONFIG_CON_PCI -DCONFIG_CON_MEM -c eep_9285.c -o eep_9285.o
cc -Wall  -DCONFIG_CON_PCI -DCONFIG_CON_MEM -c eep_9287.c -o eep_9287.o
cc -Wall  -DCONFIG_CON_PCI -DCONFIG_CON_MEM -c eep_9300.c -o eep_9300.o
cc -Wall  -DCONFIG_CON_PCI -DCONFIG_CON_MEM -c eep_common.c -o eep_common.o
cc -Wall  -DCONFIG_CON_PCI -DCONFIG_CON_MEM -c hw.c -o hw.o
cc -Wall  -DCONFIG_CON_PCI -DCONFIG_CON_MEM -c utils.c -o utils.o
cc -Wall   -DCONFIG_CON_PCI -DCONFIG_CON_MEM -c con_pci.c -o con_pci.o
cc -Wall  -DCONFIG_CON_PCI -DCONFIG_CON_MEM -c con_mem.c -o con_mem.o
cc -lpciaccess atheepmgr.o con_file.o eep_5211.o eep_5416.o eep_9285.o eep_9287.o eep_9300.o eep_common.o hw.o utils.o con_pci.o con_mem.o -o atheepmgr
con_pci.o: In function `pci_device_init':
con_pci.c:(.text+0x1e3): undefined reference to `pci_device_map_range'
con_pci.o: In function `pci_device_cleanup':
con_pci.c:(.text+0x2ae): undefined reference to `pci_device_unmap_range'
con_pci.o: In function `pci_init':
con_pci.c:(.text+0x5f1): undefined reference to `pci_system_init'
con_pci.c:(.text+0x633): undefined reference to `pci_slot_match_iterator_create'
con_pci.c:(.text+0x676): undefined reference to `pci_device_next'
con_pci.c:(.text+0x686): undefined reference to `pci_iterator_destroy'
con_pci.c:(.text+0x6c4): undefined reference to `pci_device_probe'
con_pci.c:(.text+0x744): undefined reference to `pci_system_cleanup'
con_pci.o: In function `pci_clean':
con_pci.c:(.text+0x77c): undefined reference to `pci_system_cleanup'
collect2: error: ld returned 1 exit status
Makefile:47: recipe for target 'atheepmgr' failed
make: *** [atheepmgr] Error 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.