# How to turn on Atheros

## ivan_q

I can't turn on my wireless Atheros card. The power-led for wifi is turn off. I have Fujitstsu-siemens Amilo Li 1718 notebook, and i have ethernet Realtek card and it is working ok as eth0, but nowhere I can find any ath0, wifi0 etc. I emerged wpa_supplicant, madwifi-ng, wireless-tools

```
localhost ivan # lspci | grep Ath

02:00.0 Ethernet controller: Atheros Communications, Inc. Unknown device 001c (rev 01)
```

```
localhost ivan # lsmod

Module                  Size  Used by

ath_pci                84256  0

wlan                  173124  1 ath_pci

ath_hal               193616  1 ath_pci

fglrx                 729120  11

scsi_wait_scan          5376  0

```

```
localhost ivan # ifconfig

eth0      Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX

lo        Link encap:Local Loopback

```

```
localhost ivan # iwconfig

lo        no wireless extensions.

eth0      no wireless extensions.

sit0      no wireless extensions.

```

parts of dmesg which may point to wifi

```
ath_hal: 0.9.18.0 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413)

wlan: 0.8.4.2 (0.9.3.2)

ath_pci: 0.9.4.5 (0.9.3.2)

PCI: Enabling device 0000:02:00.0 (0000 -> 0002)

ACPI: PCI Interrupt 0000:02:00.0[A] -> GSI 16 (level, low) -> IRQ 19

PCI: Setting latency timer of device 0000:02:00.0 to 64

wifi%d: unable to attach hardware: 'Hardware revision not supported' (HAL status 13)

```

Can anyone help ?

----------

## Dottout

it looks like stable (I suppose you have stable madwifi) drivers dont support your card. try with madwifi cvs, it might solve your problem. http://sourceforge.net/cvs/?group_id=82936

----------

## ivan_q

i have downloaded newest files via cvs, but it don't have any ./config file. when I run make, it says "Please enable wireless extensions" ... so I don't exacly know what to do with this ...

----------

## Dottout

ops sorry, I gave you the wrong page, that one points to the old code. now, from madwifi.org page: 

```
svn co http://svn.madwifi.org/madwifi/trunk madwifi
```

 you will only need to launch make\make install

----------

## ivan_q

I got a idea (but just a idea) ... is there a posibility to enable this card not by madwifi-ng, but by using ndiswrapper ? I can load a .inf file, but dont know exactlu what to do with it ...

----------

## Dottout

imho a wrapper is the last beach, but..if svn code doesnt work, why not ndiswrapper?  :Very Happy:  Ive never used it, so..I cant help you with that

----------

## ivan_q

I did some research for both madwifi and ndiswrapper. Of course, before loading wrapper i've unloaded everything connected to ath_pci, and vice versa

madwifi from cvs after loading says :

```
ath_hal: 0.9.30.13 (AR5210, AR5211, AR5212, AR5416, RF5111, RF5112, RF2413, RF5413, RF2133)

wlan: 0.8.4.2 (svn r2745)

ath_pci: 0.9.4.5 (svn r2745)

ACPI: PCI Interrupt 0000:02:00.0[A] -> GSI 16 (level, low) -> IRQ 19

PCI: Setting latency timer of device 0000:02:00.0 to 64

MadWifi: unable to attach hardware: 'Hardware didn't respond as expected' (HAL status 3)

```

wrapper says (with newest drivers downloaded from atheros.cz for winXP 32bit, marked as compatible and working ) :

```
ndiswrapper version 1.47 loaded (smp=yes)

ndiswrapper: driver net5416 (,06/05/2007,6.0.3.85) loaded

PCI: Enabling device 0000:02:00.0 (0000 -> 0002)

ACPI: PCI Interrupt 0000:02:00.0[A] -> GSI 16 (level, low) -> IRQ 19

PCI: Setting latency timer of device 0000:02:00.0 to 64

ndiswrapper (NdisMAllocateMapRegisters:906): Windows driver net5416 requesting too many (256) map registers

ndiswrapper (NdisWriteErrorLogEntry:192): log: C0001389, count: 4, return_address: f98b67d4

ndiswrapper (NdisWriteErrorLogEntry:195): code: 0xf7987400

ndiswrapper (NdisWriteErrorLogEntry:195): code: 0x28

ndiswrapper (NdisWriteErrorLogEntry:195): code: 0xf884f000

ndiswrapper (NdisWriteErrorLogEntry:195): code: 0xf884f000

ndiswrapper (mp_init:216): couldn't initialize device: C000009A

ndiswrapper (pnp_start_device:439): Windows driver couldn't initialize the device (C0000001)

ndiswrapper (mp_halt:258): device f0e96500 is not initialized - not halting

ndiswrapper: device eth%d removed

ndiswrapper: probe of 0000:02:00.0 failed with error -22

ndiswrapper (ntoskernel_exit:2723): object f7d4e2a0(2) was not freed, freeing it now

```

