-
Notifications
You must be signed in to change notification settings - Fork 5.2k
RTL8192CU: re-enable the upstream rtl8192cu driver #1525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RTL8192CU: re-enable the upstream rtl8192cu driver #1525
Conversation
Ping @XECDesign Can we create a file After a while we'll start building the upstream driver (which will be disabled by default), but users will have the choice to change the blacklist to |
More discussion about this is here: #1489 |
@popcornmix I was tempted to add, CONFIG_RTL8XXXU=m, and CONFIG_RTL8XXXU_UNTESTED=y to the patch and suggest also adding a blacklist-rtl8xxxu.conf. With CONFIG_RTL8XXXU_UNTESTED, the USB ID's for the 8188CUS's and 8192CU's are added to the rtl8xxxu driver, which offers a third driver option for the 8188CUS and 8192CU. I think the Jes Sorensen (of RedHat) rtl8xxxu driver is going to shake-out as the way forward for these 8188/8192 dongles. It is being actively developed..... but still lacks dual channel 40MHz support IIRC, so throughput is limited at the moment for people with 40MHz capable hardware. In any case you should probably add CONFIG_RTL8XXXU=m (without the UNTESTED option) to the default RPi builds, so that support is added for people with RTL8723AU chipset dongles. Not that I have tested that myself, but I know a man who has, successfully. ;) |
@clivem Just tried the rtl8192cu driver again and the same issue still exists as I mentioned in #1488 or #1489 with the wifi LED being permanently on. Previously I used an Edimax EW-7811Un, but this time tried with a Micronet SP907NS which uses the 8188cus chipset and the LED is again permanently on. Not something I like so I think I'll be sticking with the 8192cu driver for the moment ;) Tried the 8192cu driver with just the #1488 patch and then with both #1488 and #1489 patches and had no problems with either configuration but I don't use Network Manager. Tried the EW-7811Un with just #1488 and both the EW-7811Un and SP907NS using #1488 and #1489. I usually use raspbian jessie lite and connect via SSH from a W7 laptop. Which image were you having problems with Network Manager? Just curious but would like to try it if possible to see what happens. |
That's a "feature" of the upstream rtl8192cu driver. The LED doesn't flash due to traffic, as it does with vendor 8192cu driver, it's just lit permanently.
I use Fedora as a base. I don't even know if Raspbian/Debian uses NetworkManager, but several other distros do. Right now, from my POV, #1489 patch needs to be reverted. #1488, 9 patch series, which I don't think @popcornmix applied yet, is OK. That's mostly compiler warnings dealt with. Innocuous, no big deal... It's the deliberate change to system cfg80211/n180211, from #1489, that's causing the "8192cu driver incompatible with being MANAGED by NetworkManager" issue for me. |
I think the issue with NetworkManager is fixed by #1488 as it fixes pvaret/rtl8192cu-fixes#23 with 0a71af8 |
Well, you think wrong! ;) As I indicated to @popcornmix in my comment, #1488 (comment), I was already applying that patch set before I encountered #1489 |
did you try both PRs together? |
Yes. I hope to have time next week to get to the bottom of what the issue is. But in one conversation I have had already about this, it was "suggested" that the external cfg80211 that you enabled with that #1489 patch, isn't fully implemented in the Realtek code you enabled. |
One thing I found strange. With the 8192cu driver lsmod shows
But with the rtl8192cu driver lsmod shows
whatever those differences may indicate. |
That just indicates what we already know. That the vendor driver has 500k's worth of "private" static crap (ie. their own versions of kernel functionality) compiled in, rather than using kernel system modules. ;) |
@clivem The support is complete from what I could see and I didn't have any problem so far. I'm downloading an image with NetworkManager by default to check it out. I agree that if this patch is breaking the wifi it should be reverted back until a fix is submitted. |
@fran6co If you have time to look at this before me.... I suspect what is important is who is creating the actual wlan0 network interface and when it is created. ie. it needs to be created when the driver module loads and before NetworkManager starts. |
@clivem the interface is created, when I run |
Hmmmm. The interface wasn't being created by default. I could force it to be created by running a standalone wpa_supplicant with "-iwlan0", then it magically appears after that is started, but that isn't really a solution. But it might give you a clue..... |
That means that NetworkManager is filtering it out for some reason that's why I was pointing to the other fix. Maybe there is some other missing attribute that NetworkManager needs. |
I'm really nervous about any "big" changes, other than to fix compiler warnings to that Realtek vendor code. It's old, crusty, unmaintained and wouldn't surprise me if there are other as yet other unforeseen consequences from such a change. ;) |
Hmmm. I think if the interface was created by the driver as it used to be, NetworkManager would see it and MANAGE it. But I'm guessing. I really haven't had time to look at this and probably won't until the middle of next week. |
Interface is there as demonstrated by you running the wpa_supplicant, the
|
@fran6co Back to topic, does upstream rtl8192cu driver work for whatever you need it to, your use case.... hostapd, or whatever else you are using for your wi-fi repeater? |
No, I need in addition to the cfg80211 the concurrent feature of the
|
That's a shame. It would have nice to be able to think, going into the future, we could "drop" the "vendor" driver. |
Yeah, it would be nice to kill the realtek driver. Wish I knew a bit more about driver programming to actually help out with it. |
Fixed NetworkManager issue in #1488 |
Note to self..... I'm not sure that moving the general population to the upstream rtl8192cu driver is a realistic proposition. Further testing has "forced" the reproduction of the death spiral issue, which can be hastened by placing the dongled Pi very close (less than 1m) from the AP. SGI also still an issue. The "require advanced functionality" guys, not been able to use the single wifi interface as both client and server, for repeater with upstream driver........ I seriously doubt Larry Wall is going to be interested in adding any new functionality to this driver. ;) When not using PRO (ie. Cisco, Mikrotik) AP gear, instead using the usual crap router/AP (BT Home Hub, Technicolor, Sagem) that is provided by most ISP's when you take a broadband connection, having a single client connected with upstream rtl8192cu driver, seems to sabotage the throughput of anything else connected to that AP. (Possibly related to SGI compatibility. ISTR, that it is a 10% performance hit on 'n' without SGI.) |
Yes, I'm not confident the upstream driver is good enough. |
Yep, agreed. Should definitely do that. I guess I'm just saying that what for me started out to be the most positive testing experience I've ever had with rtl8912cu on Fri/Sat, has descended back to the uncomfortable place I was in a year ago, having placed an order for several hundred generic OEM'd RTL8188CUS dongles, and I don't think it is realistic to think that the "crusty vendor driver" is ever going to be retired, in favour of the upstream rtl8192cu. I doubt upstream rtl8192cu it is ever going to see anything more than the odd one line change, to keep it "working".
I think our best hope is that rtl8xxxu driver, which is being actively developed by the RedHat guy. On the basis that it isn't even turned-on in the current builds..... More and more, my thinking is to add a blacklist-rtl8xxxu.conf for that to the distro as well, and at the point you start building upstream rtl8192cu, also build rtl8xxxu with CONFIG_RTL8XXXU=m, and CONFIG_RTL8XXXU_UNTESTED=y. |
I think the realtek crusty vendor driver can be refactored and polished a lot, realtek uses the same code base for all its drivers so there are a lot of fixes a new features that can be pulled from there. That's why I was advocating #1468 (comment) and pvaret/rtl8192cu-fixes#89 for creating an out of tree module for this and get patches and fixes from all the people that use this driver. You can still bundle it using git submodule feature so you don't have to change anything in the way you build Raspberry's kernel (maybe add a |
I would like to be able to share this code with ev3dev. We distribute Debian for LEGO MINDSTORMS EV3. The EV3 has limited resources (300MHz armel, 64MB RAM), so using DKMS is really not an option, it takes way too long to compile on the device. We also support a BeagleBone based device, so I would like to patch this into the BeagleBone kernel as well. In the past, we distributed this driver as a separate debian package that was released alongside the kernel package. The downside to this is that people who want to compile their own kernel then also have to figure out how to compile the extra package against their own kernel, otherwise they lose wifi. So, we started building it in-tree like what is done here for the RPi kernel. Using submodules is annoying, but we already do it for some other drivers we share between EV3, Raspberry Pi and BeagleBone. I am willing to put up with submodules, but I think there would be many people in RPi land that would be opposed to the idea. There is also |
OK, taking a step back, at the point someone is going to take ownership, or maintainership, or call it whatever you will of the vendor driver, we need to deal with the trust thing first, not the mechanism by which multiple parties are all going to build from the same code base. I trust @popcornmix not to pull changes from fools who have even less of a clue about what they are doing than I do, and that the 8192cu driver will continue working for my use case on Pi as it has done for the last 2 years. The problem with shared code bases is that different people have different priorities...... What one person considers an essential change, might not be considered to be so by all the parties, eg. when it results in breaking something that used to work. It's why forks happen...... |
Thanks for the feedback @dlech. I think there are other IoT devices that could benefit from this even if they are not using it at the moment. |
@clivem you wouldn't need to sacrifice the stability if raspberry created the repository, it would have to go through a PR and being accepted by the current kernel maintainers. I think the cfg80211 change it wasn't just a nice thing to have or essential for a minority of people, being able to use modern tools to manage the wifi makes it easier for the community in general to give support and have the driver working for a bit longer. |
I so much want to tell you a story, but I can't because of a NDA...... I personally think your time would be better spent trying to help add functionality to the rtl8xxxu driver, at the point you want to work on wifi driver code. This Realtek driver is a legacy thing. Use it while it carries on working, but don't waste precious resources on it. The community should make sure they have their own, Open Source driver that supports all the functionality they need, by the time the rest of the nails have been driven into its coffin! |
Yeah, I totally agree with you. I wish it were a lot easier to fix all the issues with the Open Source driver instead of hacking this crappy driver. |
Well, if I were you and that concurrent behaviour was important to me, I'd try talking to Jes Sorensen about it and whether he has any plans to implement it in the rt8xxxu driver. If he does, great. If not, there's a project for you! |
Thanks, I didn't think about it. I'll drop him a line |
Continue building the Realtek vendor (8192cu) driver. Vendor driver now using CONFIG_RTL8192CU_VENDOR. Add CONFIG_RTL_CARDS=m and CONFIG_RTL8192CU_VENDOR=m to the default RPi kernel configs. Suggest adding /etc/modprobe.d/blacklist-rtl8192cu.conf, containing text "blacklist rtl8192cu" on the distribution, to blacklist rtl8192cu so 8192cu remains the default driver for RTL8188CUS and RTL8192CU based dongles. Initial testing with rtl8192cu driver of single channel 20MHz 8188's and dual channel 40MHz 8192's suggest that several issues from the past are no longer issues, including the death spiral, (whereby sync speed gets reduced but never increased), and throughput is much better. Suggest that vendor driver should be left using the built-in cfg80211 and people wishing to use recent version of hostapd, (rather than the Realtek version that was shipped with the out-of-tree vendor driver), should switch to using rtl8192cu driver and blacklist 8192cu driver. Signed-off-by: DigitalDreamtime <[email protected]>
8417046
to
4d94cb7
Compare
BTW,I've tested the rtl8723bu driver based on rpi-4.6.y branch,(CONFIG_RTL8XXXU=m, and CONFIG_RTL8XXXU_UNTESTED=y) the kernel can recognize the device ,but can't find any SSID,there is no any signal.Instead ,this driver (https://www.github.com/lwfinger/8723bu) is the right driver, with the driver i can sucessfully enable rtl8723bu and connet to any SSID,rtl8723bu is a single chip solution of WIfi & Bluetooth 4.0,it's a good product for old PIs, Linux kernel 4.6 has added the driver.I'll try 8129cu later. |
@popcornmix Is there a reason why rpi-4.7.y rtl8192cu vendor driver doesn't include any of the 3x @fran6co rpi-4.4.y commits? It's really frustrating trying to figure these things out, when trees have been rebased and squashed, and revision history is lost....... |
The IEEE80211_BAND_2GHZ/IEEE80211_BAND_5GHZ seems easy to fix, they should be replaced by NL80211_BAND_2GHZ/NL80211_BAND_5GHZ. I don't have a Pi at hand to actually test it in the near future. |
I have the patch ready but I can't test it:
|
@fran6co there seem to be additional issues:
|
Uhm.. It's going to need break backward compatibility then. I'll make the patch. |
Discarding the other patch.
|
It's hard to apply that as github loses the tabs.... |
I'll create a PR. |
Cool |
@popcornmix Do you know if there was any progess with adding the blacklist files to Raspbian. I have just been contacted by a user who says that his dongle does not work with VENDOR 8192cu driver and he needs to blacklist it and use upstream rtl8192cu. It sure would help if the RPi kernel builds had both modules pre-built, with the upstream module blacklisted by the OS by default. |
Ping @XECDesign |
Yes, that as well if you also want to build rtl8xxxx, but more importantly, |
This is a RFC rather than a PR. Please read the commit comments.
The patch results in both the vendor 8192cu driver and upstream rtl8192cu driver being built.
Can the guys who want the hostapd, wi-fi repeater functionality, and a driver using upstream cfg80211/nl80211, please test with rtl8192cu driver..... @fran6co @MrEngman
Commit comments below.........
Continue building the Realtek vendor (8192cu) driver.
Vendor driver now using CONFIG_RTL8192CU_VENDOR.
Add CONFIG_RTL_CARDS=m and CONFIG_RTL8192CU_VENDOR=m to the
default RPi kernel configs.
Suggest adding /etc/modprobe.d/blacklist-rtl8192cu.conf, containing
text "blacklist rtl8192cu" on the distribution, to blacklist rtl8192cu
so 8192cu remains the default driver for RTL8188CUS and RTL8192CU
based dongles.
Initial testing with rtl8192cu driver of single channel 20MHz 8188's
and dual channel 40MHz 8192's suggest that several issues from the
past are no longer issues, including the death spiral, (whereby sync
speed gets reduced but never increased), and throughput is much better.
Suggest that vendor driver should be left using the built-in cfg80211
and people wishing to use recent version of hostapd, (rather than the
Realtek version that was shipped with the out-of-tree vendor driver),
should switch to using rtl8192cu driver and blacklist 8192cu driver.