rtl8192cu-fixes icon indicating copy to clipboard operation
rtl8192cu-fixes copied to clipboard

after wake up from suspend no connect to the access point posible

Open maxpower18 opened this issue 6 years ago • 17 comments

the driver works fine until the version of Feb 3, 2018. driver version afterwards make problem, after wake up from suspend is no longer posible to connect the access point, see log attachment. only a computer restart helps.

operating system: ubuntu 16.04 whit kernel 4.13 wifi device: Edimax EW-7811Un

wpa_supplicant[909]: wlan0: Trying to associate with 07:96:d6:44:1f:bc (SSID='FRITZ' freq=2412 MHz)
wpa_supplicant[909]: wlan0: Association request to the driver failed
NetworkManager[708]: <info>  [1525172366.4501] device (wlan0): supplicant interface state: scanning -> disconnected
NetworkManager[708]: <info>  [1525172366.9518] device (wlan0): supplicant interface state: disconnected -> scanning
wpa_supplicant[909]: wlan0: Trying to associate with 07:96:d6:44:1f:bc (SSID='FRITZ' freq=2412 MHz)
wpa_supplicant[909]: wlan0: Association request to the driver failed
NetworkManager[708]: <info>  [1525172368.3141] device (wlan0): supplicant interface state: scanning -> disconnected
NetworkManager[708]: <info>  [1525172369.3156] device (wlan0): supplicant interface state: disconnected -> scanning
wpa_supplicant[909]: wlan0: Trying to associate with 07:96:d6:44:1f:bc (SSID='FRITZ' freq=2412 MHz)
wpa_supplicant[909]: wlan0: Association request to the driver failed
wpa_supplicant[909]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="FRITZ" auth_failures=1 duration=10 reason=CONN_FAILED
NetworkManager[708]: <info>  [1525172370.6701] device (wlan0): supplicant interface state: scanning -> disconnected
NetworkManager[708]: <info>  [1525172376.1046] device (wlan0): supplicant interface state: disconnected -> scanning
wpa_supplicant[909]: wlan0: CTRL-EVENT-SSID-REENABLED id=0 ssid="FRITZ"
wpa_supplicant[909]: wlan0: Trying to associate with 07:96:d6:44:1f:bc (SSID='FRITZ' freq=2412 MHz)
wpa_supplicant[909]: wlan0: Association request to the driver failed
wpa_supplicant[909]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="FRITZ" auth_failures=2 duration=20 reason=CONN_FAILED
NetworkManager[708]: <info>  [1525172384.2706] device (wlan0): supplicant interface state: scanning -> disconnected
....

maxpower18 avatar May 01 '18 17:05 maxpower18

For information. Here is a link to a similar issue with the rtl8723bu driver:

https://github.com/lwfinger/rtl8723bu/issues/91

pavel-demin avatar May 01 '18 20:05 pavel-demin

I've looked at how the problem was fixed in the rtl8723bu driver and I think that replacing the lines 724-733 in os_dep/linux/ioctl_cfg80211.c with the corresponding lines from the rtl8723bu driver should fix this problem in the rtl8192cu-fixes driver.

pavel-demin avatar May 01 '18 20:05 pavel-demin

thanks for the fast respond. i replaced the lines as you said but only works in about 50% of cases of wake up from suspend. Manually unload and reload the driver modul let the device work again.

maxpower18 avatar May 02 '18 08:05 maxpower18

Thanks for testing the fix. Could you please try to change two more lines in os_dep/linux/ioctl_cfg80211.c?

Here are the changes:

  • comment out if(check_fwstate(&padapter->mlmepriv, _FW_LINKED)) on line 2928
  • add rtw_pwr_wakeup(padapter); just after rtw_free_assoc_resources(padapter, 1); on line 2940

The idea of these changes is to make cfg80211_rtw_disconnect look similar to its version in the rtl8723bu driver.

pavel-demin avatar May 02 '18 09:05 pavel-demin

