# Madwifi driver

## Sethiel

Hi there,

I managed to get my Atheros wifi card working with madwifi driver. Now, when I start my notebook, it loads ath_pci module (and a few more) and however the card is down, it's recognized and working, I only have to 'ifconfig ath0 up' to switch it on. 

Unfortunately, this happens only when I start my notebook with the wifi card on (in a hardware way - the switches on notebook that allows to switch off wifi or bluetooth card when I don't need them to spare battery time). When it's off during boot time, it's not gonna be visible in /dev (naturally), but the madwifi driver still loads. And when I turn the wifi card on, nothing happens. As I understand, the device /dev/ath0 is created by madwifi driver when it loads AND when the wifi card is on. But I don't know what to do in that situation - madwifi loaded and no ath0 device. The module ath_pci doesn't seem to be able to unload (tried to unload and load again to fix that), though I have the option "Module unloading" enabled in kernel. I didn't try the "Forced module unloading", don't know if that's the right way.

Any ideas how to avoid this?

----------

## kevstar31

Try:

```
rmmod ath_pci

insmod ath_pci

/etc/init.d/net.ath0 restart
```

----------

## Sethiel

 *kevstar31 wrote:*   

> Try:
> 
> ```
> rmmod ath_pci
> 
> ...

 

It might be strange, but I don't have a file /etc/init.d/net.ath0. I don't know what it's supposed to do, but I guess the madwifi driver do all the work when it loads.

----------

## eduardhc

 *Sethiel wrote:*   

>  *kevstar31 wrote:*   Try:
> 
> ```
> rmmod ath_pci
> 
> ...

 

Create it yourself by doing 'ln -s net.lo net.ath0'. Network start scripts are not created by default in Gentoo.

----------

## Sethiel

Wow, I didn't know it's working that way. I created the device net.ath0 and now when I turn my wifi off and on, it's working without doing anything special (suppose it's udev doing the stuff). Thanks a lot for solving my problem and pushing me a bit closer to the Truth.   :Smile: 

----------

## eduardhc

 *Sethiel wrote:*   

> Wow, I didn't know it's working that way. I created the device net.ath0 and now when I turn my wifi off and on, it's working without doing anything special (suppose it's udev doing the stuff). Thanks a lot for solving my problem and pushing me a bit closer to the Truth.  

 

Gentoo doesn't create by itself the different net.* scripts, it only provides the basic one (net.lo), and maybe some of the most current ones (net.eth0, iirc...). This is another aspect in which it's different from the rest of distros...

kind regards, 

  Eduard

----------

## Sethiel

OK, early celebrations  :Sad: 

I'm now quite sure how I got to this situation (I made a lot of changes in my system), but now it reports "SIGSEGV" - Unauthorized memory access whenever wpa_supplicant tries to start with "madwifi" driver. I think the solution is directly writen in wpa_supplicant man page:

"Please  note that you will need to modify the wpa_supplicant .config file to use the correct path for the madwifi driver root directory (CFLAGS += -I../madwifi/wpa line in example defconfig)."

But I don't know how to alternate that option when using emerge to build packages (instead ./configure && make && make install). How do I do the stuff?

----------

