# Atheros wireless no further than lspci

## dargaud

Hello all,

I got a Dlink G108 knowing that it works with Linux, and indeed it works fine with Ubuntu. I just have trouble configuring it with Gentoo. The card is seen as:

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

But then I can't seem to do anything with it (not, I don't know what eth1 is supposed to be)[/code]:

```
localhost ~ # iwconfig

eth0      no wireless extensions.

lo        no wireless extensions.

dummy0    no wireless extensions.

eth1      no wireless extensions.

```

```
localhost ~ # modprobe ath_pci

WARNING: Error inserting ath_hal (/lib/modules/2.6.19-gentoo-r5/net/ath_hal.ko): Invalid module format

WARNING: Error inserting wlan (/lib/modules/2.6.19-gentoo-r5/net/wlan.ko): Invalid module format

WARNING: Error inserting ath_rate_sample (/lib/modules/2.6.19-gentoo-r5/net/ath_rate_sample.ko): Invalid module format

FATAL: Error inserting ath_pci (/lib/modules/2.6.19-gentoo-r5/net/ath_pci.ko): Invalid module format

```

I have a feeling something is missing from my kernel (linux-2.6.19-gentoo-r5), but what ?

```
localhost ~ # grep -i net /usr/src/linux/.config | egrep -v "^#"

CONFIG_NET=y

CONFIG_INET=y

CONFIG_INET_XFRM_MODE_TRANSPORT=y

CONFIG_INET_XFRM_MODE_TUNNEL=y

CONFIG_INET_XFRM_MODE_BEET=y

CONFIG_INET_DIAG=y

CONFIG_INET_TCP_DIAG=y

CONFIG_SCSI_NETLINK=y

CONFIG_NETDEVICES=y

CONFIG_NET_ETHERNET=y

CONFIG_NET_TULIP=y

CONFIG_NET_PCI=y

CONFIG_NET_RADIO=y

CONFIG_NET_WIRELESS_RTNETLINK=y

CONFIG_NET_WIRELESS=y

CONFIG_NET_PCMCIA=y

CONFIG_PCMCIA_PCNET=m

CONFIG_PCMCIA_AXNET=m

CONFIG_NET_FC=y

CONFIG_USB_USBNET_MII=m

CONFIG_USB_USBNET=m

CONFIG_USB_NET_AX8817X=m

CONFIG_USB_NET_CDCETHER=m

CONFIG_USB_NET_NET1080=m

CONFIG_USB_NET_ZAURUS=m

CONFIG_USB_SERIAL_OMNINET=m

CONFIG_NET_DMA=y

```

----------

## Monkeh

Recompile madwifi-ng.

----------

## wynn

```
localhost ~ # modprobe ath_pci

WARNING: Error inserting ath_hal (/lib/modules/2.6.19-gentoo-r5/net/ath_hal.ko): Invalid module format

WARNING: Error inserting wlan (/lib/modules/2.6.19-gentoo-r5/net/wlan.ko): Invalid module format

WARNING: Error inserting ath_rate_sample (/lib/modules/2.6.19-gentoo-r5/net/ath_rate_sample.ko): Invalid module format

FATAL: Error inserting ath_pci (/lib/modules/2.6.19-gentoo-r5/net/ath_pci.ko): Invalid module format
```

This means that the ath-pci module has been compiled against a kernel with different settings to the running kernel.

If you look in /var/log/messages there will be a more informative error message.

You may also like to look at "FATAL: invalid module format" and vermagic

----------

## dargaud

 *Quote:*   

> Recompile madwifi-ng.

 

OK, but I originally installed it with emerge. 