the changes do not improve the situation.

**kernel.log:**
NetworkManager[701]: <info>  [1525261732.9727] sup-iface[0x263f430,wlan0]: config: set interface ap_scan to 1
NetworkManager[701]: <info>  [1525261734.3315] device (wlan0): supplicant interface state: inactive -> disconnected
NetworkManager[701]: <info>  [1525261734.4362] device (wlan0): supplicant interface state: disconnected -> scanning
NetworkManager[701]: <info>  [1525261735.7921] device (wlan0): supplicant interface state: scanning -> disconnected
NetworkManager[701]: <info>  [1525261736.2974] device (wlan0): supplicant interface state: disconnected -> scanning
NetworkManager[701]: <info>  [1525261737.6547] device (wlan0): supplicant interface state: scanning -> disconnected
NetworkManager[701]: <info>  [1525261738.6605] device (wlan0): supplicant interface state: disconnected -> scanning
NetworkManager[701]: <info>  [1525261740.0137] device (wlan0): supplicant interface state: scanning -> disconnected
NetworkManager[701]: <info>  [1525261745.4633] device (wlan0): supplicant interface state: disconnected -> scanning
NetworkManager[701]: <info>  [1525261753.6228] device (wlan0): supplicant interface state: scanning -> disconnected
NetworkManager[701]: <warn>  [1525261758.0520] device (wlan0): Activation: (wifi) association took too long, failing activation
NetworkManager[701]: <info>  [1525261758.0520] device (wlan0): state change: config -> failed (reason 'ssid-not-found') [50 120 53]
NetworkManager[701]: <info>  [1525261758.0523] manager: NetworkManager state is now DISCONNECTED
NetworkManager[701]: <warn>  [1525261758.0533] device (wlan0): Activation: failed for connection 'FRITZ'
NetworkManager[701]: <info>  [1525261758.0541] device (wlan0): state change: failed -> disconnected (reason 'none') [120 30 0]

**syslog:**
wpa_supplicant[909]: wlan0: Trying to associate with 07:96:d6:44:1f:bc (SSID='FRITZ' freq=2412 MHz)
wpa_supplicant[909]: wlan0: Association request to the driver failed
NetworkManager[708]: <info>  [1525172366.4501] device (wlan0): supplicant interface state: scanning -> disconnected
NetworkManager[708]: <info>  [1525172366.9518] device (wlan0): supplicant interface state: disconnected -> scanning
wpa_supplicant[909]: wlan0: Trying to associate with 07:96:d6:44:1f:bc (SSID='FRITZ' freq=2412 MHz)
wpa_supplicant[909]: wlan0: Association request to the driver failed
NetworkManager[708]: <info>  [1525172368.3141] device (wlan0): supplicant interface state: scanning -> disconnected
....
wpa_supplicant[927]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="FRITZ" auth_failures=2 duration=20 reason=CONN_FAILED
NetworkManager[701]: <info>  [1525261753.6228] device (wlan0): supplicant interface state: scanning -> disconnected
NetworkManager[701]: <warn>  [1525261758.0520] device (wlan0): Activation: (wifi) association took too long, failing activation
NetworkManager[701]: <info>  [1525261758.0520] device (wlan0): state change: config -> failed (reason 'ssid-not-found') [50 120 53]
NetworkManager[701]: <info>  [1525261758.0523] manager: NetworkManager state is now DISCONNECTED
NetworkManager[701]: <warn>  [1525261758.0533] device (wlan0): Activation: failed for connection 'FRITZ'
NetworkManager[701]: <info>  [1525261758.0541] device (wlan0): state change: failed -> disconnected (reason 'none') [120 30 0]

maxpower18 avatar May 02 '18 12:05 maxpower18

While attempting to reproduce the problem, I've installed Ubuntu 18.04 with Linux kernel 4.15.0-20. I've tried a few times to suspend and to wake up the system and my WiFi connection always gets reestablished after the wake up.

