# wpa_supplicant + ndiswrapper woes with 2.6.23

## bolt

I'm using wpa_supplicant-0.5.8 (WPA2-PSK) + ndiswrapper-1.50 to connect to the internet, and with kernel 2.6.22-r10 (gentoo-sources) everything is working well. When trying a new 2.6.23 kernel (gentoo-sources, -r*, menuconfig'd from scratch) my interface (wlan0) does come up, but isn't functional.

According to iwconfig everything is fine, but I can't ping to my modem/router/accespoint/whatever (Host unreachable), and according to ifconfig no packets are being sent over the interface. netstat -r stalls for about 10 seconds before showing the (correct) routing table.

I can still manually configure the interface with wpa_supplicant, but only *with the -d debugging switch* and *without the -B background switch* (and subsequently, ifconfig wlan0 blah + route add default blah), after which everything works as expected.

My question is: has anyone else had trouble with wpa_supplicant + ndiswrapper after upgrading to 2.6.23, and/or found a workaround/fix for it?

----------

## micmac

Works fine for me.

Have you considered copying the 2.6.22/.config to 2.6.23/.config and running "make oldconfig" instead of starting from scratch? Starting from scratch every time one compiles a new kernels isn't such a good idea as some settings may just slip by.

Regards

mic

----------

## bolt

That's what I tried before starting from scratch.  :Wink:  The new 2.6.23 config is as close as can be to the working 2.6.22 config. BTW, what kernel/ndiswrapper/wpa_supplicant versions are you using?

----------

## micmac

Vanilla 2.6.23.12 and ndiswrapper version 1.51 (smp=yes, preempt=no)

----------

## kds66

I experienced the same problem after updating the kernel to 2.6.23:

- wpa_supplicant-0.5.7

- ndiswrapper-1.50

Works with gentoo-sources-2.6.22-r9.

Doesn't work with gentoo-sources-2.6.23-r3.

----------

## mar_rud

Have similar problem:

gentoo-sources-2.6.23-r3

wpa_supplicant-0.5.8

ndiswrapper-1.49, 1.50

To add some of mine observations:

- it connects to AP and after static ip assignment interface is not responding to any activity. With dhcp it's the same, it only timeouts and assigns some random ip.

- after few pings wpa_supplicant repeats in 10s period these actions (taken from wpa_gui/wpa_cli):

```
Associated with /AP_MAC/

WPA: Key negotiation completed with /AP_MAC/ [PTK=CCMP GTK=CCMP]

CTRL-EVENT-CONNECTED - connection to /AP_MAC/ completed  (reauth) [id=1 id_str=]
```

sometimes also:

```
CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys

Trying to associate with /AP_MAC/
```

and again previous 3 lines.

- sometimes I got full system hang while in such bad connection (no keyboard/mouse end even acpi reaction to power button)

- After few tries it finally connects correctly and I have stable full working till next need to restart computer, so I try to not turn off my laptop (average uptime is now few days for me  :Smile:  )

- Tried previous 2.6.22-r9 and it worked for each time without problems.

----------

## bolt

I have been unable to get the interface up and *working* with the gentoo boot scripts at all, no matter how many tries I gave it. But doing it manually with:

# /etc/init.d/net.wlan0 stop

# wpa_supplicant -iwlan0 -Dwext -d -c /etc/wpa_supplicant/wpa_supplicant.conf           # With -d and without -B

<switch vt> (probably appending & will work as well)

# ifconfig wlan0 192.168.1.32/24

# route add default gw 192.168.1.254 dev wlan0

seems to work reliably for me. Maybe this will help your laptop get some sleep.  :Smile: 

----------

## mamac

Hi,

Experiencing the same problem with some kernel oops as well.

AP configured with WPA-PSK.

There's a bug here: https://bugs.gentoo.org/show_bug.cgi?id=201359 , maybe you could add your input.

Doesn't work even if I come back to 2.6.22-r9.

I'll try the manual config to see how it behaves.

----------

## mamac

 *bolt wrote:*   

> I have been unable to get the interface up and *working* with the gentoo boot scripts at all, no matter how many tries I gave it. But doing it manually with:
> 
> # /etc/init.d/net.wlan0 stop
> 
> # wpa_supplicant -iwlan0 -Dwext -d -c /etc/wpa_supplicant/wpa_supplicant.conf           # With -d and without -B
> ...

 

Even this procedure doesn't work for me as the interface can't be associated with the AP.

wpa_supplicant says:

```

Trying to associate with 3e:24:47:32:e0:5c (SSID='jmb' freq=2462 MHz)

...

Authentication with 00:00:00:00:00:00 timed out

```

