Skip to contentSkip to conversation

ath9k for ar9102 and ar9103, OpenWRT, AP81 router hardware

ath9k-devel Stephen Gutknecht (hilltx) 4 participants 11 messages Dec 17, 2008 – Dec 29, 2008

lore
Share & tools
lore
#0 lore raw

Howdy,

First off, I am not a OpenWRT developer, just a participatory user. However, I'm hoping someone here is also an openwrt user and we can trade source files that I can test on the router hardware and pass results back on to the OpenWRT developers.

I am on the latest development release of OpenWRT; but the included madwifi nor ath9k driver works on these ar9102 or ar9103 adapters. not in client mode, not at all.

First off, do newer updates to ath9k possibly support these chips? Then I can try to update my OpenWRT with the newer source files.

If no drivers exist for the ar9102, can they be adapted? just a matter of a new pci hardware ID or is this a major change?

Any help and tips appreciated. I started a new thread over on the OpenWRT forum:
http://forum.openwrt.org/viewtopic.php?id=18113

Thank you.

#1 lore raw
Quoted 14 lines · Stephen Gutknecht (hilltx)

Howdy,

First off, I am not a OpenWRT developer, just a participatory user. However, I'm hoping someone here is also an openwrt user and we can trade source files that I can test on the router hardware and pass results back on to the OpenWRT developers.

I am on the latest development release of OpenWRT; but the included madwifi nor ath9k driver works on these ar9102 or ar9103 adapters. not in client mode, not at all.

First off, do newer updates to ath9k possibly support these chips? Then I can try to update my OpenWRT with the newer source files.

Quoted 6 lines

If no drivers exist for the ar9102, can they be adapted? just a matter of a new pci hardware ID or is this a major change?

Any help and tips appreciated. I started a new thread over on the OpenWRT forum:
http://forum.openwrt.org/viewtopic.php?id=18113

What is an AR9102 or AR9103? Please see:

http://wireless.kernel.org/en/users/Drivers/ath9k#supportedchipsets

Luis

#2 lore raw
In reply to Stephen Gutknecht (hilltx)

An update to my posting. the ar9102, ar9103, ar9106 used in routers with the AHB bus. Although interest has been stirred up on the OpenWRT side, there so far isn't anyone who has experience with the AHB bus porting.

The router GPL downloads provided by the various sellers come with binary-only madwifi drivers for 2.6.15 kernel (MIPS32). Output includes:

insmod /lib/modules/2.6.15/net/ath_hal.ko
ath_hal: 0.9.17.1 (AR5416, DEBUG, REGOPS_FUNC, WRITE_EEPROM, 11D)

insmod /lib/modules/2.6.15/net/ath_ahb.ko wireless_led_gpio=7
ath_ahb: 0.9.4.5 (Atheros/multi-bss)
Howl Revision ID 0xb4
No MBSSID aggregation support<6>
wifi0: Atheros AR9100 WiSoC: mem=0xb80c0000, irq=2

As you can see, they use the ath_ahb driver. Any overview or details relative to what it will take to adapt the ath9k driver to work with the AHB bus are appreciated. There is enough interest in these drivers that a small bounty and/or hardware donations are on the table. OpenWRT has been fully ported to these routers... all except working wireless drivers.

I can personally put one of these routers on the internet for you running 2.6.27.10 kernel with OpenWRT running (or the original firmware 2.6.15 environment); any poking around to to determine what's needed for drivers would be welcome. Help please ;)

Thank you.

#3 lore raw
Quoted 3 lines · Stephen Gutknecht (hilltx)

As you can see, they use the ath_ahb driver. Any overview or details relative to what it will take to adapt the ath9k driver to work with the AHB bus are appreciated.

The first step would be to take current MadWifi sources, go through the differences between if_ath_ahb.[ch] and if_ath_pci.[ch] and apply those differences to the ath9k driver.

When the modified driver is working with the AHB device, the differences should be restructured to have a PCI module, an AHB module and a common library.

Perhaps there will be some questions that will need to be communicated to Atheros.

Signature · 2 lines
Regards,
Pavel Roskin
#4 lore raw
In reply to Stephen Gutknecht (hilltx)

