# madwifi and WPA Supplicant no longer working [solved]

## hebble

Hi,

Couple of weeks ago, I performed an emerge --sync and emerge -NDuv world and updated my system.  

I do this at least every two weeks.

After working through all the expat-2.0 issues I had a working system again - except for my wifi.

n.b  The wifi worked well beforehand on hy home network as well as on other as needed.

Now on start up I get the message...

*  Starting ath0

*     Starting wpa-supplicant on ath0 ...

ioctl[SIOCSIWMODE]:Invalid arguement

Could not configure driver to use managed mode

*     Starting wpa_cli on ath0 ...

failed to configure ath0 in the background

I use wpa_supplicant for the WPA-PSK encryption.

The laptop has inbuilt atheros wifi.  I'm using the madwifi drivers.

I'm able to get the wifi running again by

stopping net.ath0, unloading ath_pci, ath_rate_sample, and ath_hal,

performing an update_modules -f, modprobing the modules and bringing up net.ath0 again (I need to stop it again, before starting it)

If I plug in the network cable, eth0 is automatically recognised and allocated an ip address.

The kernel is unchanged (2.6.20-r6)  

Below are the modules list and the network status prior to reloading the modules to get it to associate...

```

# lsmod

Module                  Size  Used by

snd_pcm_oss            34720  0

snd_mixer_oss          13568  1 snd_pcm_oss

snd_seq_oss            26880  0

snd_seq_midi_event      5504  1 snd_seq_oss

snd_seq                38352  4 snd_seq_oss,snd_seq_midi_event

snd_seq_device          6284  2 snd_seq_oss,snd_seq

wlan_scan_sta          10112  0

wlan_scan_ap            4224  1

ath_rate_sample        10624  1

ath_pci                78240  0

wlan                  165444  5 wlan_scan_sta,wlan_scan_ap,ath_rate_sample,ath_pci

ath_hal               189520  3 ath_rate_sample,ath_pci

snd_hda_intel         239128  7

snd_pcm                58504  4 snd_pcm_oss,snd_hda_intel

snd_timer              15620  4 snd_seq,snd_pcm

snd                    39140  18 snd_pcm_oss,snd_mixer_oss,snd_seq_oss,snd_seq,snd_seq_device,snd_hda_intel,snd_pcm,snd_timer

snd_page_alloc          7176  2 snd_hda_intel,snd_pcm

```

```

# iwconfig

eth0      no wireless extensions.

lo        no wireless extensions.

sit0      no wireless extensions.

wifi0     no wireless extensions.

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

          Mode:Master  Frequency:2.412 GHz  Access Point: 00:19:7D:45:85:75

          Bit Rate:0 kb/s   Tx-Power:9 dBm   Sensitivity=1/1

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality=0/70  Signal level=-93 dBm  Noise level=-93 dBm

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

    

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

```

wpa_supplicant.conf...

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=wheel

eapol_version=1

ap_scan=1

fast_reauth=1

update_config=1

network={

        ssid="bat_network"	

        proto=RSN

        key_mgmt=WPA-PSK

        psk="****"

        priority=5

}

FWIW, lspci...

```

# lspci

00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS/940GML and 945GT Express Memory Controller Hub (rev 03)

00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS/940GML Express Integrated Graphics Controller (rev 03)

00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/940GML Express Integrated Graphics Controller (rev 03)

00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)

00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02)

00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02)

00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02)

00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #1 (rev 02)

00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #2 (rev 02)

00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #3 (rev 02)

00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #4 (rev 02)

00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02)

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)

00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)

00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) Serial ATA Storage Controller IDE (rev 02)

00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02)

02:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8038 PCI-E Fast Ethernet Controller (rev 14)

0a:03.0 Ethernet controller: Atheros Communications, Inc. AR5005G 802.11abg NIC (rev 01)

0a:09.0 CardBus bridge: Texas Instruments Unknown device 8039

0a:09.2 Mass storage controller: Texas Instruments 5-in-1 Multimedia Card Reader (SD/MMC/MS/MS PRO/xD)

#

```

Any help greatly appreciated.

----------

## merky1

try doing remerge of madwifi, and then remerge wpa_supplicant.  I have seen updates of either package get them out of "sync", and remerging them in order seems to help.

----------

## hebble

merky1,

Just tried to do that again.  Unloaded all wifi modules first, although I'm not sure if this makes a difference.

Modprobed ath_pci and brought ath0 up again.  It connected.  But as before, when I restart, it doesn't connect.

----------

## mike_DC

I haven't done this yet, but I think you need to make a net.ath0 and place it in /etc/init/ or something close to that. Then do an rc-update add net.ath0 .   :Question: 

Like I said, I haven't done this yet. I just wrote a little script and manually run it for right now. I have other issues and don't want to configure too much until they are fixed.

----------

## Monkeh

It's being brought up in master mode. Check /etc/modules.d/ath_pci.

----------

## hebble

Monkeh,

nothing is being set in ath_pci.

All is commented out.

What mode should it be set to?

Re: mick_DC's thoughts,

net.ath0 link is alread in place.  And it is autostarting.http://www.travelsinireland.com/england/castle/bodiam_castle.jpg

I can't remember which rc-update is associated with it, but ath_pci module and the others (- see lsmod of original post) are coming in, and wpa_supplicant is autostarting.

On doing a rc-update -s, there is no specific net.ath0 entry (as there is with net.eth0)

----------

## Monkeh

Set autocreate=sta, run update-modules, and see what happens on reboot.

----------

## hebble

No Change

----------

## GrindGod

I really don't know why, but

 *Quote:*   

> autocreate=ap

 

works for me.

----------

## hebble

 *Quote:*   

> 
> 
> Quote:
> 
>   autocreate=ap
> ...

 

doesn't change things.  Still getting the same error message as originally posted.

Thanks for the suggestions tho.

CHarlesS

----------

## hebble

Although this goes back to mid last year, it's finally solved - but I can't say how.

Fir the last 8 months, every time I wanted the wifi working I've had to stop net.ath0, unload ath_pci, reload it and restart net.ath0.

Then last thursday I performed an emerge -DNu world and the wifi started working on startup again.

The following packages were installed:

sys-fs/device-mapper-1.02.24-r1

sys-libs/ncurses-5.6-r2

x11-libs/qt-4.3.3

app-crypt/pinentry-0.7.5

sys-apps/lshw-02.12.01b

app-crypt/gnupg-2.0.9

sys-fs/udev-119

app-office/openoffice-bin-2.4.0

www-client/mozilla-firefox-2.0.0.14

FWIW, Any idea which of these fixed the problem?

Obviously a bunch of these have nothing to do with it, but for others I'm not sure what they do. 

Any thoughts?

----------

## wyv3rn

The kernel module eclass recently changed from installing various module-option files in /etc/modules.d/ to /etc/modprobe.d/.  When you rebuild the madwifi-ng modules since this change, you will have ath_pci files in both directories.  Put the options you want in /etc/modprobe.d/ath_pci and remove the old /etc/modules.d/ath_pci.  HTH.

----------