----------

## mar_rud

 *mamac wrote:*   

> Even this procedure doesn't work for me as the interface can't be associated with the AP.
> 
> wpa_supplicant says:
> 
> ```
> ...

 

I use two AP's and on first (Linksys wrt54gc) it connects immediately, but sometimes with dead interface since 2.6.23. With second one (some Pentagram with ADSL2 modem) it often timeouts for a while before connecting. The same timeouts I have in Windows XP so I ignore it. I just wait or restart /etc/init.d/net.wlan0 few times until connected and sometimes when it last too long I restart AP as it likes to hang. Of course it can be some wpa_supplicant configuration problem in Your case if You ware not able to connect even once.

BTW. I have bcm4318 wifi in my laptop if it matters:

02:02.0 Network controller: Broadcom Corporation BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller (rev 02)

----------

## The_Docter

I have exactly the same problem on both of my computers (on has a marvell and on has a intersil chipset). Both are running with ndiswrapper 1.50/1.51. With gentoo-sources-2.6.22-r9 the interfaces work fine, however with 2.6.23 dhcpcd fails on both.

I say dhcpcd, because using NetworkManager on my laptop is working flawless (besides that NetworkManager can be annoying   :Very Happy: ).

To me this seems to be a bug in dhcpcd and/or the gentoo scripts (as bolt seems to use a static configuration?), that has been exposed by ndiswrapper + kernel 2.6.23. Can anybody confirm this observation?

(Oh, btw: Both .configs for 2.6.23 have been generated using make oldconfig)

----------

## mamac

 *The_Docter wrote:*   

> To me this seems to be a bug in dhcpcd and/or the gentoo scripts (as bolt seems to use a static configuration?), that has been exposed by ndiswrapper + kernel 2.6.23. Can anybody confirm this observation?

 

Dificult for me to know where the bug lies, at least I know my laptop works with 2.6.23, same version of wpa_supplicant and ipw3945 driver.

----------

## mamac

I tested ndiswrapper 1.51 but that didn't help.

The interface can associate with AP when not encrypted or using WEP.

So, the only alternative for me is to use WEP to be able to associate and kernel 2.6.22 to avoid kernel oops.

I look forward to testing upgrades to go back to WPA!

----------

## serial_penguin

I got the same problem here

Broadcom Corporation BCM4318 chipset

ndiswrapper-1.50

wpa_supplicant-0.5.8 (WPA2-PSK, CCMP)

dhcpcd-3.1.8

on an amd64 laptop. Works just fine with gentoo-sources-2.6.20-r8, but fails to get an IP address with 2.6.23-r3 sources. The 2.6.23-r3 kernel was built using the .config from 2.6.20-r8 and running make oldconfig. I made sure all the Network -> Wireless IEEE modules were built. From wpa_gui the wireless interface just scans without getting an IP. Starting wpa_supplicant manually and using

```

dhcpcd -L wlan0 -s 192.168.1.134/24

```

eventually fails with a time-out.

----------

## mamac

Does anyone tested without any encryption or using WEP, instead of WPA? I'm not saying using no encryption or WEP is a workaround but I only want to know if it behaves like here.

----------

## xathin

I am having similar problems. Mine gets associated, tries to do the handshaking, and just sits there and won't go anywhere. Sometimes, on rare occassions, it will actually connect. I'm not sure how it does it, but I have actually used it.

I'm currently running gentoo-sources-2.6.23-r3, wpa_supplicant 0.5.7, ndiswrapper 1.50, dhcpcd 3.1.5-r1, BCM4318 (14e4:4320 rev 02).

I have tested this without encryption, running through wpa_supplicant, and had no problems connecting. As soon as I enabled WPA or WPA2, it died. Did not try with WEP. I'm going to test the net-misc/networkmanager-0.56.5_p20070823 to see if I have any success with that.

----------

## xathin

I can say that Network Manager does work. I've tried it a few times, rebooting a number of times, and I've been able to connect each time using WPA. I'm not sure exactly where the issue lies, but using Network Manager does work. I'm using kNetworkManager to set the WPA key, and have not had problems. I would use the nm-applet, but there are too many gnome requirements to install, as I am using Xfce4.

Network Manager bypasses wpa_supplicant, dhcpcd, and even the /etc/init.d/net.* files, so the problem may lie with one of those programs, being combined with the new gentoo sources. I am by no means an expert on Linux or Gentoo, and I could be totally off base with this assumption, but it is the only logical option that I can see.

----------

## pappy_mcfae

This problem isn't peculiar to Gentoo. My Slackware laptop will connect, but any iwconfig commands render the wireless network completely inoperable. And, if the W/L adapter decides to become comatose, bye-bye wireless until the next reboot. Not a good thing.

Therefore, I don't run the 2.6.23.x family, vanilla or otherwise on my laptops. Right now, my old laptop is finishing up its fresh Gentoo install Yes, another machine gets Gentoo...manual install this time. It would have gone a lot better if the DVD ROM wasn't just this side of dead.

I'm not sure what the problem is, but I have decided until I hear that bug has been fixed, I am limiting my laptops to vanilla 2.6.22.x kernels.

It's a real bummer. I'd love to have that built into the kernel hibernation option.

Blessed be!

Pappy

----------

## xathin

Correction to my hardware, it's BCM4306, not 4318.

I may have spoken too soon with regards to NetworkManager. After using it without problems, I have now run into an issue where it does not connect. I believe this is the same problem as before. I guess the only option is to wait until the 2.6.24 kernels are released to see if the issue is resolved then.

Until then, 2.6.22 seems to be the most stable way to go.

----------

## aspro

I've tried =sys-kernel/vanilla-sources-2.6.24-rc8 although it's still ~x86 masked. But the problem(s) remained.

----------

## Mark Clegg

I also get problems with ndiswrapper, but it's not specific to 2.6.23...

I'm using a Belkin PCI card, with an RTL8185 chipset.

About 50% of the time, it just works, the other 50%, it fails (green light on the card never comes on).  I then have to unload the modules, and reload by hand.

```