so can anyone help with any of these ways ?

----------

## Deusexodus

How run 

```
# modprobe ath_pci

# modprobe ath_hal
```

 ?

----------

## ivan_q

 *Deusexodus wrote:*   

> How run 
> 
> ```
> # modprobe ath_pci
> 
> ...

 

what I posted about what madwifi says, was of course after modprobing all necesary modules (ath_pci, ath_hal, wlan).

BTW. My wireless card is Atheros AR5007EG  :Wink: 

----------

## wrc1944

What I did after years of struggling with mad-wifi was just go with ndiswrapper, and use the windows xp driver that came on the cd that came with my D-Link DWL-G510 card.  

IIRC, make a directory in /lib called windrivers and copy over the drivers and sys and inf files from the cd.  Emerge wireless-tools and ndiswrapper. Make sure your /usr/src/linux symlink points to the running kernel. Check with iwconfig to see what your interface is (ath0 or wlan0), and to set up your AP (see man iwconfig), and configure your /etc/conf.d.net file. 

Also do:

cd /etc/init.d

ln -s net.lo net.ath0 (or wlan0, if iwconfig tell you it's wlan0)

Then do the following (I think this is correct- haven't set up ndiswrapper in a while).

ndiswrapper -i /lib/windrivers/your-driver

modprobe ndiswrapper

iwconfig ath0 essid  YOUR-ESSID NAME

iwconfig ath0 key  YOUR WEP KEY

dhcpcd ath0

rc-update add net.ath0 default  (if wanted at boot)

You should be connected now, assuming you have an adequate signal from your router.

Check these forum links for good tips

https://forums.gentoo.org/viewtopic-t-165861-highlight-ndiswrapper+windrivers.html

https://forums.gentoo.org/viewtopic-p-2616295-highlight-ndiswrapper+windrivers.html#2616295

https://forums.gentoo.org/viewtopic-t-341559-highlight-ndiswrapper+windrivers.html

https://forums.gentoo.org/viewtopic.php?t=125627&highlight=ndiswrapper+2+6

----------

## ivan_q

wrc1944 - did you read my first post ? You can notice from output of iwconfig that i don't have any wlan0 or ath0 interface.

I have symlinked net.lo to net.wlan0, but I dont have this interface anyway ...

----------

## wrc1944

Oops!   :Embarassed:    Sorry I missed the info in the first post.

Some thoughts and things to check:

Not all (in my case, most) svn mad-wifi drivers work with any or all cards- it's apparently a crap-shoot, and if they do work, the connection is weak and unreliable- at least that's been my experience. That's why I now use ndiswrapper- it's much easier, consistent, and the signal received from my router is stronger than I ever got with mad-wifi drivers. Once I got ndiswrapper installed, I've had no trouble.

If there is no wreless interface detected by iwconfig, nothing else will work.

Does wireless work on your notebook when booted windows (confirms router signal is good)?

Are you sure your Gentoo kernel is configured with the needed wireless stuff?

Where did you place the windows wireless driver? Did you actually install it with ndiswrapper -i /lib/windrivers/your-driver name? After you install the windows driver with ndiswrapper, iwconfig should show a wireless interface existing. Once you get that, make the link to net.lo in /etc/init.d.  Then do rc-config add net.ath0 default, and reboot.

When you boot, are there any messages about eth0 or wireless (ath0, wlan0, etc.) other than what you posted? 

What does your /etc/conf.d/net file look like? I'll post mine as an example if you wish.

What's the current output of lsmod- is it the same as you posted above? When I changed to ndiswrapper from mad-wifi, the ath_pci, ath_hal, wlan modules are no longer needed and don't show up in lsmod.

Did you unload madwifi modules (and prevent them from being reloaded on reboot?

Do you have a cd with drivers that came with your notebook you can get the wireless drivers off of, assuming they are working in windows? Or, copy them over from the windows installation into Gentoo /lib/windrivers.

maybe download try another  version windows driver for your card.

----------

## ivan_q

messages i showed are the olny one which shows. Lsmod after loading ndiswrapper (and of course after unloading madwifi) looks like this :

```
localhost ivan # lsmod

