Bug 57171 - rtl8192cu 64bit issue
Summary: rtl8192cu 64bit issue
Status: NEW
Alias: None
Product: Networking
Classification: Unclassified
Component: Wireless (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: networking_wireless@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-27 08:49 UTC by Daniel B
Modified: 2016-11-09 19:36 UTC (History)
3 users (show)

See Also:
Kernel Version: 3.9.0-rc8
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Output from a manual attempt without network-manager (2.32 KB, text/plain)
2013-04-27 08:49 UTC, Daniel B
Details
Output from dmesg after connection attempt (3.98 KB, text/plain)
2013-04-27 08:50 UTC, Daniel B
Details
Trial patch for rtl8192cu (14.21 KB, patch)
2013-04-27 14:37 UTC, Larry Finger
Details | Diff
Revised Proposed patch to fix problems in connecting to WEP and WPA networks (13.99 KB, patch)
2013-04-27 17:48 UTC, Larry Finger
Details | Diff
Connection Attempt after applying the patch file (5.61 KB, text/plain)
2013-04-27 20:35 UTC, Daniel B
Details
Version of patch for wireless-testing kernel (14.21 KB, patch)
2013-04-28 14:47 UTC, Larry Finger
Details | Diff

Description Daniel B 2013-04-27 08:49:29 UTC
Created attachment 100041 [details]
Output from a manual attempt without network-manager

hi.
I bought an RTL8192CU USB Wireless Network Adaptor about 6 month ago, at which time I was running Ubuntu 12.10 (Kernel 3.4.x). When I plugged in this USB Adaptor, the driver (rtl8192cu) was loaded successfully and I was able to find and start connecting to my wireless router. However, I was not able to actually connect to it. It just kept popping up with the password dialog. The funny thing is that when I plugged the USB Adaptor into my 32bit laptop, it was working just fine. The issue seamed to be related to the 64bit kernel version. 

I was able to get around this by downloading the driver source from Realtek's website and compile it myself. But now that I have upgraded the OS to the latest Ubuntu (Kernel 3.8.0 by default) the kernel source is no longer compatible. Also I had hoped that the issue had been resolved in the kernel source at this time as I found that a lot of people have had this issue. 

Then I read somewhere that the issue should be resolved in kernel 3.8.6, so I compiled a version myself, but same result. I then tried the same with 3.8.10 and 3.9.0-rc8 but still no go. 

For now I have USB Tethering running from my smartphone which is connected to the wireless router. This is not optimal and I would really like to get this driver working. 

I have attached dmesg and output from a manual attempt without the usage of any network managers. I have also tried this on two different 64bit machines to eliminate any issues on the hardware side, just since it seams to be working on 32bit versions.
Comment 1 Daniel B 2013-04-27 08:50:07 UTC
Created attachment 100051 [details]
Output from dmesg after connection attempt
Comment 2 Larry Finger 2013-04-27 14:37:08 UTC
Created attachment 100141 [details]
Trial patch for rtl8192cu

With the changes made in 3.8.6, the driver connected OK to WPA2-encrypted networks. With this patch applied, it should work OK will all networks.
Comment 3 Daniel B 2013-04-27 17:16:33 UTC
I am using WPA2 on my router, but I will try this patch on the 3.8.10 version and see what happens.
Comment 4 Daniel B 2013-04-27 17:22:31 UTC
patching file drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
patching file drivers/net/wireless/rtlwifi/rtl8192cu/hw.h
patching file drivers/net/wireless/rtlwifi/rtl8192cu/mac.c
patching file drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
patching file drivers/net/wireless/rtlwifi/rtl8192cu/sw.h
patching file drivers/net/wireless/rtlwifi/usb.c
Hunk #1 succeeded at 740 (offset -84 lines).
Hunk #2 succeeded at 947 (offset -80 lines).
Hunk #3 succeeded at 988 (offset -80 lines).
patching file drivers/net/wireless/rtlwifi/wifi.h
Hunk #1 succeeded at 1572 (offset -164 lines).
Hunk #2 FAILED at 1871.
Hunk #3 FAILED at 2050.
2 out of 3 hunks FAILED -- saving rejects to file drivers/net/wireless/rtlwifi/wifi.h.rej
Comment 5 Larry Finger 2013-04-27 17:48:25 UTC
Created attachment 100151 [details]
Revised Proposed patch to fix problems in connecting to WEP and WPA networks

Sorry, I sent the version for wireless-testing. This one will apply to mainline 3.9-rc8.
Comment 6 Daniel B 2013-04-27 18:08:09 UTC
Thanks, I will report back once it has finished building :)
Comment 7 Daniel B 2013-04-27 20:34:01 UTC
Well now it is better than before, but it is still not working. It finally connects, but I cannot use the connection. For some reason when using dhcp then both Bcast and inet are assigned the same address. And when trying with static address setup, I can get a connection for a few seconds and then nothing. The connection to the router seams to be persistent, but there is no connection out.
Comment 8 Daniel B 2013-04-27 20:35:08 UTC
Created attachment 100161 [details]
Connection Attempt after applying the patch file
Comment 9 Daniel B 2013-04-27 22:14:41 UTC
So I thought about what you said, that kernel 3.8.6 fixed connection issue with WPA2. So I changed my router configs from WPA2/WPA to simply WPA2 and TKIP/CCMP to simply TKIP and started testing with 3.8.6, 3.8.10 and 3.9-rc8 (Unpatched). Using these router configs I can connect using all 3 kernels, but I still get the same issue as with the patched 3.9-rc8 where I can only stay connected for a little while. So the patch you provided does work as it should, letting other security methods connect. But there is still a general issue in the wifi driver which makes the connection unstable. However, as this is the same whether the kernel is patched or not, the issue is not in the patch you provided. This should help you NOT looking in the wrong place :)