/etc/init.d/net.wlan0 stop

rmmod ndiswrapper

modprobe ndiswrapper

/etc/init.d/net.wlan0 start

```

... possibly a couple of times to get it working.  Maybe this will work in your case too?

I'm currently on ndiswrapper 1.51 and wpa-supplicant 0.57.

Once running, it's fine.

I've not been worrying too much, as I can always get it working this way, and an rtl8185 native driver seems to be in the works. (USB has hit mainline kernel, but not PCI).

----------

## pappy_mcfae

The problem with 2.6.23.x and 2.6.24.x kernels not supporting ndiswrapper is pandemic. While ndiswrapper 1.50 was supposed to support .23, and ndiswrapper 1.51 was supposed to support .24, that simply isn't the case. I was running Slackware 12 when the .23 version came out. I fought for days to get it to work in a stable fashion. No dice.

I tried 2.6.23.16 and the latest gentoo-sources versions, and still ndiswrapper isn't supported. I have a bug report on 2.6.24 and ndiswrapper, but it's not really going anywhere.

2.6.22.x is the way to go if you want ndiswrapper support...this is truer if you are also using wpa_supplicant.

Blessed be!

Pappy

----------

## kds66

Since gentoo-sources-2.6.22-* were masked, the latest stable version of the kernel that works with ndiswrapper/wpa_supplicant has been 2.6.21. Does anybody know if 2.6.24 provides native support so that ndiswrapper is no longer required?

----------

## pappy_mcfae

 *kds66 wrote:*   

> Since gentoo-sources-2.6.22-* were masked, the latest stable version of the kernel that works with ndiswrapper/wpa_supplicant has been 2.6.21. Does anybody know if 2.6.24 provides native support so that ndiswrapper is no longer required?

 

So, unmask them. It's easy!

1) Go to the /etc/portage directory.

2) Find or create the file package.keywords. 

3) To that file, add the following:

```
=sys-kernel/gentoo-sources-2.6.22-r10 ~x86
```

4) Emerge the kernel. 

Yes, the 2.6.24.x kernels do provide a native driver. However, that driver does cause some problems with wpa_supplicant. It is also twenty-five to seventy-five percent slower than the ndiswrapper module. And, if your networking setup relies on renaming the interface, you will need to emerge iproute2 for that to work.

Good luck!

Blessed be!

Pappy

----------

## BaNdit400

Same problem here!!

I am installing Gentoo on a laptop Asus L8400L and i configured...

 - net-wireless/wireless-tools-29

 - net-wireless/ndiswrapper-1.50

 - net-wireless/wpa_supplicant-0.5.7

...to use a USB key OvisLink WL-5460USB. The kernel is sys-kernel/vanilla-sources-2.6.23.16 and has been compiled using the default configuration of sys-kernel/genkernel-3.4.9.

These are the configuration's files...

/etc/wpa_supplicant/wpa_supplicant.conf

```
ctrl_interface=/var/run/wpa_supplicant

