TL;DR. I need to get to the bottom of:
- why there are errors related to
ioctl
when usingwext
driver, - why I'm not able to use
nl80211
driver.
When running wpa_supplicant
I get weird errors (note lines starting with ioctl
below):
$ sudo wpa_supplicant -D wext -i wlan0 -c wpa_supplicant.conf
Successfully initialized wpa_supplicant
ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
wlan0: Trying to associate with 04:8d:38:59:2d:63 (SSID='netis' freq=2457 MHz)
wlan0: Association request to the driver failed
wlan0: Associated with 04:8d:38:59:2d:63
wlan0: WPA: Key negotiation completed with 04:8d:38:59:2d:63 [PTK=CCMP GTK=TKIP]
wlan0: CTRL-EVENT-CONNECTED - Connection to 04:8d:38:59:2d:63 completed [id=0 id_str=]
I need to get to the bottom of why there are ioctl
errors.
A few notes:
- my goal here is learning; I want to get rid of the errors, even if that means submitting a patch to
wpa_supplicant
, to Raspbian, or to linux kernel/driver itself, - there is no problem with WiFi; it's working; I do get the internet connection with the output above, there's no problem with that,
- if it's impossible to get rid of errors in my case, I'd like to understand why is that exactly,
- I haven't tried to test against most up-to-date stable & RC versions of linux kernel; looking for evidence (a commit in linux kernel repo?) that I'll help before diving into compiling my own kernel,
- I have found the errors in the source code, here and here respectively. Not sure where to go from there.
What I've learned so far
Running
wpa_supplicant
withnl80211
is not working at all:$ sudo wpa_supplicant -D nl80211 -i wlan0 -c wpa_supplicant.conf Successfully initialized wpa_supplicant nl80211: Driver does not support authentication/association or connect commands wlan0: Failed to initialize driver interface
Why not? I thought
nl80211
is superior towext
:Is WE being further developed? No it is not. Only bug fixes are being accepted for WE.
What is Wireless-Extensions' replacement? New development should be focused on cfg80211 and nl80211.
https://wireless.wiki.kernel.org/en/developers/Documentation/Wireless-Extensions
According to this list, my device
RTL8188CUS
is supported by driver8192cu
, which is loaded as a kernel module (see below),Compiling and running
wpa_supplicant
version 2.5 yields the sameioctl
errors.
About my environment
Stock version of wpa_supplicant
:
$ wpa_supplicant -v
wpa_supplicant v2.3
Copyright (c) 2003-2014, Jouni Malinen <j@w1.fi> and contributors
Contents of wpa_supplicant.conf
:
$ cat wpa_supplicant.conf
network={
ssid="my_network_name"
psk="my_password"
}
List of USB devices:
$ lsusb
Bus 001 Device 004: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Distro version:
$ uname -a
Linux raspberrypi 4.1.18+ #846 Thu Feb 25 14:11:56 GMT 2016 armv6l GNU/Linux
Loaded kernel modules:
$ lsmod
Module Size Used by
cfg80211 479279 0
rfkill 21508 1 cfg80211
8192cu 556175 0
bcm2835_gpiomem 3703 0
snd_bcm2835 22502 0
bcm2835_rng 2207 0
snd_pcm 92829 1 snd_bcm2835
snd_timer 22164 1 snd_pcm
snd 67534 3 snd_bcm2835,snd_timer,snd_pcm
uio_pdrv_genirq 3526 0
uio 10078 1 uio_pdrv_genirq
ipv6 358702 24
Contents of ifconfig
:
$ ifconfig
eth0 (...omitted for brevity...)
lo (...omitted for brevity...)
wlan0 Link encap:Ethernet HWaddr 00:f1:40:41:03:a7
inet addr:192.168.1.104 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::c085:fb91:3e68:a44d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:38 errors:0 dropped:61421 overruns:0 frame:0
TX packets:62 errors:0 dropped:4 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:19804518 (18.8 MiB) TX bytes:1192972 (1.1 MiB)
Update 10/8/2016: Per suggestion from Rui F Ribero below, I tried using unofficial drivers. Results:
This error:
ioctl[SIOCSIWENCODEEXT]: Invalid argument
is now gone! Howeverioctl[SIOCSIWAP]: Operation not permitted
is still present.wpa_supplicant
still won't work with now-unofficialnl80211
driver. Only this time output has a new message starting with deinit:$ sudo ./wpa_supplicant -D nl80211 -i wlan0 -c wpa_supplicant.conf Successfully initialized wpa_supplicant nl80211: Driver does not support authentication/association or connect commands nl80211: deinit ifname=wlan0 disabled_11b_rates=0 wlan0: Failed to initialize driver interface
raspbian
distribution, from Feb 26th – https://www.raspberrypi.org/downloads/raspbian/ – oldhomemovie Mar 09 '16 at 17:43