Module                  Size  Used by

ndiswrapper               34820 0

fglrx                 729120  11

scsi_wait_scan          5376  0 
```

I am running with ndiswrapper -i /root/driver-name.inf. Does it have any meaning from where are the drivers loaded ?

conf.d/net ?

```
modules=("wpa_supplicant")

config_eth0=( "dhcp" )

config_wlan0=("dhcp")

wpa_supplicant_wlan0="-Dmadwifi"
```

madwifi modules are loaded at boot, but after unloading it should not have any special meaning ...

Dirivers I olny have, are bundled with WinVista for my notebook, so i think it is better to use other ones ... or not ?

----------

## wrc1944

Does iwconfig show any wireless interfaces yet?  If not, that has to be resolved first.

I'd put ndiswrapper in /etc/modules.autoload.d/kernel-2.6, and completely get rid of all mad-wifi stuff.

If your widows vista drivers work and you get a wireless connection, I'd try those first. I guess they are in your C:\Windows folder somewhere.- I had my install cd, but IIRC I did also one time download a driver that worked.

When you did ndiswrapper -i /root/driver-name.inf, was your /usr/src/linux symlink pointing to the current running kernel?

I guess it shouldn't matter where they are located in Gentoo, as long as they are in your $PATH.  I just followed the  forum posts I saw, and put them in /lib/windrivers, which I created.

Your /etc/conf.d/net file will need to reflect what iwconfig reports (probably either ath0, wlan0, or wifi0). Anything saying madwifi is not going to be correct if you use ndiswrapper.

Again, first thing is to get iwconfig to report a wireless interface available, so you know what to put in the net file.

----------

## wrc1944

Forgot. Here's my iwconfig (wep encryption):

```
HOSTNAME="gentoo-audio" wrc # iwconfig

lo        no wireless extensions.

wlan0     IEEE 802.11b  ESSID:"linksysWRC"

          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:13:10:23:29:44

          Bit Rate=11 Mb/s

          Encryption key:xxxx-xxx-xx   Security mode:open

          Power Management:off

          Link Quality:23/100  Signal level:-81 dBm  Noise level:-96 dBm

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
```

My /etc/conf.d/net file: *Quote:*   

> modules=( "iwconfig" )
> 
> config_wlan0=( "dhcp" )
> 
> essid_wlan0="linksysWRC"
> ...

 

In /lib/windrivers, I have these 4 files, copied from my D-link card cd:

a3ab.cat

a3ab.sys

DWLInst.dll

NetA3AB.inf

I did the /etc/init.d net.wlan0 net.lo symlink, and rc-update add net.wlan0 default.

My connection is now started at boot automatically- no need to run dhcpcd wlan0.

BTW, my Link Quality:23/100  Signal level:-81 dBm  Noise level:-96 dBm seems low, but with mad-wifi it was never over 12/100, and usually around 7-8/1000.  This is on a fixed location desktop, in a little office, away from my router in the bedroom where my main computer is.

----------

## newbieUnugy

you may want to look at the following link

https://forums.gentoo.org/viewtopic-t-596777-highlight-atheros+5007eg.html

----------

## ivan_q

Ok ... I've somehow turned on my wifi card. Propably changing PCMCIA options in kernel helped. But now ... I dont know exactly how to set my connection. My iwlist says : "no scan result" ... can you help me with the settings ?

iwconfig :

```
wlan0     IEEE 802.11g  ESSID:off/any  

          Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated   

          Bit Rate:54 Mb/s   

          Encryption key:some-secret-key   Security mode:open

          Power Management:off

          Link Quality:0  Signal level:0  Noise level:0

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

```

/etc/conf/d/net

```
modules=("iwconfig")

config_wlan0=("dhcp")

essid_wlan0="wireless"

mode_wlan0="managed"

channel_wlan0="6"

key_wireless="s:my-secret-key enc open"

dhcpcd_wlan0="-t 20"

```

dmesg after /etc/init.d/net.wlan0 start

```
ndiswrapper (iw_set_ap_address:629): setting AP mac address failed (00010003)

ndiswrapper (iw_set_ap_address:629): setting AP mac address failed (00010003)
```

and it gives me message "Falied to configure iwconfig" (or sth similar) ... I've tried using this :

```
iwconfig wlan0 essid wireless

iwconfig wlan0 key my-secret-key

