# hostapd gives "ioctl[SIOCS80211, op=20, val=0, arg_len=7]: No such file or directory" after device (tries to) connect



## ove (Jul 13, 2021)

When I'm trying to connect to an access point setup using hostapd I get the following error codes:

```
wlan0: STA <mac address> IEEE 802.11: associated
ioctl[SIOCS80211, op=20, val=0, arg_len=7]: No such file or directory
ioctl[SIOCS80211, op=20, val=0, arg_len=7]: No such file or directory
ioctl[SIOCS80211, op=21, val=0, arg_len=42]: No such file or directory
ioctl[SIOCS80211, op=20, val=0, arg_len=7]: No such file or directory
wlan0: STA <mac address> IEEE 802.11: disassociated
ioctl[SIOCS80211, op=20, val=0, arg_len=7]: No such file or directory
ioctl[SIOCS80211, op=20, val=0, arg_len=7]: No such file or directory
ioctl[SIOCS80211, op=21, val=0, arg_len=42]: No such file or directory
```

the device I'm trying to connect with seems to connect at first but then it disconnects and asks for the password again.
I don't think it's the password that is wrong because it's literally 123456789, and I even ssh:ed into the hostap machine and copy pasted from the config file to make sure no unicode funkiness was going on.

I used the FreeBSD handbook to setup the AP and I've made sure all network drivers are loaded.
rtwn0 doesn't show up in ifconfig, but it can be found with pciconf -lv, maybe this could mess up the io?

I create wlan0 and bridge using:

```
ifconfig wlan0 create wlandev rtwn0 wlanmode hostap
ifconfig wlan0 inet 192.168.0.1 netmask 255.255.255.0 ssid networkname mode 11g channel 1
ifconfig bridge create
ifconfig bridge0 addm ue0 addm wlan0 up
ifconfig ue0 up
ifconfig wlan0 up
```

I read in the wireless mailing list that someone had a similar error with wpa_supplicant but that was because a new mac address was assigned to the wifi card before starting wpa_supplicant as I understood it.

It works just fine without WPA2, so I'm a bit baffled it doesn't work with WPA2 too, I thought it was just something quick to fix but it has taken me several hours and I can't find nothing.


----------



## Emrion (Jul 13, 2021)

This is maybe related: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=249542
Adrian speaks of crypto key slots.

Reading rtwn(4), I think it would be interesting to check the value of the tunables, like _dev.rtwn.0.hwcrypto._


----------

