# madwifi failes at startup

## nadi

Hei,

I looked everywhere in this forum, read a lot of threads, read the faq and documentation in madwifi.org, read the doc in /usr/share/doc/madwifi-xxxx/README but no help: I cannot get ath0 to work at startup. This happened after upgrading the kernel to 2.6.15 from 2.6.12. 

Symptoms: 

I can get the wireless to work manually at root:

```
nadi barc # iwconfig ath0 essid felix key mykey

ifconfig ath0 up

dhcpcd ath0

```

but at startup (or when starting manually) I get the error message 

```
nadi barc # /etc/init.d/net.ath0 restart            

 * Starting ath0

 *   Configuring wireless network for ath0

 *   Failed to configure wireless for ath0                                [ !! ]

```

Possible problem:

The thing is, as it is, when I boot using kernel 2.6.12, the wireless works properly! but when booting the new kernel, it fails with hte above message. when I upgraded the madwifi to unstable version, 

```

nadi barc # emerge -pv madwifi-driver madwifi-tools

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild   R   ] net-wireless/madwifi-driver-0.1473.20060312  -amrr -onoe 0 kB 

[ebuild   R   ] net-wireless/madwifi-tools-0.1473.20060312  0 kB 

```

I had (in the first time I emerged the above packages) this udev rule in /etc/udev/rules.d/65-madwifi.rules BUT the emerge said it have to be removed in this version of the madwifi, SO I REMOVED IT, stupid enough, because afterwards I read in the forum that someone suggested upgrading udev to udev-081+ and then it will work. I dont have this file (65-madwifi.rules) anymore, and I did not find it in the network.

Does someone has any idea how to fix this problem? it is obviously kernel related, since it is working in 2.6.12 but not in 2.6.15 , though I checked that the correct kernel options are compiled. 

```
# Wireless LAN (non-hamradio)

#

CONFIG_NET_RADIO=y

CONFIG_NET_WIRELESS=y

```

any ideas?

Thanks,

NadiLast edited by nadi on Thu Mar 30, 2006 1:01 pm; edited 3 times in total

----------

## thpani

have you recompiled the drivers for your 2.6.15 kernel?

----------

## nadi

hei, thanks for the reply!

yes, I compiled the kernel and all the drivers , including unmerging first and re-emerging again madwifi-driver, madwifi tools and wireless-tools. 

Still no good.

Nadi

----------

## fastly

https://forums.gentoo.org/viewtopic-t-421720-highlight-athpci+unknown+symbol.html

----------

## andyandrews35

I am a noobie with Gentoo, but I suggest maybe you want to downgrade your ethernet driver.

----------

## andyandrews35

 *andyandrews35 wrote:*   

> I am a noobie with Gentoo, but I suggest maybe you want to downgrade your ethernet driver.

 

I meant the driver in question, the wifi one.

----------

## thpani

following works for me:

udev-079-r1

madwifi-driver-0.1443.20060207

madwifi-tools-0.1443.20060207

gentoo-sources-2.6.15-r1

without madwifi udev rules.

consider downgrading or search your /var/log/messages for errors.

----------

## nadi

hei, again, thanks for the reply.

I tried different madwifi drivers. The current one I am using, an unstable one (net-wireless/madwifi-driver-0.1473.20060312) is working with kernel 2.6.12 and not 2.6.15. so iI guess it is something in the kernel that breaks the madwifi. Moreover, I tried upgrading udev from 0.79 to 0.87(unstable) but still no good. 

still no solution.

----------

## nadi

fastly, thanks for the links. However, in my case I dont have any error messages while compiling. I have the correct modules installed and everything is loaded and compiled correctly. 

N

----------

## nadi

thpani, I tried with the exact versions you are using. Maybe it is something I did wrong in the kernel (evne thought, theoretically, only the wireless and radion are needed?). 

Will you be so kind and post your .config of 2.6.15-r1 kernel?

N

----------

## thpani

posted @ http://pastebin.com/625558

however, i don't think your kernel is the problem as you can configure wireless manually.