A major discovery, good news! Through exhaustive searching of every bit I could find about AHB drivers, I stumbled into the source code for the Atheros Radio Testing (ART) for these routers. From my AP81 router (Trendnet TEW-652BRP, DLink DIR-615 C1) running OpenWRT trunk:

root at OpenWrt:/tmp# insmod art.ko
CHIP REV ID: b4
dk_dev_init::status after register_chrdev(dk) = 0
Base Phsycal address :0x180c0000
DK::Add client 0
DK::Reg phy addr = 180c0000 vir Addr = b80c0000
DK::Irq = 2
DK::Allocated 0x200000 bytes memory
DK::memory vir Addr = 80c00000 phy Addr = c00000
Device Status is : 0x11
root at OpenWrt:/tmp# uname -a
Linux OpenWrt 2.6.27.10 #18 Sat Dec 27 13:54:44 CST 2008 mips unknown

The art driver was made for 2.6.15, I updated it to work on newer kernels. It has all the juicy details that an experienced ath9k developer should need to get these chips working.

driver source AP81/AP83:
http://svn.openfoundry.org/jpgdauto/atheros/art_modules_v0_7_b9.tbz

Patch for newer kernels:
http://forum.openwrt.org/viewtopic.php?pid=78718#p78718

Going over the source, I really don't see anything specific to AHB bus. Any experienced ath9k developers who can review the source and comment on this appreciated. Especially tips on where in the ath9k driver I need to be hacking. Bribes of pizza, beer, New Years sparkling wine are on the table ;)

Thank you.

#5 lore raw
Quoted 24 lines · Stephen Gutknecht (hilltx)

A major discovery, good news! Through exhaustive searching of every bit I could find about AHB drivers, I stumbled into the source code for the Atheros Radio Testing (ART) for these routers. From my AP81 router (Trendnet TEW-652BRP, DLink DIR-615 C1) running OpenWRT trunk:

root at OpenWrt:/tmp# insmod art.ko
CHIP REV ID: b4
dk_dev_init::status after register_chrdev(dk) = 0
Base Phsycal address :0x180c0000
DK::Add client 0
DK::Reg phy addr = 180c0000 vir Addr = b80c0000
DK::Irq = 2
DK::Allocated 0x200000 bytes memory
DK::memory vir Addr = 80c00000 phy Addr = c00000
Device Status is : 0x11
root at OpenWrt:/tmp# uname -a
Linux OpenWrt 2.6.27.10 #18 Sat Dec 27 13:54:44 CST 2008 mips unknown

The art driver was made for 2.6.15, I updated it to work on newer kernels. It has all the juicy details that an experienced ath9k developer should need to get these chips working.

Quoted 5 lines

driver source AP81/AP83:
http://svn.openfoundry.org/jpgdauto/atheros/art_modules_v0_7_b9.tbz

Patch for newer kernels:
http://forum.openwrt.org/viewtopic.php?pid=78718#p78718

These should *not* be posted as they are not part of the driver, whoever posted this is violating our license and this will be looked into.

Avoid using this as a source of documentation.

Luis

#6 lore raw
Quoted 31 lines · Luis R. Rodriguez
Quoted 24 lines · Stephen Gutknecht (hilltx)

A major discovery, good news! Through exhaustive searching of every bit I could find about AHB drivers, I stumbled into the source code for the Atheros Radio Testing (ART) for these routers. From my AP81 router (Trendnet TEW-652BRP, DLink DIR-615 C1) running OpenWRT trunk:

root at OpenWrt:/tmp# insmod art.ko
CHIP REV ID: b4
dk_dev_init::status after register_chrdev(dk) = 0
Base Phsycal address :0x180c0000
DK::Add client 0
DK::Reg phy addr = 180c0000 vir Addr = b80c0000
DK::Irq = 2
DK::Allocated 0x200000 bytes memory
DK::memory vir Addr = 80c00000 phy Addr = c00000
Device Status is : 0x11
root at OpenWrt:/tmp# uname -a
Linux OpenWrt 2.6.27.10 #18 Sat Dec 27 13:54:44 CST 2008 mips unknown

