# Issues with Atheros wifi

## batkins

I have an IBM Thinkpad T42 with an Atheros internal wireless card:

```

lot49 bill # lspci | grep 802

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

```

.

Here is a list of potentially relevant software I have installed:

net-wireless/madwifi-driver-0.1_pre20051031

net-wireless/madwifi-tools-0.1_pre20051031

net-wireless/wireless-tools-28_pre10

sys-apps/baselayout-1.12.0_pre10

Here is the output of lsmod:

```

lot49 bill # lsmod

Module                  Size  Used by

snd_pcm_oss            48864  0

snd_mixer_oss          17792  1 snd_pcm_oss

snd_intel8x0           28992  0

snd_ac97_codec         75320  1 snd_intel8x0

snd_pcm                83592  3 snd_pcm_oss,snd_intel8x0,snd_ac97_codec

snd_page_alloc          7684  2 snd_intel8x0,snd_pcm

ehci_hcd               29320  0

uhci_hcd               30032  0

shfs                   49104  0

sd_mod                 14864  0

usb_storage            29120  0

scsi_mod               79240  2 sd_mod,usb_storage

visor                  17356  0

ac                      3396  0

video                  14084  0

thermal                10888  0

processor              18612  1 thermal

fan                     3140  0

button                  4944  0

battery                 8260  0

usbserial              24800  1 visor

usbcore               106872  6 ehci_hcd,uhci_hcd,usb_storage,visor,usbserial

smbfs                  63416  0

ibm_acpi               14908  0

nvram                   7752  0

ath_pci                85536  0

ath_rate_sample        11456  1 ath_pci

wlan                  173332  3 ath_pci,ath_rate_sample

ath_hal               193872  3 ath_pci,ath_rate_sample

```

I do not have wlanconfig, so I can't show its output.  I don't know what package it's in, or even whether it would  be useful.

The problem is that Linux seems to be treating my wireless card as simply a wired card:

```

lot49 init.d # ls -l  net.*

lrwxrwxrwx  1 root root     6 Nov 14 17:18 net.eth0 -> net.lo

-rwxr-xr-x  1 root root 24323 Nov 14 17:18 net.lo

lrwxrwxrwx  1 root root     6 Nov 17 11:16 net.wifi0 -> net.lo

lot49 bill # /etc/init.d/net.wifi0 restart

 * Starting wifi0

 *   Bringing up wifi0

 *     dhcp

 *       Running dhcpcd ...  

```

Obviously, no address is going to be pulled because it hasn't associated with an access point.  Here is some more config data:

```

/etc/conf.d/net:

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

config_eth0=("dhcp")

dhcpcd_eth0=("-N")

modules=("wpa_supplicant")

config_wifi0=("dhcp")

dhcpcd_wifi0=("-N")

wpa_supplicant_wifi0="-Dmadwifi"

# wpi_timeout_wifi0=60

```

```

/etc/conf.d/wireless

preferred_aps=( "RPICS.11" "rpi.edu" "flavour" "conte" "Darwin Financial Systems" "linksys" )

```

What is misconfigured here?  How can I get my wireless card to work as a wireless card and associate itself with access points?

Any help would be tremendously appreciated.

Bill

----------

## langthang

you shouldn't use a package.masked ebuild. Read here: https://forums.gentoo.org/viewtopic-t-400483.html

----------

## crdlb

You're using the wrong interface; AFAIK it should ath0 not wifi0 for atheros cards w/ madwifi (emerge/run iwconfig to check). I have used two different AR5212's with the same results (one in a T42).  Go through all the config files and changing wifi0 to ath0 and move the /etc/init.d/net.<interface> symlink from net.wifi0 to net.ath0.

----------

## batkins

It looks like all versions of madwifi-driver are masked.

 *langthang wrote:*   

> you shouldn't use a package.masked ebuild. Read here: https://forums.gentoo.org/viewtopic-t-400483.html

 

----------

## batkins

This was true of older versions of Madwifi, but recent releases use wifi* rather than ath*.  In any case, changing the configuration files to use ath0 isn't likely to do much if iwconfig only sees wifi0.

 *crdlb wrote:*   

> You're using the wrong interface; AFAIK it should ath0 not wifi0 for atheros cards w/ madwifi (emerge/run iwconfig to check). I have used two different AR5212's with the same results (one in a T42).  Go through all the config files and changing wifi0 to ath0 and move the /etc/init.d/net.<interface> symlink from net.wifi0 to net.ath0.

 

----------

## langthang

 *batkins wrote:*   

> It looks like all versions of madwifi-driver are masked.

 

no, only >=net-wireless/madwifi-driver-0.1_pre20051031 is package.masked. madwifi-driver-0.1_pre20050420-r1 is ~arch. 

```
- net-wireless/madwifi-driver-0.1_pre20050420-r1 (masked by: ~x86 keyword)

- net-wireless/madwifi-driver-0.1_pre20051111 (masked by: package.mask, ~x86 keyword)
```

anything in package.mask are broken or need more testing.

Anyway, if you read the link above, there is a command for creating ath0 device from wifi0.

----------

## batkins

Well, I installed madwifi-tools-20050420 and madwifi-driver-20050420 and I even modified the tools ebuild to include wlanconfig, but it looks like wlanconfig still didn't get installed.  Also, where is the information on renaming wifi0 to ath0?

----------

## Pandor

 *batkins wrote:*   

> 
> 
> ...
> 
> I do not have wlanconfig, so I can't show its output.  I don't know what package it's in, or even whether it would  be useful.
> ...

 

From the README:

 *Quote:*   

> The driver should support any Atheros-based Cardbus or PCI device. This version of the driver is managed and controlled by the usual Linux tools (ifconfig, iwconfig, iwpriv) plus the wlanconfig tool, which is included with the driver in the tools directory and gets installed on your system with make install.

 

 *crdlb wrote:*   

> You're using the wrong interface; AFAIK it should ath0 not wifi0 for atheros cards w/ madwifi (emerge/run iwconfig to check). I have used two different AR5212's with the same results (one in a T42).  Go through all the config files and changing wifi0 to ath0 and move the /etc/init.d/net.<interface> symlink from net.wifi0 to net.ath0.

 

Again from the README:

 *Quote:*   

> First, run "modprobe ath_pci" or the equivalent using "insmod".  When the driver is successfully loaded it creates a device named "wifi0" The output from iwconfig should look like this:
> 
>  	lo      no wireless extensions.
> 
>  	wifi0   no wireless extensions.
> ...

 

----------

## Pandor

 *Pandor wrote:*   

>  *batkins wrote:*   
> 
> ...
> 
> I do not have wlanconfig, so I can't show its output.  I don't know what package it's in, or even whether it would  be useful.
> ...

 

after reading all the horror stories about madwifi/wpa_supplicant from portage i compiled madwifi-ng and wpa_supplicant 0.4.7 by hand and got it up and running in under 30 minutes.

----------

