# Problems using init script to start wireless interface?

## tld

I just got a broadcom wireless card working using the native b43 driver in the 2.6.24 kernel.  Right now I'm connecting to an endpoint that only supports wep, though I'm doing it with wpa_supplicant using the wext wpa_supplicant driver.

The only reason it took me a long time to get working is that apparently it fails when manaully trying to start the interface with the init script, like this:

```
/etc/init.d/net.wlan0 start

 * Starting wlan0

 *   Starting wpa_supplicant on wlan0 ...

ioctl[SIOCSIWAUTH]: Operation not supported

WEXT auth param 4 value 0x0 - ioctl[SIOCSIWAUTH]: Operation not supported                            [ ok ]th param 5 value 0x1 - 

 *   Starting wpa_cli on wlan0 ...                                                            [ ok ]

 *     Backgrounding ...

```

The errors there are a little messed up, but that's exactly how they appear.  At that point any pings just get "network unreachable" trying to ping anything.

However if I let it come up simply by unplugging the wireless card from the PCMCIA and plugging it back in, it works perfectly.

What is the hotplug startup doing differently that is would work?

This actually reminds me of issues I had with a wired card on this laptop when stopping the service to change from dhcp to a static ip.  The network would be unreachable but would work fine on reboot...seems similar.

Tom

----------

## Xanadu

 *tld wrote:*   

> 
> 
> ```
> /etc/init.d/net.wlan0 start
> 
> ...

 

I have a similar problem, except that I have a PCI card of theirs, I can't just pop it out and try it again!  :Laughing: 

When the card does connect, it works great, but it's a mind numbing series of reboots trying to get the thing to "reset itself" (or something...) to get it to work.  That card is the only thing that's keeping one of my machines on w2k.  I rent an apartment in an old-ish building.  I can't run CAT-5 cable back to it because I can't punch holes in the walls and I can't just run cable down the hallway to it because most of the rooms are hardwood floors so I can't tuck it under the carpet to stop people tripping on it (or the damn cats chewing it).  My only option is wireless for that machine and w2k likes it every reboot, but, Linux (Gentoo) only can bring the link up once in a while. :/

----------

## tld

Well, at least mine seems to work on every reboot and/or every hotplug, as far as I've seen...so I'm better off than that at least.  Trying to stop it and restart it from the init script however never does.

I thought maybe the hotplugging was doing something different that just running the init script, but I guess it may be more of a hardware issue.

I'm running sys-kernel/vanilla-sources-2.6.24_rc6 to have the newer b43 support.

Tom

----------

## Xanadu

 *tld wrote:*   

> Well, at least mine seems to work on every reboot and/or every hotplug, as far as I've seen...so I'm better off than that at least.  Trying to stop it and restart it from the init script however never does.
> 
> I thought maybe the hotplugging was doing something different that just running the init script, but I guess it may be more of a hardware issue.
> 
> I'm running sys-kernel/vanilla-sources-2.6.24_rc6 to have the newer b43 support.
> ...

 

I should've typed it before, but if you feel like typing rather than popping the card in and out, you can also do "pccard reset" and that should do it to.  I have to do that every 10-20 seconds when I'm using kismet with an orinoco PCMCIA wireless NIC in this machine laptop.  I don't know why, and I've yet to figure out how to not make it so I don't have to reset the NIC all the time.  I get something about IRQ over runs (or something very similar to that).

Anyway, sorry I can't solve your issue, but I just wanted to say I (sort of) share your pain.  :Mad: 

----------

## tld

 *Xanadu wrote:*   

> 
> 
> I should've typed it before, but if you feel like typing rather than popping the card in and out, you can also do "pccard reset" and that should do it to.

 

What package is the 'pccard' command from?  I can do something similar to that with the pccardctl program from the pcmciautils package:

```
pccardctl eject 1

pccardctl insert 1
```

...where '1' is the slot number, but I don't have any pccard program.

Tom

----------

## Xanadu

 *tld wrote:*   

> What package is the 'pccard' command from?  I can do something similar to that with the pccardctl program from the pcmciautils package:
> 
> ```
> pccardctl eject 1
> 
> ...

 