Should I re-emerge it with some specific options (which I don't know) ? 

Download the tarball and work from there ? 

Find the source in the portage tree and compile from there (and maybe screw up the portage tree in the process) ?

Thanks...

----------

## Ehnvis

Just re-emerge madwifi-ng and it should be alot better.

----------

## dargaud

OK, I did that and I'm now farther ahead, but still having problems. The card is there but I can't really connect. Maybe it's more of a kde problem... I've looked at the madwifi tutorial and the wireless howto but still no go, or rather no IP.

```
localhost ~ # ifconfig

ath0      Link encap:Ethernet  HWaddr 00:17:9A:B1:75:05

          UP BROADCAST RUNNING 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:0

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

[...]

wifi0     Link encap:UNSPEC  HWaddr 00-17-9A-B1-75-05-6B-23-00-00-00-00-00-00-00-00

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:4617 errors:0 dropped:0 overruns:0 frame:15856

          TX packets:10892 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:199

          RX bytes:410492 (400.8 Kb)  TX bytes:554358 (541.3 Kb)

          Interrupt:10 Memory:d8d00000-d8d10000

```

```
localhost ~ # iwconfig

eth0      no wireless extensions.

lo        no wireless extensions.

dummy0    no wireless extensions.

eth1      no wireless extensions.

wifi0     no wireless extensions.

ath0      IEEE 802.11g  ESSID:"WifiDargaud"  Nickname:""

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

          Bit Rate:1 Mb/s   Tx-Power:18 dBm   Sensitivity=0/3

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:E5D2-1612-CAD1-C6A3-3EC4-5759-E4   Security mode:restricted

          Power Management:off

          Link Quality=45/94  Signal level=-50 dBm  Noise level=-95 dBm

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

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

```

If I launch kwifimanager, I see my ssid with a good signal but no access point and no IP. If I launch the kde wireless manager and set the WEP option and all, it doesn't change anything. Shouldn't there be a /etc/init.d/net.ath0 entry ? (I have only eth0 and lo). I also tried dhcpcd ath0 without success.

----------

## deface

ln -s /etc/init.d/net.lo /etc/init.d/net.ath0

----------

## dargaud

 *Quote:*   

> ln -s /etc/init.d/net.lo /etc/init.d/net.ath0

 

OK, I understand this as "the script to start the wireless is the same than the strip that starts 'lo'".

Then I assume I need to do 

```
localhost ~ # /etc/init.d/net.ath0 start

 * Starting ath0

 *   Configuring wireless network for ath0

 *   WEP key is not set for "WifiDargaud" - not connecting

 *   WEP key is not set for "Livebox-B600" - not connecting

 *   WEP key is not set for "Alice-fcd4" - not connecting

 *   Couldn't associate with any access points on ath0

 *   Failed to configure wireless for ath0                                                              [ !! ]

```

I have configured the WEP key for WifiDargaud in the Kde wireless control panel, so it must mean I need to do it somewhere else...? I also tried:

```
# ifconfig ath0 up

# iwconfig ath0 key e5d21612cad1c6a33ec45859e4

# dhcpcd ath0

Error, timed out waiting for a valid DHCP server response

```

So I'm still missing something...

May I add another question... What are hostapd and wpa_supplicant (man page not very insightful) ? Are they needed/useful to get that damn wireless working ? Shouldn't I be able to do the whole config from KDE like in Ubuntu ?!?

----------

## dargaud

I'm sorry but I still haven't been able to get the card to work. As the kde configuration seems to have no effect whatsoever (which files is it supposed to act on ?!?), I've followed the FAQ for the manual config, setting /etc/init.d/net.ath0 and /etc/conf.d/wireless

```
localhost ~ # /etc/init.d/net.ath0 start

 * Caching service dependencies ...                                                                     [ ok ]

 * Starting ath0

 *   Configuring wireless network for ath0

Error for wireless request "Set Encode" (8B2A) :

    SET failed on device ath0 ; Invalid argument.

 *   ath0 does not support setting keys

 *   or the parameter "mac_key_WifiDargaud" or "key_WifiDargaud" is incorrect

 *   Failed to configure wireless for ath0                                                              [ !! ]

```

Same when I do 

```

localhost ~ # ifconfig ath0 down

localhost ~ # iwconfig ath0 essid WifiDargaud

localhost ~ # iwconfig ath0 channel 3

localhost ~ # iwconfig ath0 key "s:e5d21612cad1c6a33ec45759e4"

Error for wireless request "Set Encode" (8B2A) :

    SET failed on device ath0 ; Invalid argument.

```

All I can think now is that I'm missing some WEP thing, but I have

```

localhost ~ # grep -i wep /usr/src/linux/.config

CONFIG_IEEE80211_CRYPT_WEP=y

```

Some more config:

```
localhost ~ # egrep -v "^#|^$" /etc/conf.d/wireless

essid_ath0="WifiDargaud"

mode_ath0="managed"

channel_ath0="3"

sleep_scan_ath0="1"

key_WifiDargaud="s:e5d21612cad1c6a33ec45759e4 enc open"

config_WifiDargaud=( "dhcp" )

dhcpcd_WifiDargaud="-t 5"

```

----------

## UberLord

 *dargaud wrote:*   

> 
> 
> ```
> 
> localhost ~ # iwconfig ath0 key "s:e5d21612cad1c6a33ec45759e4"
> ...

 

When specifying a hex key, don't prefix it with s:

```
iwconfig ath0 key "e5d21612cad1c6a33ec45759e4"
```

----------