The art driver was made for 2.6.15, I updated it to work on newer kernels. It has all the juicy details that an experienced ath9k developer should need to get these chips working.

Quoted 5 lines

driver source AP81/AP83:
http://svn.openfoundry.org/jpgdauto/atheros/art_modules_v0_7_b9.tbz

Patch for newer kernels:
http://forum.openwrt.org/viewtopic.php?pid=78718#p78718

Quoted 6 lines

These should *not* be posted as they are not part of the driver, whoever posted this is violating our license and this will be looked into.

Avoid using this as a source of documentation.

Luis

The module is clearly identified by author and shows GPL license. The binary version distributed by companies such as DLink is also marked in the same way.

root at ipcmedialinux1:/DLink615C1_GPL/AthSDK# strings ./rootfs/target/lib/modules/art_ap81.ko | grep "="
cfiamd: write %s @ %p (%x != %x) i=0:fPtr=0x%x:fS=0x%x:ebSize=0x%x i=1:fPtr=0x%x:fS=0x%x:ebSize=0x%x i=2:fPtr=0x%x:fS=0x%x:ebSize=0x%x
sysFlashConfigWrite: failed rc=%d dk_dev_init::status after register_chrdev(dk) = %d DK::Free reg space phy=%x vir=%x
DK::Free irq = %x
page order=%d
DK::Reg phy addr = %x vir Addr = %x
DK::Irq = %x
DK::memory vir Addr = %x phy Addr = %x description=Linux MDK driver 1.0 author=muddin at atheros.com
license=GPL
depends=
vermagic=2.6.15- MIPS32_R2 32BIT gcc-3.4

root at ipcmedialinux1:/home/OpenWRT6/trunk/art_modules/modules# grep -R "MOD_" * include/dk.h:#define MOD_LICENCE "GPL"
include/dk.h:#define MOD_AUTHOR "muddin at atheros.com" include/dk.h:#define MOD_DESCRIPTION "Linux MDK driver 1.0"
main.c: MODULE_LICENSE(MOD_LICENCE); main.c:MODULE_AUTHOR(MOD_AUTHOR); main.c:MODULE_DESCRIPTION(MOD_DESCRIPTION);

#7 lore raw
Quoted 67 lines · Stephen Gutknecht (hilltx)
Quoted 31 lines · Luis R. Rodriguez
Quoted 24 lines · Stephen Gutknecht (hilltx)

A major discovery, good news! Through exhaustive searching of every bit I could find about AHB drivers, I stumbled into the source code for the Atheros Radio Testing (ART) for these routers. From my AP81 router (Trendnet TEW-652BRP, DLink DIR-615 C1) running OpenWRT trunk:

root at OpenWrt:/tmp# insmod art.ko
CHIP REV ID: b4
dk_dev_init::status after register_chrdev(dk) = 0
Base Phsycal address :0x180c0000
DK::Add client 0
DK::Reg phy addr = 180c0000 vir Addr = b80c0000
DK::Irq = 2
DK::Allocated 0x200000 bytes memory
DK::memory vir Addr = 80c00000 phy Addr = c00000
Device Status is : 0x11
root at OpenWrt:/tmp# uname -a
Linux OpenWrt 2.6.27.10 #18 Sat Dec 27 13:54:44 CST 2008 mips unknown

The art driver was made for 2.6.15, I updated it to work on newer kernels. It has all the juicy details that an experienced ath9k developer should need to get these chips working.

Quoted 5 lines

driver source AP81/AP83:
http://svn.openfoundry.org/jpgdauto/atheros/art_modules_v0_7_b9.tbz

Patch for newer kernels:
http://forum.openwrt.org/viewtopic.php?pid=78718#p78718

Quoted 6 lines

These should *not* be posted as they are not part of the driver, whoever posted this is violating our license and this will be looked into.

Avoid using this as a source of documentation.

Luis

The module is clearly identified by author and shows GPL license. The binary version distributed by companies such as DLink is also marked in the same way.

