Atheros 802.11g PCMCIA card

I have a couple of no-name 802.11g PCMCIA/Cardbus cards, which I use in two different laptops, both running Debian Linux (testing). They are marked “WLB2054PCM” on the front, and “Model GL245401-1A1” and “FCC ID: 07J-GL245401-1A1” on the back.

The card is identified by cardctl as:

product info: "Atheros Communications, Inc.", "AR5001-0000-0000", "Wireless LAN Reference Card", "00"
  manfid: 0x0271, 0x0012
  function: 6 (network)

and by lspci as:

0000:02:00.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01)

The Atheros chip-set is supported by the madwifi driver, which is not a part of the standard Linux kernel, but it can be downloaded from http://sourceforge.net/projects/madwifi/. For me it compiled and installed without a hitch.

When the driver is loaded, it gives this output:

PCI: Enabling device 02:00.0 (0000 -> 0002)
ath_pci: cache line size not set; forcing 32
ath0: mac 5.9 phy 4.3 5ghz radio 4.6
ath0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
ath0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
ath0: 802.11 address: 00:03:2f:1e:33:72
ath0: Atheros 5212: mem=0x20000000, irq=3

As is evident, the card comes up as ath0, not as ethN.

The card is not known to the pcmcia-cs tools, so I had to add it manually to /etc/pcmcia/config-2.4 by adding these two stanzas:

device "atheros"
  class "network" module "ath_pci"

card "Atheros WiFi card"
  manfid: 0x0271, 0x0012
  bind "atheros"

This causes the driver to load automatically when the card is inserted into the laptop.

I had added a stanza for ath0 to /etc/network/interfaces, but the card was still not configured automatically when inserted, even if the driver was loaded. I had hotplug installed on one of the laptops but not on the other, but neither hotplug would ifup the card without some manual intervention. After some research I discovered that if I added the following to /etc/network/interfaces, hotplug would configure it automatically when it was inserted:

mapping hotplug
        script grep
        map ath0

With all this in place, the card works perfectly. I have still, after well over a month of using it continuously, to experience a problem, a dropped association or a lock-up.

UPDATE 2004-08-06:
I just updated to the latest driver, with no problem whatsoever. The output was:

wlan: 0.8.3.0 (EXPERIMENTAL)
ath_hal: 0.9.11.6
ath_pci: 0.9.3.1 (EXPERIMENTAL)
ath0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
ath0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
ath0: mac 5.9 phy 4.3 5ghz radio 4.6
ath0: 802.11 address: 00:03:2f:1e:33:72
ath0: Use hw queue 0 for WME_AC_BE traffic
ath0: Use hw queue 1 for WME_AC_BK traffic
ath0: Use hw queue 2 for WME_AC_VI traffic
ath0: Use hw queue 3 for WME_AC_VO traffic
ath0: Atheros 5212: mem=0x20000000, irq=3

Tags: , , ,

