Hello,
I have some RTL8822BU and RTL8821CU USB devices that want to use with OpenWRT, but I can not find the way to get they working.
I try to install kmod-rtl8xxxu package, but it doesn't work.
Anyone know how could I get them working?
I will appreciate your help.
Kind regards.
1 Like
By replacing them with something that isn't made by Realtek.
Thanks for the reply, but I have thoose devie, so I don't want to buy others.
Could be possible to make a pull request about this repo?
#
# Copyright (C) 2008 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=rtl8821cu
PKG_VERSION:=1.0.1
PKG_RELEASE:=2
PKG_LICENSE:=GPLv2
PKG_MAINTAINER:=Han Pengfei <pengphei@foxmail.com>
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
This file has been truncated. show original
It will be great to get this driver in all images.
Regards.
frollic
September 6, 2022, 8:20am
#4
yeah that's not very likely ....
there's a reason why RTL wireless is a no go zone ....
All current out-of-tree Realtek drivers suffer from deadlock when deleting the interface with iw dev wlan0 del
.
opened 05:34PM - 13 Dec 19 UTC
closed 12:10PM - 11 May 21 UTC
Hi,
I'm trying to use this driver on an rtl8812au based usb board with OpenWr… t 18.06.5 for x86_64. I've got no problem to build it after 28a8d26f11918b18871cb7ee6ba0cff329f1b7ee which brings openwrt build compatiblity.
When I boot the board connected, the next time I try to do a simple `iw dev`, it will hang forever. However, if I connect the board after boot, I can do an `iw dev` but generally after trying to configure it will hang anyway.
I know that, In the OpenWRT wireless configuration script, it will delete and recreate the wifi interface. So I tried to execute the `del` command when connecting the board after boot, and I can "produce" a hang with this single command:
```
iw dev wlan0 del
```
I suppose that not a lot of system tries to delete the interface. So it's maybe just a bug on the delete function that has not been tested?
In latest commit ebaed2facba7bc96a3e664985b34011a896f2620, it will just hang without any message, but on an older commit 6ed82d886c18bcc7826fcbe8ca91f5fa645eb11a (with openwrt build fix 28a8d26f11918b18871cb7ee6ba0cff329f1b7ee cherry-picked), it will print this before hanging:
```
[ 84.928053] RTW: cfg80211_rtw_del_virtual_intf(wlan0) unregister ndev
[ 84.934571] RTW: rtw_wdev_unregister(wdev=ffff888071af6c00)
[ 84.940617] RTW: cfg80211_rtw_get_txpower
[ 84.983346] RTW: rtw_ndev_notifier_call(wlan0) state:6
[ 84.988584] RTW: rtw_ndev_uninit(wlan0) if1
[ 84.993948] RTW: rtw_wiphy_unregister(phy0)
[ 84.998409] RTW: Vendor: Unregister RTW cfg80211 vendor interface
```
I tried this on following commits with the same result:
* 6ed82d886c18bcc7826fcbe8ca91f5fa645eb11a (2019-11-09) (with 28a8d26f11918b18871cb7ee6ba0cff329f1b7ee cherry picked)
* 73f0a8810da1f3dd84991cf3efda405cbab43f89 (2019-11-11) (with 28a8d26f11918b18871cb7ee6ba0cff329f1b7ee cherry picked)
* 2e294ae3695be71ea14a8513f23b763797902b91 (2019-11-26)
* ebaed2facba7bc96a3e664985b34011a896f2620 (2019-12-08)
If I can give you any information, or try a patch or something, tell me I will do it as soon as possible. Thank for your work!
opened 04:49PM - 11 Jun 19 UTC
closed 10:05PM - 26 Nov 19 UTC
Branch: 5.3.4 (also tested the newer 5.6.x driver branch)
OS: Tested on Raspbia… n & Ubuntu
**Steps to reproduce:**
- Install driver on clean Raspbian or Ubuntu (18.04.2) use make install or dkpg (both tested)
- sudo iw dev wlan1 del
sudo / iw process will freeze. Only operation 'pull the plug' makes the raspberry pi3b+ live again. Killing the process will not work,
I've also tried using airmon-ng start / stop. That gave me the following:
> You already have a wlan1 device but it is NOT in station mode.
> Whatever you did, don't do it again.
> Please run "iw wlan1 del" before attempting to continue
opened 02:12AM - 02 Feb 17 UTC
driver-4.3.14
driver-4.3.20
driver-4.3.22-beta
I have compiled the source driver for [EDIMAX EW-7822UAC]USB wifi in openwrt-ch… aos_calmer (15.05) and Ubunut (14.04).
when ever I issue " iw dev wlanX del" command then unplug the device, the kernel panics.
"iw dev wlan0 del"
`[ 665.916589] RTL871X: rtw_ndev_uninit(wlan0) if1`
If I unplugged the USB device it gives the the following the kernel mesg:
```
[ 964.188648] usb 2-2: USB disconnect, device number 2
[ 964.193916] RTL871X: +rtw_dev_remove
[ 964.197633] RTL871X: [0x00100000,5]+dev_remove()
[ 964.202580] RTL871X: rtw_wdev_unregister(wdev=f60cf800)
[ 964.207968] RTL871X: rtw_cfg80211_indicate_scan_done without scan req
[ 964.214761] ------------[ cut here ]------------
[ 964.219504] Kernel BUG at c1391463 [verbose debug info unavailable]
[ 964.225927] invalid opcode: 0000 [#1] SMP
[ 964.230228] Modules linked in: 8812au tunprox pppoe ppp_async iptable_nat ath9k rt2500usb rndis_host pppox ppp_generic nf_nat_ipv4 nf_conntrack_ipv6 nf_conntrack_ipv4 ipt_REJECT ipt_MASQUERADE huawei_cy
[ 964.378478] CPU: 1 PID: 393 Comm: kworker/1:1 Not tainted 3.18.29 #30
[ 964.385025] Hardware name: PC Engines apu2/apu2, BIOS 88a4f96 03/07/2016
[ 964.391888] Workqueue: usb_hub_wq hub_event
[ 964.396280] task: f7285d50 ti: f71f8000 task.ti: f71f8000
[ 964.401845] EIP: 0060:[] EFLAGS: 00010202 CPU: 1
[ 964.407551] EIP is at rollback_registered_many+0xa3/0x230
[ 964.413075] EAX: 00000003 EBX: f54ef000 ECX: f7285d50 EDX: 00000000
[ 964.419532] ESI: f71f9d90 EDI: f71f9d50 EBP: f71f9d74 ESP: f71f9d64
[ 964.425989] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
[ 964.431559] CR0: 80050033 CR2: b7784558 CR3: 360ca000 CR4: 000407d0
[ 964.437923] Stack:
[ 964.439993] f607e81c c1463551 00000246 00000001 f71f9d74 f71f9d74 f54ef000 00000000
[ 964.448125] f607e800 f607e81c c139160a f54ef040 f54ef040 c1392bb7 f95cf7ce f962557e
[ 964.456318] f961b18f f54ef000 f54ef000 c1392c01 f96d4000 f95b5a03 00000000 f695f000
[ 964.464474] Call Trace:
[ 964.466989] [] ? printk+0x37/0x3b
[ 964.471476] [] ? rollback_registered+0x1a/0x30
[ 964.477048] [] ? unregister_netdevice_queue+0x67/0xa0
[ 964.483258] [] ? rtw_wdev_unregister+0x44/0xc2 [8812au]
[ 964.489705] [] ? unregister_netdev+0x11/0x20
[ 964.495084] [] ? rtw_os_ndev_unregister+0x2a/0x3f [8812au]
[ 964.501862] [] ? rtw_os_ndevs_unregister+0x1b/0x33 [8812au]
[ 964.508620] [] ? rtw_resume_common+0x3fd/0x4de [8812au]
[ 964.515025] [] ? usb_unbind_interface+0x54/0x170
[ 964.520717] [] ? __blocking_notifier_call_chain+0x40/0x50
[ 964.527217] [] ? __device_release_driver+0x4b/0x90
[ 964.533083] [] ? device_release_driver+0x15/0x20
[ 964.538855] [] ? bus_remove_device+0xbc/0xe0
[ 964.544246] [] ? device_del+0xeb/0x160
[ 964.549067] [] ? usb_disable_device+0x61/0x170
[ 964.554650] [] ? usb_disconnect+0x9a/0x1a0
[ 964.559916] [] ? usb_clear_port_feature+0x48/0x50
[ 964.565685] [] ? hub_event+0x459/0xdf0
[ 964.570608] [] ? vmstat_shepherd+0x9e/0xe0
[ 964.575797] [] ? process_one_work+0x15a/0x290
[ 964.581334] [] ? worker_thread+0x243/0x3d0
[ 964.586538] [] ? cancel_delayed_work_sync+0x10/0x10
[ 964.592574] [] ? kthread+0xaa/0xb0
[ 964.597003] [] ? ____call_usermodehelper+0xf7/0x110
[ 964.603011] [] ? ret_from_kernel_thread+0x21/0x30
[ 964.608801] [] ? kthread_create_on_node+0x110/0x110
[ 964.614814] Code: ca ff 8b 53 40 8b 43 44 89 42 04 89 10 c7 43 40 00 01 10 00 c7 43 44 00 02 20 00 eb 13 8d 76 00 3c 01 c6 83 a1 02 00 00 01 74 05 <0f> 0b 8d 76 00 8b 47 40 89 fb 8d 78 c0 8d 43 40 39 cb
[ 964.635896] EIP: [] rollback_registered_many+0xa3/0x230 SS:ESP 0068:f71f9d64
[ 964.644139] ---[ end trace cfa67b4a0a2dba10 ]---
[ 964.648912] Kernel panic - not syncing: Fatal exception
[ 964.654310] Kernel Offset: 0x0 from 0xc1000000 (relocation range: 0xc0000000-0xf878cfff)
[ 964.662686] Rebooting in 10 seconds..
```
Do you have any suggestion how to fix it?
BR
Aman
opened 04:13AM - 05 Mar 21 UTC
I am try on kali or openwrt-19.07
uname -a
Linux Machine 4.19.37+ #3 SMP Thu S… ep 5 13:19:58 CST 2019 x86_64 GNU/Linux
Excute command "iw dev wlan0 del" will block kernel.
opened 12:05PM - 04 Feb 23 UTC
Deletion of the wireless interface results in endless hang of `iw` process which… could not be killed even with `kill -9` and makes the device unable to operate normally due to hangs on any operations related to the network interface enumeration.
The kernel would also unable to reboot properly.
How to reproduce (do not do that on a production system):
1. Insert the rtl8811cu card to USB port
2. Execute `iw dev wlan0 del`, where `wlan0` is the card's interface name
I suppose there's a lock which is not getting released somewhere.
And this is exactly what OpenWrt does during AP configuration.
Either the driver or mac80211.sh
OpenWrt script should be patched.
slh
February 4, 2023, 9:45pm
#7
These are (unsurprisingly) bugs in the realtek wireless drivers and need to be fixed there, chances that OpenWrt will be changed to workaround driver bugs (especially for drivers that aren't even used in any supported devices) are minimal.
There is an ongoing effort to bring rtl882bu and rtl8821cu (and other rtl chipsets) into the Linux kernel. See here:
Since OpenWRT is based on the Linux kernel, all you will need to do is to wait until kernel 6.2 (or something) has reached OpenWRT (or to help porting the 6.2 kernel to OpenWRT). From what I can hear, these in-kernel drivers may still need a little refinement though. They are also mainly pushed forward by volunteers. Any help is welcome, as (to my knowledge) Realtek has refrained from doing so. Unfortunately, Realtek is not one of these companies that at present time upstream their wifi drivers to the linux kernel. I own a 88x2bu, but next time I buy a device, I will take care to choose one that is supported in-kernel.
For now , your best bet would be to install an out of kernel driver. You will not be able to use OpenWRT with them, but these out of kernel drivers may be enough, if your use case is that of a simple wifi client. Sometimes they even support accesspoint (AP) mode or monitor mode.
Out of kernel drivers that are installed via dkms (these drivers need to be upgraded/removed before any attempt to upgrade to a newer kernel):
As I mentioned above, these drivers hang upon deleting the interface, which OpenWrt does internally. It works if you patch mac80211.sh
, but that's not a solution for everyone.
Unfortunately, at least with rtl8821cu, rtw88 does not work properly for 2.4 GHz. It either selects incorrect antenna or does not enable power amplifier properly, at least for me. I already contacted the authors.
Backported drivers are available here: https://github.com/lwfinger/rtw88
1 Like