# Migrating from madwifi to ath5k [SOLVED]

## depontius

I've been successfully using madwifi, but would like to migrate to ath5k.  I thought I had done so back on 2.6.25, because I changed:

```
# To choose wpa_supplicant over iwconfig

modules=( "wpa_supplicant" )

#Don't start automatically

modules_ath0=( "!plug" )

wpa_supplicant_ath0="-Dwext" # For generic wireless

#wpa_supplicant_ath0="-Dmadwifi" # For Atheros based cards
```

I commented out the "-Dmadwifi" and put "-Dwext", which is what I thought had been suggested.  After doing this on 2.6.25, my wireless worked.  But then again, after moving to 2.6.25 I did a "module-rebuild rebuild", so I had both ath5k and madwifi installed.  Oddly enough, even with the above configuration, madwifi was loaded and working, even though ath5k had been loaded at boot.  At some point, I noticed that both ath_pci and ath5k were loaded, and began to wonder what wireless I was really using.

Recently when I upgraded the kernel again, rather than run "module-rebuild" I updated them by hand, skipping madwifi.  Next time I tried wireless, it wouldn't work.  I had to go back to 2.6.25 and madwifi in order to get wireless.

In dmesg:

```
[    7.201510] ath5k_pci 0000:02:02.0: PCI INT A -> Link[LNKC] -> GSI 11 (level, low) -> IRQ 11

[    7.201566] ath5k_pci 0000:02:02.0: registered as 'phy0'

[    7.239390] phy0: Selected rate control algorithm 'pid'

[    7.267183] i2c-adapter i2c-1: unable to read EDID block.

[    7.417811] i2c-adapter i2c-3: unable to read EDID block.

[    7.531300] Intel ICH Modem 0000:00:1f.6: PCI INT B -> Link[LNKB] -> GSI 11 (level, low) -> IRQ 11

[    7.531322] Intel ICH Modem 0000:00:1f.6: setting latency timer to 64

[    7.539399] Registered led device: ath5k-phy0::rx

[    7.539423] Registered led device: ath5k-phy0::tx

[    7.539427] ath5k phy0: Atheros AR5212 chip found (MAC: 0x56, PHY: 0x41)

[    7.539431] ath5k phy0: RF5111 5GHz radio found (0x17)

[    7.539433] ath5k phy0: RF2111 2GHz radio found (0x23)
```

It appears that both the Atheros 5212 and it's PHY have been found, so this doesn't look like the PCE-Express problem someone else had.  I don't have PCI-Express installed or enabled in the kernel, but I'm getting no hate-mail about it.  This is an old (pre-2004) laptop, so it likely would not have been PCI-Express.

When I try "/etc/init.d/net.ath0 up" I get:

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

 * Starting ath0

 *   Loading networking modules for ath0

 *     modules: apipa arping ccwgroup tuntap macchanger macnet rename wpa_supplicant essidnet iptunnel iproute2 system dhcpcd ip6to4

 *       wpa_supplicant provides wireless

 *       iproute2 provides interface

 *       dhcpcd provides dhcp

 *   wpa_supplicant only works on wireless interfaces

 *   unless the -D wired option is specified

 *   Bringing up ath0

 *     dhcp

 *       network interface ath0 does not exist

 *       Please verify hardware or kernel module (driver)                                                                                                                     [ !! ]

hostname ~ # 
```

Someone else suggested "ifconfig ath0 up", but if I try that I get:

```
hostname ~ # ifconfig ath0 up

ath0: ERROR while getting interface flags: No such device

hostname ~ # 
```

So it appears sufficiently equivalent to starting it the Gentoo way, getting a similar error.

Any suggestions?

----------

## d2_racing

Hi, first of all, for what I understand, madwifi create ath0 and the driver inside the kernel ath5k use the wlan0 link.

So, just to be sure, can you post this :

```

# emerge --info

# lsmod

# ifconfig -a

# iwconfig

# dmesg | grep -i ath

# dmesg | grep -i wlan

# cat /etc/udev/rules.d/70-persistent-net.rules 

# equery list mad

```

----------

## d2_racing

I'm sure that your /etc/conf.d/net should be like this :

```

modules=( "wpa_supplicant" ) 

wpa_supplicant_wlan0="-Dwext" 

config_wlan0=( "dhcp" )

```

Can you post your /etc/wpa_supplicant/wpa_supplicant.conf

----------

## depontius

That's a pile of information to post, and at this point I don't think I need to.  It appears that your suggestion is sufficient, combined with your asking for /etc/udev

```
/rules.d/70-persistent-net.rules.  I have:

# This file was automatically generated by the /lib/udev/write_net_rules

# program run by the persistent-net-generator.rules rules file.

#

# You can modify it, as long as you keep each rule on a single line.

# PCI device 0x8086:0x101e (e1000)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0d:60:cf:ee:08", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x168c:0x1014 (ath_pci)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:05:4e:49:89:09", ATTR{type}=="1", KERNEL=="ath*", NAME="ath0"

# PCI device 0x168c:0x1014 (ath5k_pci)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:05:4e:49:89:09", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
```

Obviously some particular piece of hardware now wants to use the ath5k_pci driver to give me a device named "wlan0", where that very same piece of hardware with the ath_pci drive used to give me a device named "ath0".

I updated my /etc/conf.d/net as you suggest, added /etc/init.d/net.wlan0 -> net.lo, and gave it a crack.  It appears to work, though I don't have working wireless access at my current location.  At the very least, it's scanning and finding secure APs that I can't connect to.  I'll take it home tonight and try connecting to my home AP.

I'll post back either way, but I think this one is solved.  I wish this had shown up in forum searches.

----------

## Paczesiowa

how about master mode? is it good enough in 2.6.28 to switch from non-free madwifi?

----------

## d2_racing

I don't know  :Razz: 

Also, remove this entry :

```

# PCI device 0x168c:0x1014 (ath_pci)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:05:4e:49:89:09", ATTR{type}=="1", KERNEL=="ath*", NAME="ath0" 

```

----------

## depontius

Haven't removed the udev entry yet, but I'd just like to confirm that this one is solved.  Connected to my home wireless with no problems - actually connected too soon, because I don't like automatic wireless connecting.  A little update to /etc/conf.d/rc and I'm right where I'd like it to be.

Thanks for the assistance.

----------

## d2_racing

No problem  :Razz: 

----------