Ya know, I should actually fire up konsole from time to time when I go to type something here...

You're right, it's "pccardctl", I use the reset command when I'm using kismet since I can't eject (logically or physically) the card it's trying to use to scan for networks for obvious reasons!  :Very Happy:   I'm too used to typing "pcc" then just hitting TAB...

 :Laughing: 

Oh, well.  I'll get it  right one of these days...  :Embarassed: 

----------

## kwisatz_haderais

has anyone come up with a solution to the initial problem?

My card is a bcm4318 and I'm getting the exact same error with b43 in combination with wpa_supplicant.

Though I'm never getting it to work. The card simply doesn't associate  :Sad: 

btw. could someone change the topic to smth like "b43 and wpa_supplicant. problems with wext" ?

Because I guess that's rather the problem, not the init script.

edit: Well, the b43 driver isn't listed as supported on the wpa_supplicant page http://hostap.epitest.fi/wpa_supplicant/ (unless that's what they mean by Broadcom wl.o) and the feature in question seems to be wpa_driver_wext_set_countermeasures

----------

## jxn

I'm also having this problem with my b43 driver, wpa_supplicant, and wireless card broadcom 4318.

bummer.

Also, this is probably an idiotic question, but I thought I remembered reading in some docs somewhere that ioctl was only used with the legacy mac80211 stack, and should not be employed by the new kernel modules... taking into account the fact that I have no idea what I'm doing, the fact that we see ioctl in the error is not indicative of the wireless configuration attempting to utilize the wrong wireless stack support from the kernel modules, is it?  Thanks for humouring me.

----------

## kwisatz_haderais

