# cannot get my ipw3945 working without preup() function

## jan-o-sch

Hi all,

after twiddling around for some time I finally got my wireless working. However, I have to use a hand-written preup() function in my /etc/conf.d/net file which introduces a sleep. Not only does this cause latency, nor does it seem too portable:

```
preup() {

        if [[ ${IFACE} = "eth2" ]]; then

                echo 0 > /sys/bus/pci/drivers/ipw3945/*/rf_kill

                sleep 1

        fi

        return 0;

}
```

I do not like this way of writing to sysfs. When I do not use this function, /etc/init.d/net *does* enable my wireless (cat /sys/bus/pci/drivers/ipw3945/*/rf_kill results in a 0), however it does not seem to take care of the latency before starting wpa_supplicant:

```

# /etc/init.d/net.eth2 start

 * Caching service dependencies ...                                       [ ok ]

 * Starting eth2

 *   Wireless radio has been killed for interface eth2

 *   wpa_supplicant will launch, but not associate until

 *   wireles radio is re-enabled for interface eth2

 *   Starting wpa_supplicant on eth2 ...

ioctl[SIOCSIWMODE]: Resource temporarily unavailable

Could not configure driver to use managed mode

ioctl[SIOCGIWRANGE]: Resource temporarily unavailable

ioctl[SIOCSIWAUTH]: Resource temporarily unavailable

WEXT auth param 7 value 0x1 - ioctl[SIOCSIWENCODEEXT]: Resource temporarily unavailable

ioctl[SIOCSIWENCODEEXT]: Resource temporarily unavailable

ioctl[SIOCSIWENCODEEXT]: Resource temporarily unavailable

ioctl[SIOCSIWENCODEEXT]: Resource temporarily unavailable

ioctl[SIOCSIWAUTH]: Resource temporarily unavailable

WEXT auth param 4 value 0x0 - ioctl[SIOCSIWAUTH]: Resource temporarily unavailable                                                                               [ ok ]th param 5 value 0x1 - 

 *   Starting wpa_cli on eth2 ...                                         [ ok ]

 *     Backgrounding ...
```

When applying the preup()-workaround, things look much better already:

```
# /etc/init.d/net.eth2 start

 * Starting eth2

 *   Running preup function                                               [ ok ]

 *   Starting wpa_supplicant on eth2 ...                                  [ ok ]

 *   Starting wpa_cli on eth2 ...                                         [ ok ]

 *     Backgrounding ...
```

However, I want the init script to do the things right! It does enable my wireless, it only does not take care of the latency it has to come up. There should be lots of wireless cards out there suffering from this problem, so I feel it should be solved only once.

Some background information: wpa_supplicant-0.5.4 (-Dwext), gentoo-sources 2.6.19-r4 (in-kernel ieee80211), ipw3945-1.1.3-r2

----------

## Huttu

I'm confronted with the same problem after updating to kernel 2.6.19. I had to reemerge every kernel module to make them run on 2.6.19. and also on the old 2.6.18-r5 again.

----------

## bmw

Yes, I'm having the same issue, except that I had to increase the sleep to 5 seconds.  Ideas, anyone?

----------

## emitrax

I upgraded to kernel 2.6.20 and ipw3945 1.2.0.

The only way for me to get my card up and running is to make sure the ipw3945d is stopped, then I load the ipw3945 module, and right after that I start the ipw3945d deamon. 

I know it doesn't make much sense, but it's the only way for me to get my wireless working.

----------

## Ant

Another solution from here instead of the preup function

 *menschmeier wrote:*   

> 
> 
>  *Quote:*   
> 
> The problem is the config of the driver, wpa_supplicant says:
> ...

 

----------

