# wpa_supplicant: ioctl[SIOCSIWPMKSA]: Invalid argument

## humbletech99

I have a problem with wpa_supplicant using ndiswrapper:

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

 * Starting wlan0

 *   Starting wpa_supplicant on wlan0 ...

ioctl[SIOCSIWPMKSA]: Invalid argument    
```

I can't find any uncommented line regarding ioctl in /etc/wpa_supplicant.conf...

----------

## I.C.Wiener

Could you be more specific please?

What wlan card do you have? Did the modules load correctly (lsmod, dmesg)?

Your settings in /etc/conf.d/net regarding your wlan card might be of interest, too.

----------

## humbletech99

i've got a wg111 usb adapter working via ndiswrapper. Everything works, I just don't know why this error message occurs when there is no reference to ioctl in the wpa_supplicant file. 

/etc/conf.d/net

```
config_wlan0=( "10.0.0.6 netmask 255.255.255.0")

routes_wlan0=( "default gw 10.0.0.10")

modules=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dndiswrapper"
```

/etc/wpa_supplicant.conf

```
$ grep ^[^#] /etc/wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

eapol_version=1

ap_scan=1

fast_reauth=1

network={

        ssid="mynetwork"

        proto=WPA

        key_mgmt=WPA-PSK

        pairwise=TKIP

        psk="mysecretpassword"

        priority=5

}

```

----------

## I.C.Wiener

ioctl() is just a C function for controlling streaming devices (not even specially related to wlan). I guess it's getting called by wpa_supplicant with a wrong parameter or whatever and that's what's causing the error-msg.

I had a similar error with an atheros based card (madwifi) which I think disappeared when I set "ap_scan=0" in wpa_supplicant.conf and added the ap's mac to the network-section.

----------

## humbletech99

thanks for the tip, I'll try that tomorrow (it's 1:15 here and I have to be  up for work in under 6 hours...).

----------