From what I know of wifi driver architecture and wpa_supplicant (which is very little I'm afraid), the wpa_supplicant <--> driver interplay is somewhat like this:

```
wpa_supplicant <--> wext driver (driver_wext.h) <--> wifidevice (aka wifi driver [in our case b43]) <--> hardware
```

The wext driver implements wpa operations and communicates with the actual device driver. Now either (if as you said ioctl shouldn't be used by mac80211) wpa_supplicant doesn't work with newer drivers based on mac80211 (then other drivers wouldn't work either) or the b43 driver fails to implement certain features required by wpa_supplicant and subsequently the wext driver.

I'll see if I can find some information on wpa_supplicant <--> mac80211 interplay

----------

## kwisatz_haderais

 *http://www.mail-archive.com/bcm43xx-dev@lists.berlios.de/msg05041.html wrote:*   

> > In bcm43xx, those IOCTL's were implemented. In mac80211, they are not as they 
> 
> > are not needed. As you
> 
> > see, those messages are not fatal.

 

So it should work, regardless of these messages and you were right about the ioctls. Why then, doesn't my card associate?  :Sad: 

----------

## kwisatz_haderais

My AP is well recognized:

 *iwconfig eth1 wrote:*   

> eth1      IEEE 802.11g  ESSID:"FunkyB19"  
> 
>           Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated   
> 
>           Tx-Power=27 dBm   
> ...

 

but as I already mentioned, it doesn't associate:

 *wpa_supplicant -ddd wrote:*   

> Initializing interface (2) 'eth1'
> 
> EAPOL: SUPP_PAE entering state DISCONNECTED
> 
> EAPOL: KEY_RX entering state NO_KEY_RECEIVE
> ...

 

I can remember having experienced the exact same problem (00:00:00:00:00:00 BSSID) before, but not what the solution to that was.

----------

## tld

Actually, I've discovered that I always get those errors.  My card associates fine if I either a) hotplug the card, or b) boot with the card in.

Stopping and starting with the init scripts however never associates correctly.

Tom

----------

## kwisatz_haderais

In my case, it is a pci card, therefore, it is always plugged in. But that doesn't associate it for me.

----------

## swimmer

You could put the bssid in wpa_supplicant.conf and see whether it helps:

```
bssid=<MAC-address of your router>
```

HTH

swimmer

----------

## kwisatz_haderais

it is already in there  :Wink: 

----------

## kgroombr

Check out this tread as it helped me to get mine working:

https://forums.gentoo.org/viewtopic-t-652112-highlight-wext+auth+param.html

Ken

----------

## kwisatz_haderais

chill!

I don't know if it was 

```
iwconfig eth1 txpower on 
```

or setting ap_scan to 1 that did it... but I'm online with my b43 now.

Bye bye ndiswrapper

----------

## slackline

 *kwisatz_haderais wrote:*   

> chill!
> 
> I don't know if it was 
> 
> ```
> ...

 

Any chance you could post your /etc/conf.d/net and /etc/wpa_supplicant/wpa_supplicant.conf ?  I'm having similar problems with a bcm4306 (I've posted some details in here) but haven't had any success, can't even scan.

Cheers,

slack

----------

## kwisatz_haderais

wpa_supplicant.conf:

 *Quote:*   

> ap_scan=1
> 
> network={
> 
> 	priority=1
> ...

 

conf.d/net:

 *Quote:*   

> modules=("wpa_supplicant")
> 
> wpa_supplicant_eth1="-Dwext"

 

The important thing was to set ap_scan to 1 instead of 2

----------

## slackline

Well, I seem to have resolved this myself.

I decided to try going back to using iwconfig to configure the card as I had originally with ndiswrapper inserting the module.

What do you know it worked!  Goodbye ndiswrapper   :Very Happy: 

```

# lsmod

Module                  Size  Used by

snd_seq                44336  0 

snd_pcm_oss            34336  0 

snd_mixer_oss          14016  1 snd_pcm_oss

snd_intel8x0           28124  0 

snd_ac97_codec         95268  1 snd_intel8x0

ac97_bus                1664  1 snd_ac97_codec

snd_pcm                63176  3 snd_pcm_oss,snd_intel8x0,snd_ac97_codec

snd_timer              18628  2 snd_seq,snd_pcm

snd_page_alloc          7496  2 snd_intel8x0,snd_pcm

b43                   132964  0 

```

```

b43-phy0 debug: Loading firmware version 351.126 (2006-07-29 05:54:02)

b43-phy0 debug: Chip initialized

b43-phy0 debug: 30-bit DMA initialized

b43-phy0 debug: Wireless interface started

b43-phy0 debug: Adding Interface type 2

ADDRCONF(NETDEV_UP): wlan0: link is not ready

wlan0: Initial auth_alg=0

wlan0: authenticate with AP 00:0c:41:36:b5:9c

wlan0: RX authentication from 00:0c:41:36:b5:9c (alg=0 transaction=2 status=0)

wlan0: authenticated

wlan0: associate with AP 00:0c:41:36:b5:9c

wlan0: RX AssocResp from 00:0c:41:36:b5:9c (capab=0x401 status=0 aid=1)

wlan0: associated

wlan0: switched to short barker preamble (BSSID=00:0c:41:36:b5:9c)

ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

wlan0: Initial auth_alg=0

wlan0: authenticate with AP 00:0c:41:36:b5:9c

wlan0: RX authentication from 00:0c:41:36:b5:9c (alg=0 transaction=2 status=0)

wlan0: authenticated

wlan0: associate with AP 00:0c:41:36:b5:9c

wlan0: RX ReassocResp from 00:0c:41:36:b5:9c (capab=0x401 status=0 aid=1)

wlan0: associated

wlan0: Initial auth_alg=0

wlan0: authenticate with AP 00:0c:41:36:b5:9c

wlan0: RX authentication from 00:0c:41:36:b5:9c (alg=0 transaction=2 status=0)

wlan0: authenticated

wlan0: associate with AP 00:0c:41:36:b5:9c

wlan0: RX ReassocResp from 00:0c:41:36:b5:9c (capab=0x401 status=0 aid=1)

wlan0: associated

wlan0: no IPv6 routers present

```

```

# wlan0 - wireless network card

#

# For configuration details please refer to...

# 

# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#book_part4

module=( "wireless" )

config_AP=( "00:0C:41:36:B5:9C" )

config_ESSID=( "slack" )

preferred_aps=( "slack" )

associate_order=( "forceany" )

channel=( "9" )

iwconfig_wlan0="txpower on"

config_wlan0=( "dhcp" )

dhcpcd_wlan0=( "-t 30" )

dhcp_wlan0=( "release")

```

----------