root at ipcmedialinux1:/DLink615C1_GPL/AthSDK# strings ./rootfs/target/lib/modules/art_ap81.ko | grep "="
cfiamd: write %s @ %p (%x != %x) i=0:fPtr=0x%x:fS=0x%x:ebSize=0x%x i=1:fPtr=0x%x:fS=0x%x:ebSize=0x%x i=2:fPtr=0x%x:fS=0x%x:ebSize=0x%x
sysFlashConfigWrite: failed rc=%d dk_dev_init::status after register_chrdev(dk) = %d DK::Free reg space phy=%x vir=%x
DK::Free irq = %x
page order=%d
DK::Reg phy addr = %x vir Addr = %x
DK::Irq = %x
DK::memory vir Addr = %x phy Addr = %x description=Linux MDK driver 1.0 author=muddin at atheros.com
license=GPL
depends=
vermagic=2.6.15- MIPS32_R2 32BIT gcc-3.4

Quoted 7 lines

root at ipcmedialinux1:/home/OpenWRT6/trunk/art_modules/modules# grep -R "MOD_" * include/dk.h:#define MOD_LICENCE "GPL"
include/dk.h:#define MOD_AUTHOR "muddin at atheros.com" include/dk.h:#define MOD_DESCRIPTION "Linux MDK driver 1.0"
main.c: MODULE_LICENSE(MOD_LICENCE); main.c:MODULE_AUTHOR(MOD_AUTHOR); main.c:MODULE_DESCRIPTION(MOD_DESCRIPTION);

The MODULE_LICENSE() macro has been incorrectly used before as well, this is another example. If you see the header of the file though you will so no GPL copyright notices. Trust me, this is not GPL/ISC licensed material and should be avoided.

Luis

#8 lore raw
Quoted 6 lines · Luis R. Rodriguez

The MODULE_LICENSE() macro has been incorrectly used before as well, this is another example. If you see the header of the file though you will so no GPL copyright notices. Trust me, this is not GPL/ISC licensed material and should be avoided.

Luis

This is very discouraging. I've done my homework in good faith. It has been like pulling teeth to locate the details required to support these chips. Plus, I've never worked on a wireless driver before, so I've been trying to learn the ropes and doing a lot of reading.