network={

        ssid="mio_ssid"

        scan_ssid=1

        proto=WPA

        key_mgmt=WPA-PSK

        pairwise=TKIP

        psk="mia_psk"

}
```

/etc/conf.d/net

```
modules=( "ifconfig" )

modules=( "wpa_supplicant" )

config_eth0=( "dhcp" )

wpa_supplicant_wlan0="-D wext"

config_wlan0=( "dhcp" ) 
```

I think that the hardware works properly (with Ubuntu working properly, for example), but in this case (on Gentoo) wpa_supplicant shows an error message...

```
ndiswrapper -l

sis163u : driver installed

        device (0457:0163) present

ifconfig wlan0 up

wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -D wext -dd

Initializing interface 'wlan0' conf '/etc/wpa_supplicant/wpa_supplicant.conf' driver 'wext' ctrl_interface 'N/A' bridge 'N/A'

Configuration file '/etc/wpa_supplicant/wpa_supplicant.conf' -> '/etc/wpa_supplicant/wpa_supplicant.conf'

Reading configuration file '/etc/wpa_supplicant/wpa_supplicant.conf'

ctrl_interface='/var/run/wpa_supplicant'

Line: 6 - start of a new network block

ssid - hexdump_ascii(len=7):

     41 69 72 4c 69 76 65                              mio_ssid

scan_ssid=1 (0x1)

proto: 0x1

key_mgmt: 0x2

pairwise: 0x8

PSK (ASCII passphrase) - hexdump_ascii(len=8): [REMOVED]

PSK (from passphrase) - hexdump(len=32): [REMOVED]

Line 13: removed CCMP from group cipher list since it was not allowed for pairwise cipher

Priority group 0

   id=0 ssid='mio_ssid'

Initializing interface (2) 'wlan0'

EAPOL: SUPP_PAE entering state DISCONNECTED

EAPOL: KEY_RX entering state NO_KEY_RECEIVE

EAPOL: SUPP_BE entering state INITIALIZE

EAP: EAP entering state DISABLED

EAPOL: External notification - portEnabled=0

EAPOL: External notification - portValid=0

ioctl[SIOCSIWPMKSA]: Invalid argument

SIOCGIWRANGE: WE(compiled)=22 WE(source)=18 enc_capa=0xd

  capabilities: key_mgmt 0x5 enc 0xf

WEXT: Operstate: linkmode=1, operstate=5

Own MAC address: 00:4f:63:00:e3:0f

wpa_driver_wext_set_wpa

wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=1 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=2 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=3 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_countermeasures

wpa_driver_wext_set_drop_unencrypted

Setting scan request: 0 sec 100000 usec

ctrl_interface_group=10 (from group name 'wheel')

Added interface wlan0

Daemonize..

wpa_cli

>status

bssid=00:4f:62:08:62:07

ssid=mio_ssid

id=0

pairwise_cipher=TKIP

group_cipher=TKIP

key_mgmt=WPA-PSK

wpa_state=COMPLETED
```

...and wlan0 don't work!!

What could cause the error "ioctl [SIOCSIWPMKSA]: Invalid argument"?

Thanks in advance   :Very Happy: 

EDIT @ 24/02/2008 12:05: I forgot to say that i tried to use this configuration on kernel sys-kernel/vanilla-sources-2.6.20.7, but wlan0 continues to fail: ioctl[SIOCSIWPMKSA]!!!  :Sad: 

EDIT @ 24/02/2008 14:03: I tried to install net-wireless/wpa_supplicant-0.5.8, net-wireless/wpa_supplicant-0.6.1, net-wireless/ndiswrapper-1.52, but the error continues to be present: ioctl[SIOCSIWPMKSA]!!!  :Sad: 

----------

## jstad

has this been fixed? or figured out?

----------

## mamac

Not for me. I gave up, the desktop computer is now wired.

----------

## mar_rud

I give up ndiswrapper and switched to native b43 driver to my bcm4318 card from compat-wireless-2.6:

https://forums.gentoo.org/viewtopic-t-547687-start-200.html#4903325

With older b43 one from kernel I have problems with speed and that is why I use more recent which has improved rate control algorithm.

Now in my case I have connection in each try and speed comparable to ndiswrapper.

----------

## pappy_mcfae

I recently discovered some info that might be of help to those plagued by ndiswrapper problems. Read this link and this one as well. They don't mention the .23 family kernels. That's when I noticed problems with ndiswrapper. I wonder if they didn't start experimenting with shutting down ndiswrapper at that point.

It seems we are as tied to the whims of kernel developers as the standard M$ user is to the windoze update site, and cared about as much.

Blessed be!

Pappy

----------