one thing i forgot: you use wireless-tools for configuration, while i use wpa_supplicant (0.4.8). maybe you should give this a try - and be careful to compile it with the madwifi USE-flag (which isn't supported by all versions of wpa_supplicant).

EDIT: another version... baselayout-1.11.14-r6

----------

## nadi

it is not the baselayout, as I am using exactly the same baselayout as you. I might give wpa_supplicant a try, even thouhg it was removed from the stable portage. I don't know why, but I used it before and it worked. 

Nadi

----------

## alexou2643

Well I have a similar problem with madwifi.

https://forums.gentoo.org/viewtopic-t-447623-start-0-postdays-0-postorder-asc-highlight-.html

I can configure manually my cards, but something fails when it's automatic at startup.

----------

## nadi

I give up, and starting a new thread with wpa_supplicant.

----------

## nadi

thanks to alexou2643, iwconfig now works at startup. I was missing in /etc/conf.d/wireless the next line

```

mode_ath0=managed

```

and now it works at startup.

*sign* I DID read the wireless.example, it just did not say how important it is for static WEP, I tired everyhting besides that. Morevoer, it worked manually, but not at startup. so what is the difference with managed or auto?

nevermind, it is working now.

another two days which were NOT spent on Oblivion!  :Smile: 

----------

## nadi

*sign again* 

I was too quick to post. I have no solution yet, iwconfig does not work from init.d/net.ath0 start

Any ideas?

 :Evil or Very Mad: 

----------

## alexou2643

Hi Nadi, I experienced the same problem after the modification of /etc/conf.d/wireless which seemed to solve the problem in my thread. Anyway, there was another problem, if you :

```
tail -f /var/log/everything current
```

It maybe gave you some output that the net device was not mounted, or the preup function failed, even if the rc-script said it was ok.

I figured out the thing, and apparently, the problem is the preup function inside the /etc/conf.d/net or /etc/conf.d/net.ath* who put the shit.

So i took this preup function out from the /etc/conf.d/net  and i created an ugly rc-script, but that works fine now:

nano /etc/init.d/wlanconfig.ath0:

```

#!/sbin/runscript

depend() {

        use net

        before net.ath0

}

start() {

        ebegin "Creating ath0 in station mode"

        /sbin/wlanconfig ath0 create wlandev wifi0 wlanmode sta

        eend $?

}

```

then do a chmod +x /etc/init.d/wlanconfig.ath0

then rc-update add wlanconfig.ath0 default

Don't forget to clean /etc/conf.d/net from all preup & postdown function

Be sure to have /etc/modules.d/ath_pci with this line:

```

options ath_pci autocreate=none

```

then do a modules-update

and put ath_pci inside /etc/modules.autoload.d/kernel-2.6 and to /etc/hotplug/blacklist too.

Finally in your /etc/conf.d/net or /etc/conf.d/net.ath* be sure to have the line hotplug_ath0=no

Well, the madwifi-ng works great, but there are still little problems with some distributions.

Anyway, I finally managed to make my ath0 works in managed to connect to my dsl-box with WPA-PSK, and to make my ath1 works in master as an access-point with WPA-PSK.

----------

## nadi

WOW! thanks, I will try it today. It looks crazy, but if it works... I believe now that the problem is either baselyout or something in the 12.6.15 kernel. I will post a bugzilla when I get back home from the conference.

Thansk alexou2643, for the great affort.

----------

## alexou2643

 *nadi wrote:*   

> WOW! thanks, I will try it today. It looks crazy, but if it works... I believe now that the problem is either baselyout or something in the 12.6.15 kernel. I will post a bugzilla when I get back home from the conference.
> 
> Thansk alexou2643, for the great affort.

 

Well, I think the issue comes from the baselayout, at least the net.lo script which apparently doesn't integrate the madwifi-NG tools, wlanconfig etc.

Anyway YEAH, it works, but i think that my ath0 is a bit slow to associate and get his ip adress by dhcp from my dsl-box, 20-30 seconds it's not really a problem but it makes the ntp-client rc-script to fail.

Maybe i should find something to make it start at the last moment of the startup.

The next thing i'd like to know about those madwifi-ng drivers is how to make work the turbo-mode, for my atho in managed mode, it's not really interesting, as i'm pretty far from 108 mbps with my dsl-box, but it could be useful between my access-point and my clients which have 108 mbps devices.

Any idea??

----------

## UberLord

 *alexou2643 wrote:*   

> Well, I think the issue comes from the baselayout, at least the net.lo script which apparently doesn't integrate the madwifi-NG tools, wlanconfig etc.

 

baselayout does not integrate the madwifi-NG tools, nor the device-scape tools. Nor will it ever do this. Either the driver makes some good defaults or the user has to use the preup functions or something else. But it's not baselayouts job, and while I'm a developer it never will be   :Twisted Evil: 

----------