19 Responses to “Atheros 802.11g PCMCIA card”

  1. era Says:

    It took me a while to figure out that I needed to install the hotplug package in order for the mapping thing to do its magic.

    Your page is the only place where I’ve seen this mentioned — thanks a million for this information!

    I took the liberty to add a link from http://madwifiwiki.thewebho

  2. Nate Bargmann Says:

    I spent a couple of hours Googling around until I found this page. I am running Debian Testing with kernel 2.4.26-1-686 on an IBM TP-390E trying to load a Linksys WPC55AG and was getting the following key lines in syslog:

    cardmgr[XXX]: unsupported card in socket 0
    .
    .
    .
    kernel: PCI: No IRQ known for interrupt Pin A of device. Please try using pci-biosirq.
    kernel: ath_pci: cannot reserve PCI memory region
    kernel: ath_pci: No devices found, drivers not installed.

    For some reason I started poking around in my /etc/default/pcmcia script and saw that I had PCIC="i82365" and tried setting it to "yenta_socket". That failed so I searched the Debian packages page and found that the yenta_socket driver is in the kernel-pcmcia-modules-2.4.26-1-686 package which replaces pcmcia-modules-2.4.26-1-686 which I had installed. After installing the kernel PCMCIA modules and editing /etc/defaults/pcmcia to PCIC="yenta_socket" and starting /etc/init.d/pcmcia the modules loaded successfully and the card is powered.

    Please note with regard to editing the pcmcia-cs scripts as shown above:

    At the bottom of the /etc/pcmcia/config-2.4 script there is a line that sources ./*.conf for local drivers. So I created atheros.conf and added the new stanzas there. By the way, my cardmgr complained about the colon following manfid so my line looks like this:

    manfid 0×0271, 0×0012

    I have pcmcia-cs 3.2.5-8 installed.

    I hope this helps others that are getting the same error. Apparently, only the kernel PCMCIA modules will allow this card’s IRQ to be seen when using the yenta_socket.o driver.

  3. Nate Bargmann Says:

    BTW, lspci shows this card as:

    0000:81:00.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01)

    and if it is in slot 1 the hex ID is 0000:82:00.0

  4. Khipset Says:

    I have a D-Link DWL-AG660 that has an Atheros based chipset. I use it on my IBM Thinkpad 600E laptop. I compiled and installed madwifi. The install goes fine, and the card has 2 indicators on it: link and activity. The Link light comes on and stays on (usually in windows it blinks with the activity). I do an ifconfig ath0 and it outputs:
    /qoute
    ath0 Link encap:Ethernet HWaddr 00:0D:88:A2:3C:D9
    BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:199
    RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
    Interrupt:11 Memory:d2c40000-d2c50000
    /qoute

    and reading the dmesg output:
    /qoute
    ath_pci: cache line size not set; forcing 4
    ath0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
    ath0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
    ath0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
    ath0: turbo rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
    ath0: 802.11 address: 00:0d:88:a2:3c:d9
    ath0: Atheros 5212: mem=0x12c00000, irq=11
    /qoute
    It looks fine, now if I go to do anything with the card I get a seg fault. 2 Examples here:
    setting the channel with iwconfig using the command "iwconfig ath0 channel 4"
    now looking at the dmesg output again:
    /qoute
    Unable to handle kernel NULL pointer dereference at virtual address 00000000
    printing eip:
    00000000
    *pde = 00000000
    Oops: 0000
    CPU: 0
    EIP: 0010:[<00000000>] Tainted: P
    EFLAGS: 00210292
    eax: c3603da4 ebx: d0c86000 ecx: c3603d82 edx: d2bf4094
    esi: c3603ebc edi: c3603da4 ebp: d0c86000 esp: c3603d50
    ds: 0018 es: 0018 ss: 0018
    Process iwconfig (pid: 1587, stackpage=c3603000)
    Stack: d2bec182 d0c86000 c3603da4 c3603d80 c3603d82 c3603ebc c3603d82 c0139be8
    00000301 d1eac310 c0139c0f c3603ea8 00140000 00140014 00140014 00140014
    00140014 000f0021 0021000f 00000021 00140000 00000000 00000000 00000000
    Call Trace: [<d2bec182>] [<c0139be8>] [<c0139c0f>] [<d2bf3238>] [<d2beac72>]
    [<d2c0398a>] [<c012ff98>] [<d2bfe1c2>] [<c012736a>] [<c0297cc1>] [<d2bfe113>]
    [<c0297388>] [<d2bfe113>] [<c0290948>] [<c02887aa>] [<c01459fe>] [<c0108d73>]

    Code: Bad EIP value.
    /qoute
    same thing happens if I try to bring the card up in ifconfig, or if I try to set an address and netmask

  5. Mabuse Says:

    These are the commands that work for me to manually enable the card with WEP128. This was the easiest way to get it working even if it isnt hotpluggable. I put it into my network config startup scripts. You obviously need dhcp-isc and madwifi installed and ya need to use your own key and essid

    ifconfig ath0 up
    iwconfig ath0 mode managed
    iwconfig ath0 nick "Netgear"
    iwconfig ath0 channel 9
    iwconfig ath0 key hexvalofkeywithout0x
    iwconfig ath0 essid "your ssid"
    dhclient

  6. Payday Loans Says:

    Nice post…. Keep on blogging…

  7. David BL Says:

    Current system:
    - Linux skipper 2.6.12rackit (Debian unstable)

    Tested on kernel 2.6.12 with built in pcmcia modules – Worked like a charm!!

    Tested with:
    * Dlink DWL-G650 (w3)
    * TopCom wifi card

    Did following steps:

    1) grabbed kernel 2.6.12
    => make xconfig
    a) made sure hotplug was cheched
    b) added pcmcia/cardbus support
    c) added wireless drivers
    d) add rest – it’s selfexplaining…
    => compiled and booted up in kernel 2.6.12

    2) Fetched Madwifi (from CVS)
    a) did a make
    b) then a make install

    3) Checked pcmcia loaded the card correct
    a) lspci -v (look for ethernet Atheros)

    4) Loaded madwifi module
    a) modprobe ath_pci
    b) Chekc dmesg for info

    5) loaded up wifi card
    a) ifconfig ath0 up

    Thats that, it’s running….
    So sweet, and since i last tested madwifi theres no hangup’s in the driver anymore… (had some problems with kismet)

    Let’s try finding something…

    Installed Kismet, (grap latest with madwifi support)
    Edited /etc/kismet/kismet.conf where it says something about source=changeme::
    to
    source=madwifi_ab,ath0,D-Link

    don’t forget to change suid to some user and then load up kismet with root.

    Bam, Kismet running and pop, it found a AP in no time (thanks to all the public AP’s *chugs*)

    Found the following:
    SSID: NETGEAR (no WEP)
    CHANNEL: 11

    Let’s connect to it then…

    iwconfig mode managed
    iwconfig channel 11
    iwconfig nick "Bogus"
    iwconfig essid "NETGEAR"

    Check "iwconfig ath0" respons with a line like this:

    Access Point: xx:xx:xx:xx:xx:xx

    Where xx is numbers and letters (this means that you have reached the AP’s MAC address.) If the line looks like FF:FF:FF:FF:FF:FF then you haven’t connected right. Redo the iwconfig steps and perhsps check ifconfig that ath0 is up.

    Well now i was connected…

    So did a dhclient ath0

    Got a ip and checked i could ping the gateway/router…

    That’s it… Setup/discover/connect – USE!! :D

    Hope this short guide can help someone else with the hole "wifi" stuff under linux.

    (Note, discover senario was fictive)

    Questions, or thanks are all welcome ;) Just mail me and i’ll help ya out.

  8. Mikey Says:

    Hi,

    I’ve been running linux for almost a year now, so I guess I’m still a newby, but no stranger to hacking till it works. RH9 on the laptop, FC3 on the desktop.

    I have the D-Link DWL-G650 HW Rev C2
    Running on a StinkPad 600E.
    RedHat 9
    madwifi (from the CVS downloaded a couple days ago) put everything here:
    /lib/modules/2.4.20-31.9custom/net/
    Custom kernel, I presume because it is a ThinkPad with working MWave and sound.

    Before I tried this card, I had a Xircom ethernet wired adapter that worked like it is supposed to.

    Now for my issue:
    I can get the card running (I’m typing thru it now) by using a bash script to insmod the drivers manually. I don’t see ath0 in the GUI network config, but it does show with lspci iwconfig, ifconfig, and cardctl just like the above.

    I don’t seem to have this file: /etc/network/interfaces
    Should I just create it? Is there another file that does the same thing?

    Any thoughts would be appreciated.
    Dr.Mikey(at)weeg.org

  9. bitcmos Says:

    I appended a line at the bottom of /etc/modprobe.conf to get it to show up on Fedora Core 4 with the GUI network config.

    /etc/modprobe.conf
    ….
    alias ath0 ath_pci

    I think /etc/network/interfaces is used in other flavors as thats what I use to configure networking in Debian. You are going to want to look in /etc/sysconfig/network-scripts for files that look this: ifcfg-<network_alias>. Eg. ifcfg-eth0 and ifcfg-ath0.

    —–

    I think I am pretty close too. I just installed the madwifi drivers with FC4 for the D-Link DWL-G510 and when I run

    # iwlist ath0 scan

    I am able to see the wireless G access point I am trying to connect to but when I try

    # ifup wlan0

    it fails with

    Determining IP information for ath0… failed.

    a tail of /var/log/messages gives

    No DHCPOFFERS recieved.

    here is detailed output of iwlist:

    Cell 01 – Address: 00:0C:41:DC:4E:17
    ESSID:"linksys"
    Mode:Master
    Frequency:2.437 GHz (Channel 6)
    Quality=32/94 Signal level=-63 dBm Noise level=-95 dBm
    Encryption key:on
    Bit Rate:1 Mb/s
    Bit Rate:2 Mb/s
    Bit Rate:5 Mb/s
    Bit Rate:6 Mb/s
    Bit Rate:9 Mb/s
    Bit Rate:11 Mb/s
    Bit Rate:12 Mb/s
    Bit Rate:18 Mb/s
    Bit Rate:24 Mb/s
    Bit Rate:36 Mb/s
    Bit Rate:48 Mb/s
    Bit Rate:54 Mb/s
    Extra:bcn_int=100
    Here is my config file:
    /etc/sysconfig/network-scripts/ifcfg-wlan0

    IPV6INIT=no
    ONBOOT=no
    USERCTL=yes
    PEERDNS=yes
    TYPE=Wireless
    DEVICE=ath0
    BOOTPROTO=dhcp
    HWADDR=00:11:95:BE:A1:D9
    IPADDR=
    NETMASK=
    GATEWAY=
    DOMAIN=
    DHCP_HOSTNAME=
    ESSID=linksys
    CHANNEL=6
    MODE=Managed
    RATE=54Mb/s
    IWPRIV="authmode 2"

    the access point is using 64bit WEP encription I used the GUI tools to enter the key and I have also tried adding it as a line in the config file.

    KEY="0000000000"

    Either way I cannot establish an IP address for this card;

    #ifup ath0

    always fails. I’ve read through lots of logs. Most people say they are really happy with these drivers and they just work. I know I am so close any help would be greatly appreciated.

    Thank you.

  10. bitcmos Says:

    Solved! Just needed the correct WEP key. Heh. BTW the GUI tools in FC4 put the keys in /etc/sysconfig/network-scripts/
    keys-ath0

    Good luck with your wireless cards!

    DLink DWL-G510 ver. B works with FC4, yeah!

  11. Marc Says:

    Would anyone know where I could find a driver which would work with a 3Com pcmcia model 3CRPAG175 card ?

  12. Rich Kosiba Says:

    I have a DWL-G650 revision B with Wireless Tools v27 and Extension v17 on a 2.6.10 kernel.

    I’ve followed the directions here. I’m getting wifi0 by default, not ath0. When I try to use iwconfig (ie. iwconfig wifi0 mode managed) I get an "Invalid argument" error. Doesn’t matter what I try to do with iwconfig I get similar errors. iwlist wifi0 scan tells me the interface doesn’t support scanning.

    The device shows up correctly in lspci, and I do have a wifi0 device.

    /var/lib/pcmcia/stab tells me that Socket 0 is empty. On the other hand, cardctl info is telling me that there is an Atheros AR5001-0000-0000 with manfid 0271,0012.

    I’m a little confused. Can anyone offer any suggestions?

  13. van-router Says:

    Could anyone with THIS ->
    "DLink DWL-G510 ver.B"
    configured in Ad-hoc mode or AP kindly dump here the output of:
    $ iwconfig ath0
    $ ifconfig ath0

    Please, badly needed, save my hairs :)

  14. Chris Says:

    Rich,

    You should be able to run wlanconfig ath0 create wlandev wifi0 wlanmode sta. This will create an alias for you and make the computer available for wireless.

  15. Alex Says:

    Hey, I’ve just upgraded my madwifi driver using Gentoo’s emerge tool (emerge -va madwifi-driver) and the Master and Monitor modes don’t work anymore. It worked a few minutes ago flawlessly.

    The old package was net-wireless/madwifi-driver-0.1_pre20050420 it worked.
    The new package is net-wireless/madwifi-driver-0.1420.20060201 and I can’t set the mode to Master or Monitor.

    When I use iwconfig to set the mode I now get the following error:

    vez ~ # iwconfig ath0 mode master
    Error for wireless request "Set Mode" (8B06) :
    SET failed on device ath0 ; Invalid argument.

    Using iwpriv, I can successfully list the ioctl calls supported by the card.

    The command iwlist gives an error when I try to scan:

    vez ~ # iwlist ath0 scan
    ath0 Interface doesn’t support scanning : Invalid argument

    The interface ath0 exists and is listed with ‘iwconfig’.

    I tried Chris’ tip to run wlanconfig, but it doesn’t make a difference.

    What could be the problem? Does the new driver have known problems?

  16. Alex Says:

    Should have taken a look over the Gentoo forums first. ;)

    wlanconfig must be used now to set the proper mode with the newer madwifi driver. Works like a charm.

    If anyone else run into this post looking for an answer, please refer to:

    http://forums.gentoo.org/vi
    http://forums.gentoo.org/vi

  17. Aleksander Adamowski Says:

    I have a DWL-G650 cardbus card, and have discovered (after long hours of trying) thet wpa_supplicant works only if I set it to scan by itself, rather than let the driver do the scanning (ap_scan=1).

  18. Brian Wolfe Says:

    Got the AirLink 101 model AWLC4030 working nicely with WPA-PSK and TPIK encryption.
    This is a cardbus card 3v

    I used make-kpkg in debian to compile modules from the madwifi project.

    It all went togeather VERY easilly and nicely.

    To automate WPA-PSK I setup a config file as /etc/wpa.conf and added wpa_supplicant to /etc/ntwork/interfaces as a pre-up script.

  19. Brian Wolfe Says:

    oh yeah, I had to specify -D madwifi -c /etc/wpa.conf -i ath0 in network/interfaces

Leave a Reply

You must be logged in to post a comment.