I have now 6 different custom kernel builds installed, if you want me to build and test more, I still have plenty of space on my /boot partition ;)

At least this is getting closer to a working solution
Comment 10 Larry Finger 2013-04-28 02:34:46 UTC
I have no idea what is wrong with your setup. On my system, using the kernel from the wireless-testing git repo, the driver stays connected for days. There are some changes in rtlwifi that cannot be backported to older kernels. Perhaps they are the difference. You can get these patches from wireless-testing, linux-next, or the mainline 3.10-rc1 in about 3 weeks.
Comment 11 Daniel B 2013-04-28 09:14:41 UTC
Tried with the wireless-testing branch, same issue.

 * Normal state: It connects fine, and I have an outgoing connection for about 10 seconds. It does not disconnect from the router, but there is no connection between the router and the computer. 

 * Prope the driver with Software Encoding (modprobe rtl8192cu swenc=1): It connects fine, and I have an outgoing connection for about one minute. From here, the connection comes and goes, which means that it almost works, but a couple of times a minute the connection is lost but comes back on. This makes the driver okay for browsing, but not good for anything with a direct connection like SSH, Downloading etc.
Comment 12 Larry Finger 2013-04-28 14:47:37 UTC
Created attachment 100191 [details]
Version of patch for wireless-testing kernel

Use this patch for wireless testing tree.
Comment 13 Larry Finger 2013-04-28 14:49:59 UTC
One other suggestion - use NetworkManager to make the connection. Your scripts are using a lot of WEXT commands that are not implemented.
Comment 14 Daniel B 2013-04-28 15:59:50 UTC
I do use NetworkManager. I just used the terminal for output purposes. 

And the wireless testing patch helped, but it did not fix anything. Now I can use hardware encoding, but with the same results as with software encoding before. It connects just fine, but the connection is very unstable. 

I did however manage to fine someone who have fixed the Realtek source to work with 3.8+ and 3.9+ kernel versions. This driver is working fine, so that did give me a chance to rule out any hardware issues or other software related once. And it has provided a working WiFi until the native driver is working.

If you need me to test anything else, just let me know. But for now, nothing in the git's are working, patched or not. I have tried every branch in every tree.
Comment 15 Szőgyényi Gábor 2016-11-09 19:36:48 UTC
Please try this bug with latest kernel image.

Note You need to log in before you can comment on or make changes to this bug.