```

but I've noticed that key is changing, but ESSID is always 'off/any' ... My key is propably not in hex-value, 10 chars. My wireless is WEP encrypted, using channel 6 ... so can anyone help me with settings in etc/conf.d/net ?

----------

## Tanos

Just when it gets interesting...

I am experiencing a similar/same problem. Iwconfig does not show any wireless interfaces either. Somehow you managed to turn on your wifi card.

Can you elaborate on the PCMIA options in the kernel you changed? Maybe I could magically turn my wifi card on that way to.

----------

## al1ta

you don't have to use ndiswrapper because madwifi support your wireless card

for to see all interface (not only the ones that are up) you should run <ifconfig -a> command

for scanning you have to run

ifconfig ath0 up

iwlist ath0 scan

for wep you can run

iwconfig ath0 essid <essid name>

iwconfig ath0 enc <wep key>

for wpa you have to use wpa_supplicant (emerge it with madwifi flag)

wpa_supplicant -Dmadwifi -i ath0 -c <wpa_supplicant config file>

----------

## ivan_q

wcr1944 gave me some links above. I've read them all. About PCMCIA in kernel is there. Also dont forget to turn OFF in your kernel CONFIG_4KSTACK and SMP (I'll test those soon, at least SMP, becaust I have CoreDuo, so truning off SMP may be a bit crazy for me, but for tests I've disabled this. Later I'll try to test my wifi with or without 4KSTACK and SMP, but after i'll connect to my AP)

----------

## ivan_q

 *al1ta wrote:*   

> you don't have to use ndiswrapper because madwifi support your wireless card
> 
> for to see all interface (not only the ones that are up) you should run <ifconfig -a> command
> 
> for scanning you have to run
> ...

 

yeah ... madwifi supports my card ? so why it replies 

```
MadWifi: unable to attach hardware: 'Hardware didn't respond as expected' (HAL status 3) 
```

when I'm modprobing ath_pci ?

About scanning, I also wrote that 

```
My iwlist says : "no scan result"
```

And about configuring by iwconfig I've wrote

 *Quote:*   

> and it gives me message "Falied to configure iwconfig" (or sth similar) ... I've tried using this :
> 
>  *Quote:*   
> 
> iwconfig wlan0 essid wireless
> ...

 

so as You can see al1ta ... everything you wrote I've already tried ... So i'm rather looking for some clues about the problem, than the basics steps to scan AP's and connect to one of them

----------

## wrc1944

Since apparently you recompiled your kernel, try re-installing ndiswrapper like before, and remerging wireless-tools against the current kernel.  Make sure the /usr/src/linux symlink is pointing to the current running kernel before doing anything.  Remerge wireless-tools first, to see if that works.

The problem is for some reason you're not associating with your access point address. Ndiswrapper, iwconfig, and/or the windows driver don't seem to completely function yet. (stating the obivious   :Wink:  )

Did you completely remove  wpa_supplicant and madwifi-ng with emerge -C, and are not just unloading stuff? Are the madwifi modules still in /etc/modules.autoload.d/kernel, and trying to load (maybe conflicting with ndiswrapper)? If you are using ndiswrapper and WEP, it's probably best ALL traces of madwifi AND wpa_supplicanT are completely gone.

In /etc/conf.d/net, try using this exact format, like I have that is working (the format after the = sign):

```
key_linksysWRC="open xxxxxxxxxx"

```

and NOT: 

```
key_wireless="s:my-secret-key enc open"
```

Are you sure your router's ESSID is really "wireless"?

Are you sure all needed kernel options are enabled?

Did you create /lib/windrivers, and copy all needed files over?

Exactly what windows driver are you using? Maybe that driver is problematic with ndiswrapper.  During an emerge -uD world, was ndiswrapper recently updated? If all the settings are correct, I'd try a different windows driver for your card.

When you boot to wndows, does the connection work? Maybe you can get some info about the working connection while booted to windows. With my XP wireless installation, the D-Link software has a little graphical prog that gives me all the settings I have configured, and connection info.

----------

## ivan_q

Well ... long time no see but I haven't time to try (you know ... work etc). So :

I've unmerged (-C) madwifi-ng, wpa_supplicant, removed ath_* stuff reinstalled ndiswrapper and wireless tools, edited /etc/conf.d/net to ypur sugesstion, still the same ... I can see my wlan0 interface, I can `ifconfig wlan0 up` this, but `iwlist wlan0 scan` still says 'no scan results', and what is more important - `iwconfig wlan0 essid "wireless"` seems not change anything (yes - I'm sure that my AP name is "wireless") ...

 *Quote:*   

> wlan0     IEEE 802.11g  ESSID:off/any 

 

here is output from dmesg alter modprobing ndiswrapper module :

```
ndiswrapper version 1.47 loaded (smp=no)