pavel-demin avatar May 03 '18 07:05 pavel-demin

I have now installed kernel 4.15.18 under ubuntu 16.04 and tried the driver with and without code changes but the problem is still there. (after wake up sometimes it works and sometimes not, about 50:50) So it seems not only the kernel maybe new version of network manager or something that it works in ubuntu 18.04.

maxpower18 avatar May 03 '18 08:05 maxpower18

I've just installed Ubuntu 16.04.4, Linux kernel 4.13.0-39-generic (via the linux-generic-hwe-16.04 package) and Network Manager 1.2.6. I'm using systemctl suspend to suspend the system and the power button to wake it up. Still can't reproduce the problem. I don't have the Association request to the driver failed messages in the logs.

pavel-demin avatar May 03 '18 08:05 pavel-demin

I have run exactly the same setup, to wake up I move the mouse but that should make no difference. So only wifi hardware remains, I use EDIMAX EW-7811UN usb wifi sick on usb 2.0. lsusb: Bus 003 Device 003: ID 7392: 7811 Edimax Technology Co., Ltd. EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]

maxpower18 avatar May 03 '18 10:05 maxpower18

I have TP-Link TL-WN725N:

ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter

pavel-demin avatar May 03 '18 10:05 pavel-demin

Could you please check the command line options of the wpa_supplicant process? Is it started with -D wext or without?

pavel-demin avatar May 03 '18 10:05 pavel-demin

Could you please check the command line options of the wpa_supplicant process?

How can I do that?

maxpower18 avatar May 03 '18 12:05 maxpower18

How can I do that?

I think that the following command should do it:

ps aux | grep wpa_supplicant

pavel-demin avatar May 03 '18 12:05 pavel-demin

root       912  0.0  0.1  44028  7212 ?        Ss   10:23   0:00 /sbin/wpa_supplicant -u -s -O /run/wpa_supplicant
max      13470  0.0  0.0  15796   940 pts/1    S+   15:09   0:00 grep --color=auto wpa_supplicant

maxpower18 avatar May 03 '18 13:05 maxpower18

I think I found the problem, but it open for me a new problem. 2 years ago where I ubuntu installed i commented out the contents of the file "/lib/systemd/system-sleep/wpasupplicant" because it has made a delay of 10 seconds after trigger the suspend command:

17:25:15  systemd[1]: Starting Suspend...
17:25:15  wpa_supplicant[900]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
17:25:25  systemd-sleep[1996]: Selected interface 'wlan0'
17:25:25  systemd-sleep[1996]: 'SUSPEND' command timed out.
17:25:25  systemd-sleep[1997]: /lib/systemd/system-sleep/wpasupplicant failed with error code 254.
17:25:25  systemd-sleep[1996]: Suspending system...
17:25:25  kernel: [   97.362506] PM: suspend entry (deep)

this has never made problems with the faulty default kernel driver and rtl8xxxu driver and with the "pvaret rtl8192cu-fixes" driver.

if the script is activated the problem with connecting to the access point after suspend looks fixed with the disadvantage that 10 sec. delay to enter the suspend state. the line "pre) /sbin/wpa_cli suspend ;;" in the script is crucial. I comment out the line and the pc goes without delay in the suspend, when waking up is again no connection with the access point possible.

the question is, why is the script needed now?

maxpower18 avatar May 03 '18 17:05 maxpower18

So, looks like the problem appears when the WiFi is switched off without a delay.

I've finally found a way to reproduce the problem. I have a WiFi switch on my computer and it's recognized by systemd. When I turn it off, systemd switches off all the WiFi interfaces including the USB WiFi interface. When I turn it on, I get the Association request to the driver failed messages in the logs.

pavel-demin avatar May 03 '18 18:05 pavel-demin

Try editing os_dep/linux/os_intfs.c Find the netdev_close function.

Find the line #ifndef CONFIG_ANDROID Remove that line, and the #endif that follows soon after.

dsd avatar Jul 03 '19 06:07 dsd