1 (edited by RoundSparrow 2009-01-03 18:02:35)

Topic: Atheros ar9102/ar9103 madwifi or ath9k support

Hello.  There are a few active threads, but wanted to focus on the major issue - the lack of working wireless for these Atheros AP81/AP83 routers.

The Netgear WNR2000 factory firmware is based on a fork of OpenWRT with 2.6.15 kernel.  Poking around in the GPL download for this router, it seems to only include a atheros-madwifi-7.1.3.29 set of binary files (this router has the ar9103).

I'm on latest subversion of OpenWRT and can not get wireless to work with any of the drivers.  So I see we have three choices.

1) ath9k driver updates to support the ar9102/ar9103/ar9106
2) madwifi driver updates to support the ar9102/ar9103/ar9106
3) try to adapt the binary drivers from the WNR2000 to run on newer kernel 2.6.26 or 2.6.27 that OpenWRT is currently using

I need technical help.  I have hardware to test on, figured out how to put the latest OpenWRT on my router, etc... but not really experienced at integrating new drivers.  Here to learn wink  Routers getting activity on the forum that can be updated with the latest development OpenWRT but are needing these drivers:

planex mzk-w300nh (serial port u-boot tftp of OpenWRT confirmed)
Netgear wnr2000 (serial port u-boot tftp of OpenWRT confirmed)
Trendet TEW-652BRP (OpenWRT firmware flash working!)
Trendet TEW-632BRP (OpenWRT firmware flash working!)
DLink DIR-615 revision C1 [identical to Trendnet TEW-652BRP] (OpenWRT firmware flash working!)
Cameo Communications WLN2206, [identical to Trendnet TEW-632BRP ] (OpenWRT firmware flash working!)


Status
===============
Big news Saturday January 3, 2009:  Thank you Gabor!  Support in latest dev trunk via new ATH9K patches

2 (edited by RoundSparrow 2008-12-28 10:11:19)

Re: Atheros ar9102/ar9103 madwifi or ath9k support

I'm trying to figure out if ath9k should even work on this router.  The Netgear WNR2000 has a ar9103 chip on it verified by looking a the board.  Watching the factory firmware, the kernel booting emits "Atheros AR9100 WiSoC" message.  The planex mzk-w300nh also emits the same message.  Poking around on the internet, I find these references:


http://www.kernel.org/pub/linux/kernel/people/mcgrof/legacy-hal/ah.c

       case AR5416_AR9100_DEVID:
               return "Atheros AR9100 WiSoC";


That AR5416_AR9100_DEVID, I find it in the OpenWRT file:

https://dev.openwrt.org/browser/trunk/p … ?rev=11884

Is it simply a matter that the hardware ID on our routers isn't matching this one exactly?  How do I go about finding my device ID?  Help and pointers appreciated.

Re: Atheros ar9102/ar9103 madwifi or ath9k support

lspci? *shrug* I'm having trouble with newer atheros cards too.

Re: Atheros ar9102/ar9103 madwifi or ath9k support

I've been digging around a little on Google and came up with this:

First, restating the obvious, these routers are all based on the AP81 Atheros reference design.

If I'm not mistaken the AP81 design uses the Atheros AR9001AP-3NG or AR9001AP-2NG "single-band 802.11n AP/router solution" (http://www.atheros-xspan.com/modules/articles/files/AR9001AP-3NGBulletin.pdf). This seems to be more names for the same thing, but probably memory and flash and such is not specified in the "AP/router solution" but is in the "reference design". Also, the "reference design" can use either the AR9001AP-2NG or the AR9001AP-3NG "router solution". This is just my guess, but it makes sense to me at least. smile