On December 17 you sent me a private email saying: "We don't yet support SoC stuff, but openwrt guys are enthusiastic to get this going it seems. Please use the openwrt lists and ask there." Well, I did ask, and the driver source can't be found, so seems to me I'm the person to do the work for the community. So I have been trying to learn what exactly it means to do AHB programming and if this is nothing more than a device ID issue (there isn't a whole lot out there on AHB, PCI is far more common).

I admit I'm new to wireless driver hacking, but it sure seems to me these chips are very similar to the other Atheros 9000 (9K) chips that ATH9K driver supports. I'm trying to collaborate with ATH9K project to test and contribute patches to get these drivers working on these chips.

I did my homework before embarking on this venture 2 months ago:
http://www.phoronix.com/scan.php?page=news_item&px=Njc1MA

September 27, 2008 dated story says that the HAL was released for the "AR9100 WiSoC". Well, it doesn't work on my build of madwifi on OpenWRT. So I go into this with the goal of tracking down technical details of why.

In November, I went out and purchased a few routers based on the "AR9100 WiSoC" with the intention of getting them to work with
OpenWRT. I never signed any kind of NDA with Atheros, my interest in
this project is as a consumer of routers that I have traced back to a common platform. The Netgear WNR2000 was publicized as being based on
OpenWRT - and is built on the Atheros platform. Except one major
problem, the GPL download from Netgear doesn't include any source code for the drivers. And it seems to be some version of ath_ahb driver that was never released back to the madwifi project. Or maybe I'm just loading them wrong, as the whole DEVID thing on AHB is still fuzzy to me (there is no equivalent to lspci on AHB bus that I can
find). The binary only drivers that are in the GPL downloads work
with 2.6.15 kernel, which is nearly three years old (January 3, 2006).

I can't find the madwifi HAL source code that works on these routers. So I've tried to make do without bothering you, as your December 17
email seemed to give me the brush off. I know this is new, and I've
been respectful, but Atheros sure isn't making this job easy. I see news stories about Atheros releasing a AR9100 WiSoC HAL, but where's the code?

#9 lore raw
Quoted 52 lines · Stephen Gutknecht (hilltx)
Quoted 6 lines · Luis R. Rodriguez

The MODULE_LICENSE() macro has been incorrectly used before as well, this is another example. If you see the header of the file though you will so no GPL copyright notices. Trust me, this is not GPL/ISC licensed material and should be avoided.

Luis

This is very discouraging. I've done my homework in good faith. It has been like pulling teeth to locate the details required to support these chips. Plus, I've never worked on a wireless driver before, so I've been trying to learn the ropes and doing a lot of reading.

On December 17 you sent me a private email saying: "We don't yet support SoC stuff, but openwrt guys are enthusiastic to get this going it seems. Please use the openwrt lists and ask there." Well, I did ask, and the driver source can't be found, so seems to me I'm the person to do the work for the community. So I have been trying to learn what exactly it means to do AHB programming and if this is nothing more than a device ID issue (there isn't a whole lot out there on AHB, PCI is far more common).

I admit I'm new to wireless driver hacking, but it sure seems to me these chips are very similar to the other Atheros 9000 (9K) chips that ATH9K driver supports. I'm trying to collaborate with ATH9K project to test and contribute patches to get these drivers working on these chips.

I did my homework before embarking on this venture 2 months ago:
http://www.phoronix.com/scan.php?page=news_item&px=Njc1MA

September 27, 2008 dated story says that the HAL was released for the "AR9100 WiSoC". Well, it doesn't work on my build of madwifi on OpenWRT. So I go into this with the goal of tracking down technical details of why.

In November, I went out and purchased a few routers based on the "AR9100 WiSoC" with the intention of getting them to work with
OpenWRT. I never signed any kind of NDA with Atheros, my interest in
this project is as a consumer of routers that I have traced back to a common platform. The Netgear WNR2000 was publicized as being based on
OpenWRT - and is built on the Atheros platform. Except one major
problem, the GPL download from Netgear doesn't include any source code for the drivers. And it seems to be some version of ath_ahb driver that was never released back to the madwifi project. Or maybe I'm just loading them wrong, as the whole DEVID thing on AHB is still fuzzy to me (there is no equivalent to lspci on AHB bus that I can
find). The binary only drivers that are in the GPL downloads work
with 2.6.15 kernel, which is nearly three years old (January 3, 2006).

Quoted 6 lines

I can't find the madwifi HAL source code that works on these routers. So I've tried to make do without bothering you, as your December 17
email seemed to give me the brush off. I know this is new, and I've
been respectful, but Atheros sure isn't making this job easy. I see news stories about Atheros releasing a AR9100 WiSoC HAL, but where's the code?

You shouldn't be discouraged because someone posted code and you cannot use it, things like this happen, just move on with what is publicly available under a license which does allow you contribute. When in doubt you can ask. We are engaged enough with the community to be replying to you and contributing to ath9k, and working with the community where possible. What you may have read about "HAL" code being released is the ath9k driver has the hardware access routines necessary to operate the cards. Then we also have released "HAL" code for our legacy chipsets too, you can read more about this here:

http://wireless.kernel.org/en/users/Drivers/ath5k#Documentationavailable

Instead of doing PCI writes you are going to be using an internal bus for the read/writes. To work on this you need code to work with the MIPS CPUs on the routers. My suggestion to check with openwrt folks comes from the fact that they have some code to support the MIPS boards where these new Atheros 11n card are coming on. What would be left to write is some ahb sort of glue into ath9k to wrap reads/writes and instead of doing PCI reads/writes do the specfific platform device reads/writes.

Luis

#10 lore raw

Hi All,

It seems to me that this WHOLE wireless mesh business began when
someone at MIT hacked the Atheros driver.... I assume they either had sources or a good MIPS reverse compiler? Maybe both?

The openwrt.org 'more or less' open Atheros driver doesn't work
reliably on my Meraki Minis :(.

Maybe someone (at MIT?) should again hack the current family of Atheros
drivers and delete the buggy stuff and provide a simple RadioTap style interface to send and receive packets. That way at least the Linux stuff would work reliably.

And related to this, I have yet to find anything on the Atheros.com
website that says they support open wireless in any form ??!!

So the less Atheros code the better !!

Maybe we should begin to think in terms of making tools so we can
easily reverse and re-engineer whosever buggy code so it works :).

warm regards to all and Happy New Year :).

Quoted 85 lines · Luis R. Rodriguez
Quoted 52 lines · Stephen Gutknecht (hilltx)
Quoted 6 lines · Luis R. Rodriguez

The MODULE_LICENSE() macro has been incorrectly used before as well, this is another example. If you see the header of the file though you will so no GPL copyright notices. Trust me, this is not GPL/ISC licensed material and should be avoided.

Luis

This is very discouraging. I've done my homework in good faith. It has been like pulling teeth to locate the details required to support these chips. Plus, I've never worked on a wireless driver before, so I've been trying to learn the ropes and doing a lot of reading.

On December 17 you sent me a private email saying: "We don't yet support SoC stuff, but openwrt guys are enthusiastic to get this going it seems. Please use the openwrt lists and ask there." Well, I did ask, and the driver source can't be found, so seems to me I'm the person to do the work for the community. So I have been trying to learn what exactly it means to do AHB programming and if this is nothing more than a device ID issue (there isn't a whole lot out there on AHB, PCI is far more common).

I admit I'm new to wireless driver hacking, but it sure seems to me these chips are very similar to the other Atheros 9000 (9K) chips that ATH9K driver supports. I'm trying to collaborate with ATH9K project to test and contribute patches to get these drivers working on these chips.

I did my homework before embarking on this venture 2 months ago:
http://www.phoronix.com/scan.php?page=news_item&px=Njc1MA

September 27, 2008 dated story says that the HAL was released for the "AR9100 WiSoC". Well, it doesn't work on my build of madwifi on OpenWRT. So I go into this with the goal of tracking down technical details of why.

In November, I went out and purchased a few routers based on the "AR9100 WiSoC" with the intention of getting them to work with
OpenWRT. I never signed any kind of NDA with Atheros, my interest in
this project is as a consumer of routers that I have traced back to a common platform. The Netgear WNR2000 was publicized as being based on
OpenWRT - and is built on the Atheros platform. Except one major
problem, the GPL download from Netgear doesn't include any source code for the drivers. And it seems to be some version of ath_ahb driver that was never released back to the madwifi project. Or maybe I'm just loading them wrong, as the whole DEVID thing on AHB is still fuzzy to me (there is no equivalent to lspci on AHB bus that I can
find). The binary only drivers that are in the GPL downloads work
with 2.6.15 kernel, which is nearly three years old (January 3, 2006).

Quoted 6 lines

I can't find the madwifi HAL source code that works on these routers. So I've tried to make do without bothering you, as your December 17
email seemed to give me the brush off. I know this is new, and I've
been respectful, but Atheros sure isn't making this job easy. I see news stories about Atheros releasing a AR9100 WiSoC HAL, but where's the code?

You shouldn't be discouraged because someone posted code and you cannot use it, things like this happen, just move on with what is publicly available under a license which does allow you contribute. When in doubt you can ask. We are engaged enough with the community to be replying to you and contributing to ath9k, and working with the community where possible. What you may have read about "HAL" code being released is the ath9k driver has the hardware access routines necessary to operate the cards. Then we also have released "HAL" code for our legacy chipsets too, you can read more about this here:

http://wireless.kernel.org/en/users/Drivers/ath5k#Documentationavailable

Instead of doing PCI writes you are going to be using an internal bus for the read/writes. To work on this you need code to work with the MIPS CPUs on the routers. My suggestion to check with openwrt folks comes from the fact that they have some code to support the MIPS boards where these new Atheros 11n card are coming on. What would be left to write is some ahb sort of glue into ath9k to wrap reads/writes and instead of doing PCI reads/writes do the specfific platform device reads/writes.

Luis
_______________________________________________
ath9k-devel mailing list
ath9k-devel at lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel