Bug 214266 - [rtwn] Lenovo T430, unable to connect - reason=CONN_FAILED loop
Summary: [rtwn] Lenovo T430, unable to connect - reason=CONN_FAILED loop
Status: Closed Not A Bug
Alias: None
Product: Base System
Classification: Unclassified
Component: wireless (show other bugs)
Version: 11.0-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-wireless mailing list
URL: https://forums.freebsd.org/threads/58...
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-06 12:42 UTC by Stefan Hagen
Modified: 2017-02-26 00:30 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Hagen 2016-11-06 12:42:28 UTC
Hello,

this is a follow-up to my forum post: https://forums.freebsd.org/threads/58416 as I assume it's a bug.

I'm on 11-RELEASE on my Lenovo T430 laptop. I have some trouble to get the wireless network to work. The weird part is, that it works in rare occations. So every 50th boot or so, it connects to my AP just fine. However, rebooting or restarting or changing the interface will break the connection and it won't reconnect.

Hardware is the PCIe version of the RTL8188CE adapter:

pciconf -lcve
rtwn0@pci0:3:0:0: class=0x028000 card=0x819510ec chip=0x817610ec rev=0x01 hdr=0x00
vendor = 'Realtek Semiconductor Co., Ltd.'
device = 'RTL8188CE 802.11b/g/n WiFi Adapter'
class = network
cap 01[40] = powerspec 3 supports D0 D1 D2 D3 current D0
cap 05[50] = MSI supports 1 message, 64 bit enabled with 1 message
cap 10[70] = PCI-Express 2 endpoint max data 128(128) RO
link x1(x1) speed 2.5(2.5) ASPM disabled(L0s/L1)
ecap 0001[100] = AER 1 0 fatal 2 non-fatal 1 corrected
ecap 0002[140] = VC 1 max VC0
ecap 0003[160] = Serial 1 019181feff4ce000
PCI-e errors = Correctable Error Detected
Non-Fatal Error Detected
Unsupported Request Detected
Non-fatal = Completer Abort
Unsupported Request
Corrected = Advisory Non-Fatal Error

/boot/loader.conf
if_rtwn_load="YES"
legal.realtek.license_ack=1

I copied the firmware files from /sys/contrib/dev/rtwn/ to /etc/firmware/

/etc/rc.conf
ifconfig_em0="up"
ifconfig_rtwn0="ether 00:21:cc:d3:e7:1b regdomain ETSI country DE"
wlans_rtwn0="wlan0"
ifconfig_wlan0="WPA"
cloned_interfaces="lagg0"
ifconfig_lagg0="laggproto failover laggport em0 laggport wlan0 DHCP"


/etc/wpa_supplicant.conf
network={
ssid="AntiGeek 802.11bg"
priority=1
bssid=90:84:0d:db:07:6d
psk=PASSWORDHASH
}


Software versions:
* 11.0-RELEASE-p2 (GENERIC amd64)
* wpa_supplicant v2.5 (I also tried the ports version)

Once I set the interface active with `service netif restart`, the following output gets written to /var/log/messages. It loops forever and never stays connected, even ifconfig shows an associations for 1-2 seconds while the device is "up".

Step 1: Successfully associated
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 00:21:cc:d3:e7:1b
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: IEEE 802.11 Wireless Ethernet OFDM/54Mbps mode 11g
status: associated
ssid "AntiGeek 802.11bg" channel 8 (2447 MHz 11g) bssid 90:84:0d:db:07:6d
regdomain ETSI country DE authmode WPA2/802.11i privacy ON
deftxkey UNDEF txpower 30 bmiss 7 scanvalid 60 bgscan bgscanintvl 300
bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS wme roaming MANUAL
groups: wlan


Step 2: The following log entries appear:
Nov 6 12:46:55 coffee kernel: wlan0: link state changed to DOWN
Nov 6 12:46:55 coffee wpa_supplicant[36053]: wlan0: CTRL-EVENT-DISCONNECTED bssid=90:84:0d:db:07:6d reason=3 locally_generated=1
Nov 6 12:46:55 coffee wpa_supplicant[36053]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="AntiGeek 802.11bg" auth_failures=4 duration=73 reason=CONN_FAILED


Step 3: The device scans again and eventually starts over (goto step 1)
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 00:21:cc:d3:e7:1b
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
status: no carrier
ssid "" channel 2 (2417 MHz 11g)
regdomain ETSI country DE authmode WPA1+WPA2/802.11i privacy ON
deftxkey UNDEF txpower 30 bmiss 7 scanvalid 60 bgscan bgscanintvl 300
bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS wme roaming MANUAL
groups: wlan

Full log /var/log/messages (it loops forever)
Nov 6 12:32:29 coffee wpa_supplicant[13913]: wlan0: Trying to associate with 90:84:0d:db:07:6d (SSID='AntiGeek 802.11bg' freq=2447 MHz)
Nov 6 12:32:39 coffee wpa_supplicant[13913]: wlan0: Authentication with 90:84:0d:db:07:6d timed out.
Nov 6 12:32:39 coffee wpa_supplicant[13913]: wlan0: CTRL-EVENT-DISCONNECTED bssid=90:84:0d:db:07:6d reason=3 locally_generated=1
Nov 6 12:32:41 coffee wpa_supplicant[13913]: wlan0: Trying to associate with 90:84:0d:db:07:6d (SSID='AntiGeek 802.11bg' freq=2447 MHz)
Nov 6 12:32:51 coffee wpa_supplicant[13913]: wlan0: Authentication with 90:84:0d:db:07:6d timed out.
Nov 6 12:32:51 coffee wpa_supplicant[13913]: wlan0: CTRL-EVENT-DISCONNECTED bssid=90:84:0d:db:07:6d reason=3 locally_generated=1
Nov 6 12:32:51 coffee wpa_supplicant[13913]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="AntiGeek 802.11bg" auth_failures=1 duration=10 reason=CONN_FAILED
Nov 6 12:33:07 coffee wpa_supplicant[13913]: wlan0: CTRL-EVENT-SSID-REENABLED id=0 ssid="AntiGeek 802.11bg"
Nov 6 12:33:07 coffee wpa_supplicant[13913]: wlan0: Trying to associate with 90:84:0d:db:07:6d (SSID='AntiGeek 802.11bg' freq=2447 MHz)
Nov 6 12:33:07 coffee wpa_supplicant[13913]: wlan0: Associated with 90:84:0d:db:07:6d
Nov 6 12:33:07 coffee kernel: wlan0: link state changed to UP
Nov 6 12:33:17 coffee wpa_supplicant[13913]: wlan0: Authentication with 90:84:0d:db:07:6d timed out.
Nov 6 12:33:17 coffee kernel: wlan0: link state changed to DOWN
Nov 6 12:33:17 coffee wpa_supplicant[13913]: wlan0: CTRL-EVENT-DISCONNECTED bssid=90:84:0d:db:07:6d reason=3 locally_generated=1
Nov 6 12:33:17 coffee wpa_supplicant[13913]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="AntiGeek 802.11bg" auth_failures=2 duration=31 reason=CONN_FAILED
Nov 6 12:33:47 coffee wpa_supplicant[13913]: wlan0: CTRL-EVENT-SSID-REENABLED id=0 ssid="AntiGeek 802.11bg"
Nov 6 12:33:47 coffee wpa_supplicant[13913]: wlan0: Trying to associate with 90:84:0d:db:07:6d (SSID='AntiGeek 802.11bg' freq=2447 MHz)
Nov 6 12:33:47 coffee wpa_supplicant[13913]: wlan0: Associated with 90:84:0d:db:07:6d
Nov 6 12:33:47 coffee kernel: wlan0: link state changed to UP
Nov 6 12:33:51 coffee wpa_supplicant[13913]: wlan0: CTRL-EVENT-DISCONNECTED bssid=90:84:0d:db:07:6d reason=0
Nov 6 12:33:51 coffee kernel: wlan0: link state changed to DOWN
Nov 6 12:33:51 coffee wpa_supplicant[13913]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="AntiGeek 802.11bg" auth_failures=3 duration=30 reason=CONN_FAILED

The AP is an old Apple Time Capsule. I tried different configurations and even an open network without authentication, no luck:

/var/log/messages when connecting to an open network (no authentication)
Nov 6 13:03:09 coffee kernel: wlan0: Ethernet address: 20:68:9d:48:81:cd
Nov 6 13:03:09 coffee wpa_supplicant[40246]: Successfully initialized wpa_supplicant
Nov 6 13:03:11 coffee kernel: rtwn0: timeout waiting for firmware initialization to complete
Nov 6 13:03:21 coffee wpa_supplicant[40249]: wlan0: Trying to associate with 9e:84:0d:db:07:6d (SSID='open_wlan' freq=2447 MHz)
Nov 6 13:03:31 coffee wpa_supplicant[40249]: wlan0: Authentication with 9e:84:0d:db:07:6d timed out.
Nov 6 13:03:31 coffee wpa_supplicant[40249]: wlan0: CTRL-EVENT-DISCONNECTED bssid=9e:84:0d:db:07:6d reason=3 locally_generated=1
Nov 6 13:03:33 coffee wpa_supplicant[40249]: wlan0: Trying to associate with 9e:84:0d:db:07:6d (SSID='open_wlan' freq=2447 MHz)
Nov 6 13:03:43 coffee wpa_supplicant[40249]: wlan0: Authentication with 9e:84:0d:db:07:6d timed out.
Nov 6 13:03:43 coffee wpa_supplicant[40249]: wlan0: CTRL-EVENT-DISCONNECTED bssid=9e:84:0d:db:07:6d reason=3 locally_generated=1
Nov 6 13:03:43 coffee wpa_supplicant[40249]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="open_wlan" auth_failures=1 duration=10 reason=CONN_FAILED

Best Regards,
Stefan
Comment 1 Andriy Voskoboinyk freebsd_committer 2016-11-06 13:23:20 UTC
> URL: https://forums.freebsd.org/threads/58416/

> The requested thread could not be found.
Comment 2 Stefan Hagen 2016-11-06 13:26:07 UTC
Sorry, the forum post is still in moderation. The post contains the same text as the bug report.
Comment 3 Andriy Voskoboinyk freebsd_committer 2016-11-06 15:09:37 UTC
> ifconfig_rtwn0="ether 00:21:cc:d3:e7:1b regdomain ETSI country DE"
> wlans_rtwn0="wlan0"
> ifconfig_wlan0="WPA"

This config looks wrong; I think it should look like:

wlans_rtwn0="wlan0"
create_args_wlan0="wlanaddr 00:21:cc:d3:e7:1b regdomain ETSI country DE"
ifconfig_wlan0="WPA"

or

wlans_rtwn0="wlan0"
ifconfig_wlan0="WPA ether 00:21:cc:d3:e7:1b regdomain ETSI country DE"
Comment 4 Stefan Hagen 2016-11-06 15:52:01 UTC
Thank you for your suggestions. Unfortunately both didn't work.

I tripped out the failover configuration and got the wifi to connect by only leaving this in rc.conf:
wlans_rtwn0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"

This works!

Once I add the ether command, the device can not connect anymore and I see the same error loop I posted initially.

Did not work:
wlans_rtwn0="wlan0"
create_args_wlan0="wlanaddr 00:21:cc:d3:e7:1b"
ifconfig_wlan0="WPA" 

Also did not work:
wlans_rtwn0="wlan0"
ifconfig_wlan0="WPA ether 00:21:cc:d3:e7:1b" 

Can you reproduce this?
Comment 5 Stefan Hagen 2016-11-06 16:29:22 UTC
I have a configuration that works for me now. Changing the ethernet address on em0 works as well as changing it on the lagg0 device as long as it is the same mac address the wlan adapter originally had.

ifconfig_em0="up"
wlans_rtwn0="wlan0"
ifconfig_wlan0="WPA"

cloned_interfaces="lagg0"
ifconfig_lagg0="ether 20:68:9d:48:81:cd laggproto failover laggport em0 laggport wlan0 DHCP"

This configuration works. 20:68:9d:48:81:cd is the address the wifi adapter was shipped with. So there is no change on the wlan0 interface happening.

If you want to follow on the issue about not being able to change the mac address on the wlan adapter, I'm happy to test.
Comment 6 Andriy Voskoboinyk freebsd_committer 2016-11-06 16:35:53 UTC
> ifconfig_wlan0="WPA ether 00:21:cc:d3:e7:1b"
this should be 'ifconfig_wlan0="ether 00:21:cc:d3:e7:1b WPA"

as for me, both work fine (but with a newer version - see
https://svnweb.freebsd.org/base?view=revision&revision=307529 )
Comment 7 Andriy Voskoboinyk freebsd_committer 2016-11-06 16:51:01 UTC
There may be a problem with wireless MAC address filter; is it enabled on your router?
Comment 8 Stefan Hagen 2016-11-06 17:26:10 UTC
Wow. This configuration works for me too. So I really spent a lot of time avoiding the one correct setting.

I've now switched back from the open network to the WPA2 configuration and the 11abn network (n was disabled). It still works. Slow, but works.

Thank you very much! I'll update the forum with the findings so other people can find it.