From the PDF we can see that AR9001AP-2NG uses an AR9130 NPU + 11n BB/MAC and AR9102 2.4 GHz 2x2 radio, while the AR9001AP-3NG uses an AR9132 NPU + 11n BB/MAC and AR9103 2.4 GHz 3x3 radio. From the AR5416-related printouts from the original firmware that RoundSparrow reported (http://forum.openwrt.org/viewtopic.php?pid=78426#p78426) it seems likely that the embedded BB/MAC in the AR9130/9132 is at least similar to the AR5416 that is supported by ath9k.

My guess would be that we can make ath9k talk to the built in AR5416-like BB/MAC of these chips (by fiddling with devid and similar), but that the radio modules (AR9102/AR9103) might require implementation work. On the other hand the interface to the radio modules should be relatively simple. From the ath9k-devel thread I could find (https://lists.ath9k.org/pipermail/ath9k-devel/2008-December/000680.html) it seems Luis doesn't know which hardware we are talking about. Perhaps if we give some more info he can give us a better answer about what needs to be done to get ath9k running on these routers?

5 (edited by RoundSparrow 2008-12-28 10:08:43)

Re: Atheros ar9102/ar9103 madwifi or ath9k support

Great summary!

Re: Atheros ar9102/ar9103 madwifi or ath9k support

I think the fact that /proc/bus/pci is missing is a major problem. "lspci" output is blank. This is the same behavior I have on my Asus wl500w with my AR9160 based card installed. /proc/bus/pci shows up when the Atheros card is not installed. I think you're completely out of luck getting the driver to work if the PCI bus isn't even "working".

With a 2.4 kernel, /proc/bus/pci shows up just fine for me with the AR9160 card installed, but the ath9k/ath5k drivers arent available for that kernel. It's totally a catch-22 that is very frustrating for me.

DD-WRT works perfectly somehow. *ugh* I really don't have any desire to go back to that firmware.

7 (edited by _bbb_ 2008-12-22 10:42:39)

Re: Atheros ar9102/ar9103 madwifi or ath9k support

I don't know what type of bus the Asus wl500w uses, but the Atheros WiSoc designs use an AHB bus (http://en.wikipedia.org/wiki/AMBA_High-performance_Bus).

This means there probably shouldn't be any /proc/bus/pci on these boards, and if you do an lsmod you will see ath_ahb loaded (and no ath_pci).

Re: Atheros ar9102/ar9103 madwifi or ath9k support

Just noticed that lsmod on my TEW-632BRP lists ath_pci as loaded, while the original firmware lists ath_ahb. smile

I'll try and fiddle with the Madwifi Makefile and see if I can get it to build for AHB.

RoundSparrow, could you post some ath9k printouts for comparison?

9 (edited by RoundSparrow 2008-12-22 14:36:53)

Re: Atheros ar9102/ar9103 madwifi or ath9k support

I can indeed confirm ath_ahb is a key driver on the factory firmware; but I had never recognized what AHB was (alternate to PCI).  Light bulbs going on here.

_bbb_:  Not sure what you are asking me for.

I have the latest dev tree of ath9k on my system, very few references to AHB.  Should we be looking at the ath5k driver?


drivers/net/wireless/ath5k/base.c:      { PCI_VDEVICE(ATHEROS, 0x0011), .driver_data = AR5K_AR5211 }, /* 5311 - this is on AHB bus !*/

The ath9k mailing list was not very friendly to my postings about ar9102/ar9103 and left it up to us (OpenWRT) to figure this out wink   BTW, the ath5k driver is exclusively G and ath9k is N.  But the technology is pretty similar(?), it was only a few months back that some N devices were removed from ath9k.  See:
http://git.kernel.org/?p=linux/kernel/g … 79d3b71472

Not sure if this is noteworthy, but OpenWRT has a checkin 4 months ago https://dev.openwrt.org/browser/trunk/package/ath9k/Makefile?rev=12354
"disable ath9k on all platforms without pci support"

This is from 9 months ago, but gives some good info on their strategy:
http://kerneltrap.org/mailarchive/linux-ath5k-devel/2008/2/27/1002984/thread


So, if it turns out that AHB bus isn't even supported yet in the newer ath9k driver, our main option becomes hacking on madwifi (legacy) driver?

Re: Atheros ar9102/ar9103 madwifi or ath9k support

I tried madwifi with BUS forced to AHB in the Makefile, but the probe callback is never called (I added some printk:s to see all the devids on the bus). Looking at the kernel arch code for both "ar71xx" and the "atheros" target there seems to be some code missing for "ar71xx" where the "wmac" (wireless chip) is registered. I was sort of hoping this stuff would be found by scanning the bus, but it seems to be semi-hardcoded... sad

Also, I would be surprised if Madwifi would work out of the box. Just browsing the source code I have a feeling ath9k and the AR5416_AR9100_DEVID specific code could be interesting, but it's just a guess.

I think we need Gabor or Kaloz to bail us out here. wink

Re: Atheros ar9102/ar9103 madwifi or ath9k support

_bbb_ wrote:

I tried madwifi with BUS forced to AHB in the Makefile, but the probe callback is never called (I added some printk:s to see all the devids on the bus).

I did similar with no results, was tinkering with forcing prob on the ath_ahb init call. No luck.

I'm pretty lost with the makefiles, which Makefile did you set and what line did you alter?

BTW, going back 18 months there is talk of a router used with AHB:  http://forum.openwrt.org/viewtopic.php?pid=48541

Re: Atheros ar9102/ar9103 madwifi or ath9k support

You can force madwifi to build for ahb bus by setting the BUS variable around line 97 of package/madwifi/Makefile:

  
# Override BUS:
BUS:=AHB

Doesn't help much though. The linux kernel arch setup code must be fixed first. Looking at the "atheros" target this seems rather difficult, and the original firmware seems to have stuffed this in some binary module. sad

Re: Atheros ar9102/ar9103 madwifi or ath9k support

_bbb_ wrote:

I think we need Gabor or Kaloz to bail us out here. wink

Gabor's page shows a number of these routers.  And the madwifi ath_ahb.c file lists a number of these Ubiquiti systems he has.   https://dev.openwrt.org/wiki/juhosg

Gabor, do you want more equipment, or can we fund your development for a couple days wink  Does $150 pledge get us anywhere? I have no idea what your job / profession is - my motivation is to help the Linux community.

I am president of the Austin Texas (USA) Linux Users Group and based on my experience, there is surely interest in a newer Open Source platform than the aging Broadcom (Linksys WRT54G)... and you seem the be the guy to talk to!

Re: Atheros ar9102/ar9103 madwifi or ath9k support

Second that. I think this is one of the best wisocs price/performance-wise in a long time. The only contender for me is the AR9002AP aka AP94. But maybe we can have both? smile

Gabor/Kaloz, if there's anything we can do (donate hardware/test/shower you with cash wink) to help out please let us know!

Mary christmas!

Re: Atheros ar9102/ar9103 madwifi or ath9k support

Hi.

-donation, mainly devices.
-invite somebody skilled to openwrt development.
-each of us do the best to become a developer of openwrt.
Codes are there.
https://dev.openwrt.org/browser/trunk/target/linux
It's fun to read them, isn't it? ;-)

regards,
zukky

16 (edited by RoundSparrow 2008-12-27 20:16:06)

Re: Atheros ar9102/ar9103 madwifi or ath9k support

ok, I've now discovered ath_info command.  see: http://forum.openwrt.org/viewtopic.php?pid=78372

root@OpenWrt:/rom/lib# ath_info 0xb80c0000
MAC revision 0xadde is not supported!

root@OpenWrt:/rom/lib# ath_info -g 4:0 0xb80c000                
 -==Device Information==-
MAC Revision: 5210  (0x00)
Unable to read EEPROM Magic value!

root@OpenWrt:/rom/lib# cat /proc/iomem
00000000-01ffffff : System RAM
  00060000-00219347 : Kernel code
  00219348-00268bbf : Kernel data
18020000-1802ffff : serial8250.0
  18020000-1802001f : serial
18040000-1804ffff : AR71xx GPIO controller
18070000-18070003 : mii_ctrl
19000000-1900001f : mac_base
19000020-19000037 : mdio_base
19000038-190001ff : mac_base2
1f000000-1fffffff : ar71xx-spi

It looks like the registers changed on these newer chips: http://kerneltrap.org/mailarchive/linux-ath5k-devel/2007/10/27/362513
Anything else to try?

Re: Atheros ar9102/ar9103 madwifi or ath9k support

I have a D-Link DIR-615 and am very interested in getting custom firmware on it so I may enable it as a wireless client. (Thought it was supported by DD-WRT, but it is not)  I can't help on the development side, but I am more than willing to test any firmware on my router if it will help.  I'm glad to see people interested in supporting this device as it is very affordable and it is likely many people will be turning to it in the future.

Thanks!

18 (edited by RoundSparrow 2008-12-29 21:24:04)

Re: Atheros ar9102/ar9103 madwifi or ath9k support

What have I found here:

http://svn.openfoundry.org/jpgdauto/atheros/art_ap81/art_client_menu.txt

ART seems to be the Atheros Radio Test program, and here we have it running on our AR9102 chip?  does this give us the device ID's we are after?

/lib/modules/2.6.15/art # insmod art_ap81.ko
CHIP REV ID: b5
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 = 81c00000 phy Addr = 1c00000 

Devices detected:
DK::rtc write @ offset 4c : 3 
   PCI deviceID DK::rtc write @ offset 4c : 3 
    : 0xa027    SubRTC data 3
 systemID     : 0xa081
   MAC revisionID   : 0x40    BB  revisionID   : 0xa1
   RF  productID    : 0xd    RF  revisionID   : 0x0

Re: Atheros ar9102/ar9103 madwifi or ath9k support

Hi RoundSparrow

Trendet TEW-632BRP (OpenWRT firmware flash working!)
DLink DIR-615 revision C1 [identical to Trendnet TEW-652BRP] (OpenWRT firmware flash working!)

I am confused about the "identical" here. is that means they all exactly the same except the brand and the "case"?
like they use the same PCB too?

the reason I ask is I am wonder if they have the same sigal quality. cause I used 615 before and the signal works great
but I dunno how Trendnet works.

20 (edited by RoundSparrow 2008-12-28 07:32:43)

Re: Atheros ar9102/ar9103 madwifi or ath9k support

codier wrote:

DLink DIR-615 revision C1 [identical to Trendnet TEW-652BRP] (OpenWRT firmware flash working!)

I am confused about the "identical" here. is that means they all exactly the same except the brand and the "case"?  like they use the same PCB too?

the reason I ask is I am wonder if they have the same sigal quality. cause I used 615 before and the signal works great but I dunno how Trendnet works.

The firmware files and the GPL downloads say these two are the same (I think an accident).  I think they are both identical to one of the Cameo Communications model too.

I think this means software wise they are identical in every way.  The case is for sure different, and the firmware is different (branded, features). However, the layout of the PCB and antenna may differ... but not the components themselves.  So there may be signal differences.

Heck, even DLink and Trendnet known to change their hardware layout, cables (inside case, on PCB), and antennas from time to time - even with the same "software" wink  But I think they can't change too much of the government must have new model submitted.

Re: Atheros ar9102/ar9103 madwifi or ath9k support

RoundSparrow wrote:
codier wrote:

DLink DIR-615 revision C1 [identical to Trendnet TEW-652BRP] (OpenWRT firmware flash working!)

I am confused about the "identical" here. is that means they all exactly the same except the brand and the "case"?  like they use the same PCB too?

the reason I ask is I am wonder if they have the same sigal quality. cause I used 615 before and the signal works great but I dunno how Trendnet works.

The firmware files and the GPL downloads say these two are the same (I think an accident).  I think they are both identical to one of the Cameo Communications model too.

I think this means software wise they are identical in every way.  The case is for sure different, and the firmware is different (branded, features). However, the layout of the PCB and antenna may differ... but not the components themselves.  So there may be signal differences.

Heck, even DLink and Trendnet known to change their hardware layout, cables (inside case, on PCB), and antennas from time to time - even with the same "software" wink  But I think they can't change too much of the government must have new model submitted.

Thanks alot RoundSparrow
I will do more research on the signal difference between them then

Re: Atheros ar9102/ar9103 madwifi or ath9k support

Hello,

Sorry for the late reply, i'm on holiday until the end of this year, but i'm sure i will do a try with the ath9k driver.
Donations are always welcome. Especially now, because the RX pin of the serial port died on my TEW-632. :-(

Regards,
Gabor

Re: Atheros ar9102/ar9103 madwifi or ath9k support

I've removed the links and patches to the Atheros Radio Test (ART) module source code.  An Atheros employee on the ATH9K list indicates this is mistakenly labeled as GPL module.  So it can no be used as the basis of driver effort.

Re: Atheros ar9102/ar9103 madwifi or ath9k support

Happy New Year! ;-)

Gabor

Re: Atheros ar9102/ar9103 madwifi or ath9k support

Great smile