ndiswrapper: driver net5416 (,06/05/2007,6.0.3.85) loaded

PCI: Enabling device 0000:02:00.0 (0000 -> 0002)

ACPI: PCI Interrupt 0000:02:00.0[A] -> GSI 16 (level, low) -> IRQ 19

PCI: Setting latency timer of device 0000:02:00.0 to 64

ndiswrapper (NdisMAllocateMapRegisters:906): Windows driver net5416 requesting too many (256) map registers

ndiswrapper: using IRQ 19

wlan0: ethernet device 00:c0:a8:e4:bc:36 using serialized NDIS driver: net5416, version: 0x60000, NDIS version: 0x501, vendor: 'NDIS Network Adapter', 168C:001C.5.conf

wlan0: encryption modes supported: WEP; TKIP with WPA, WPA2, WPA2PSK; AES/CCMP with WPA, WPA2, WPA2PSK

ADDRCONF(NETDEV_UP): wlan0: link is not ready

ndiswrapper (iw_set_ap_address:629): setting AP mac address failed (00010003)
```

I've tried to use vista drivers, but it gives a lot of errors. I've also tried few others drivers for this Atheros (from ndiswrapper page and other) but they ale the same, or give an error. So this is most optimal driver ... 

can anyone help what is still wrong ?

----------

## ShEaRer

Like somebody said, you should really see this topic: *Quote:*   

> you may want to look at the following link 
> 
> https://forums.gentoo.org/viewtopic-t-596777-highlight-atheros+5007eg.html

 

I have the same card, and had some of the same problems u had however i solved them by compiling the kernel with the 4kB stacks option off like it was said on the link above and then used the ndiswrapper with the WIN XP drivers not vista, use WIN XP drivers from www.atheros.cz

----------

## ivan_q

But you see ... I've already recompiled kernel without 4k stack, and used drivers from atheros.cz ... and it almost worked ... and now I'm asking what else can I do

----------

## mimosinnet

 *ivan_q wrote:*   

> But you see ... I've already recompiled kernel without 4k stack, and used drivers from atheros.cz ... and it almost worked ... and now I'm asking what else can I do

 

I have also had many issues with my atheros AR5007EG wireless card. I have been able to get it working with madwifi drivers. I have downloaded a patched snapshot (madwifi-ng-r2756+ar5007.tar.gz). install/make install, and followed the FirstTimeHowTo. The discussion on this patch (only works with x86-32) can be followed in the following madwifi ticket

----------

## HyperQuantum

 *mimosinnet wrote:*   

> I have also had many issues with my atheros AR5007EG wireless card. I have been able to get it working with madwifi drivers. I have downloaded a patched snapshot (madwifi-ng-r2756+ar5007.tar.gz). install/make install, and followed the FirstTimeHowTo. The discussion on this patch (only works with x86-32) can be followed in the following madwifi ticket

 

Is there an ebuild available somewhere? I tried try create my own but I failed. Or will there be a new MadWifi version soon? I cannot find a date for their next release.

----------

## mimosinnet

 *HyperQuantum wrote:*   

> Is there an ebuild available somewhere? I tried try create my own but I failed. Or will there be a new MadWifi version soon? I cannot find a date for their next release.

 

In my search I found this thread on creating a madwifi ebuild. I have also been trying to create an ebuild, but I was not sure what to change and where to put the tar file.

----------

## HyperQuantum

You can find my ebuild attempt here. I started with the ebuild for madwifi-ng-0.9.3.3 and modified it. It stops at a compile error (some source file not found).

----------

## mimosinnet

Excellent! Could you post the error you get? Thanks!

----------

## HyperQuantum

 *mimosinnet wrote:*   

> Excellent! Could you post the error you get? Thanks!

 

```
  CC [M]  /var/tmp/portage/net-wireless/madwifi-ng-0.9.3.3.1/work/madwifi-ng-r2756+ar5007/net80211/ieee80211_acl.o

In file included from /var/tmp/portage/net-wireless/madwifi-ng-0.9.3.3.1/work/madwifi-ng-r2756+ar5007/net80211/ieee80211_linux.c:996:

/var/tmp/portage/net-wireless/madwifi-ng-0.9.3.3.1/work/madwifi-ng-r2756+ar5007/net80211/../release.h:38:24: error: svnversion.h: No such file or directory

```

----------

