Closed airdrummingfool closed 3 years ago
Update: I bought a second EDUP EP-AC1661 just to see what would happen. Turns out that the EFUSE is a bit different in this one, and a valid rfe_type
can be read (it's located at 0xCA in the EFUSE, per EEPROM_RFE_OPTION_8821C
).
Full EFUSE of a valid chip:
RTW: HW EFUSE
RTW: 0x000: 29 81 00 BC 09 00 21 00 6E 04 A4 34 10 00 30 0B
RTW: 0x010: 1D 1D 1E 1F 1F 1F 25 25 26 27 27 FF FF FF FF FF
RTW: 0x020: FF FF 28 28 28 28 2A 29 29 28 28 27 24 26 26 26
RTW: 0x030: 00 FF FF FF FF FF FF FF FF FF 1D 1D 1E 1F 1F 1F
RTW: 0x040: 25 25 26 27 27 02 FF FF FF FF FF FF FF FF FF FF
RTW: 0x050: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
RTW: 0x060: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
RTW: 0x070: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
RTW: 0x080: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
RTW: 0x090: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
RTW: 0x0A0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
RTW: 0x0B0: FF FF FF FF FF FF FF FF 7F 0A 1F 00 FF FF FF FF
RTW: 0x0C0: FF 21 00 00 00 00 00 00 00 FF 26 FF FF FF FF FF
RTW: 0x0D0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
RTW: 0x0E0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
RTW: 0x0F0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
RTW: 0x100: DA 0B 20 C8 E3 46 FF E8 4E 06 86 AA 8F 09 03 52
RTW: 0x110: 65 61 6C 74 65 6B 0E 03 38 30 32 2E 31 31 61 63
RTW: 0x120: 20 4E 49 43 04 03 46 46 FF FF FF FF FF FF FF FF
RTW: 0x130: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
RTW: 0x140: FF FF FF FF 00 00 31 0F FF FF FF FF FF FF FF FF
RTW: 0x150: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
RTW: 0x160: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
RTW: 0x170: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
RTW: 0x180: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
RTW: 0x190: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
RTW: 0x1A0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
RTW: 0x1B0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
RTW: 0x1C0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
RTW: 0x1D0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
RTW: 0x1E0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
RTW: 0x1F0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
thus rfe_type
: 0x26
(38
decimal).
Some other random debug output:
RTW: EEPROM rfe_type=0x26
RTW: EEPROM PAType_2G is 0x0, ExternalPA_2G = 0
RTW: EEPROM PAType_5G is 0x0, external_pa_5g = 0
RTW: EEPROM LNAType_2G is 0x0, ExternalLNA_2G = 0
RTW: EEPROM LNAType_5G is 0x0, external_lna_5g = 0
RTW: EEPROM TypeGPA = 0x0
RTW: EEPROM TypeAPA = 0x0
RTW: EEPROM TypeGLNA = 0x0
RTW: EEPROM TypeALNA = 0x0
[speculation]
A bit more digging and it appears that this value is assigned to rfe_type_expand
in phydm.c
, and then referenced in phydm+hal_api8821c.c
, where a value of 0x26
indicates that the switch (that controls whether the antenna is being used for wifi or BT?) does not exist. Furthermore, rfe_type_expand
is shifted right 3 to get rfe_type
, and 0x26
shifted right 3 is 4
. That corresponds to the Type 4 option listed above... so that's my guess as to what type this module is ¯_(ツ)_/¯
Type 4 - (1-Ant, DPDT@Ant2), (2G_BTG, iPA, iLNA, iSW), (5G, iPA, iLNA, iSW)
[/speculation]
If I wanted to continue using the errant dongle, I'd use the following code to load the driver (though I still don't think it makes much of a difference what rtw_RFE_type
value is provided, as long as it's hex):
sudo insmod /lib/modules/$(uname -r)/kernel/drivers/net/wireless/realtek/rtl8821cu/8821cu.ko rtw_RFE_type=0x26
... but it's broken, so I'm sending it back.
Thanks for attending my Ted Talk.
Hi, I just got the exact adapter today (EDUP EP-AC1661) and I can't get it to work. I'm just a regular user, not a coder of sorts, and I don't understand a thing you said above :)
So my question is: Will the adapter not work? Is that a conclusion after trying two of them?
I'm on Linux Mint 19.3. I made a post on the Mint forums about it if you want to check it out.
Because I would return this too if it won't work.
Thanks.
@firepainting the first adapter I bought did not work out of the box - and I decided to send it back - due to a problem with the contents of the EFUSE. I could have made it work by manually specifying the rtw_RFE_type
when loading the driver.
The second adapter I purchased worked fine with this driver, without any changes or needing to manually load the driver.
Thank you, I appreciate it.
If I understand it, two adapters of this exact model could be "different" that one might work and the other might not (out of the box), with this driver. I guess I should talk to the vendor, then.
@airdrummingfool @firepainting
I'm on a brand new Red Hat Enterprise Linux release 8.3 (Ootpa)
, kernel 4.18.0-240.el8.x86_64
and tried what you suggested:
echo "options 8821cu rtw_RFE_type=0x26" | sudo tee /etc/modprobe.d/8821cu.conf
To no avail. This is what happens:
[ 2805.561291] RTW: module init start
[ 2805.561293] RTW: rtl8821cu v5.4.1_28754.20180921_COEX20180712-3232
[ 2805.561293] RTW: build time: Dec 9 2020 21:44:46
[ 2805.561294] RTW: rtl8821cu BT-Coex version = COEX20180712-3232
[ 2805.561348] RTW: [HALMAC]11692M
HALMAC_MAJOR_VER = 1
HALMAC_PROTOTYPE_VER = 4
HALMAC_MINOR_VER = 19
HALMAC_PATCH_VER = 3
[ 2805.561829] RTW: ERROR [HALMAC][ERR]Dump efuse in suspend
[ 2805.644256] RTW: HW EFUSE
[ 2805.644257] RTW: 0x000: 29 81 00 BC 09 00 21 00 6E 04 A4 34 10 00 30 0B
[ 2805.644261] RTW: 0x010: 1C 1D 1E 20 20 20 24 25 26 28 28 FF FF FF FF FF
[ 2805.644263] RTW: 0x020: FF FF 26 28 28 28 2A 2A 2A 2A 2A 2A 25 26 26 26
[ 2805.644266] RTW: 0x030: 00 FF FF FF FF FF FF FF FF FF 1C 1D 1E 20 20 20
[ 2805.644268] RTW: 0x040: 24 25 26 28 28 02 FF FF FF FF FF FF FF FF FF FF
[ 2805.644271] RTW: 0x050: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 2805.644273] RTW: 0x060: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 2805.644276] RTW: 0x070: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 2805.644278] RTW: 0x080: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 2805.644281] RTW: 0x090: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 2805.644283] RTW: 0x0A0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 2805.644286] RTW: 0x0B0: FF FF FF FF FF FF FF FF 7F 0A 1F 00 FF FF FF FF
[ 2805.644288] RTW: 0x0C0: FF 21 00 00 00 00 00 00 00 26 FF FF FF FF FF FF
[ 2805.644291] RTW: 0x0D0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 2805.644293] RTW: 0x0E0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 2805.644296] RTW: 0x0F0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 2805.644298] RTW: 0x100: DA 0B 20 C8 E3 46 FF E8 4E 06 88 EF 52 09 03 52
[ 2805.644301] RTW: 0x110: 65 61 6C 74 65 6B 0E 03 38 30 32 2E 31 31 61 63
[ 2805.644304] RTW: 0x120: 20 4E 49 43 04 03 46 46 FF FF FF FF FF FF FF FF
[ 2805.644306] RTW: 0x130: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 2805.644309] RTW: 0x140: FF FF FF FF 00 00 31 0F FF FF FF FF FF FF FF FF
[ 2805.644311] RTW: 0x150: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 2805.644314] RTW: 0x160: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 2805.644316] RTW: 0x170: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 2805.644319] RTW: 0x180: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 2805.644321] RTW: 0x190: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 2805.644324] RTW: 0x1A0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 2805.644326] RTW: 0x1B0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 2805.644329] RTW: 0x1C0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 2805.644331] RTW: 0x1D0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 2805.644334] RTW: 0x1E0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 2805.644336] RTW: 0x1F0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 2805.644416] RTW: hal_com_config_channel_plan chplan:0x7F
[ 2805.649616] RTW: [HALMAC][ALWAYS]shall R reg twice!!
[ 2805.651503] RTW: WARN [HALMAC][WARN]H2C/C2H ver is compatible!!
[ 2805.699239] RTW: ERROR [HALMAC][ERR]Dump efuse in suspend
[ 2805.699318] RTW: ERROR [HALMAC][ERR]Dump efuse in suspend
[ 2805.699398] RTW: ERROR [HALMAC][ERR]Dump efuse in suspend
[ 2805.699478] RTW: ERROR [HALMAC][ERR]Dump efuse in suspend
[ 2805.699558] RTW: ERROR [HALMAC][ERR]Dump efuse in suspend
[ 2805.699638] RTW: ERROR [HALMAC][ERR]Dump efuse in suspend
[ 2805.699718] RTW: ERROR [HALMAC][ERR]Dump efuse in suspend
[ 2805.699972] RTW: rtw_regsty_chk_target_tx_power_valid return _FALSE for band:0, path:0, rs:0, t:-1
[ 2805.700519] WARNING: CPU: 3 PID: 18695 at net/wireless/core.c:867 wiphy_register+0x68a/0x940 [cfg80211]
[ 2805.700520] Modules linked in: 8821cu(OE+) cfg80211 nls_utf8 isofs uas usb_storage hidp uinput rfcomm xt_CHECKSUM ipt_MASQUERADE xt_conntrack ipt_REJECT nf_nat_tftp nft_objref nf_conntrack_tftp nft_counter tun bridge stp llc nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nf_tables_set nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip6_tables nft_compat ip_set nf_tables nfnetlink cmac bnep sunrpc intel_rapl_msr intel_rapl_common x86_pkg_temp_thermal intel_powerclamp coretemp snd_hda_codec_realtek kvm_intel snd_hda_codec_generic btusb ledtrig_audio snd_hda_codec_hdmi iTCO_wdt btrtl mei_wdt wmi_bmof kvm iTCO_vendor_support btbcm btintel snd_hda_intel bluetooth snd_intel_dspcfg snd_hda_codec irqbypass intel_cstate snd_hda_core ecdh_generic snd_hwdep snd_seq intel_uncore rfkill snd_seq_device i2c_i801 pcspkr intel_rapl_perf snd_pcm lpc_ich snd_timer mei_me snd mei soundcore wmi ip_tables xfs libcrc32c dm_crypt
[ 2805.700542] sd_mod sg i915 cec intel_gtt i2c_algo_bit drm_kms_helper crct10dif_pclmul crc32_pclmul crc32c_intel syscopyarea ahci sysfillrect sysimgblt fb_sys_fops libahci drm ghash_clmulni_intel libata e1000e video dm_mirror dm_region_hash dm_log dm_mod fuse [last unloaded: cfg80211]
[ 2805.700551] CPU: 3 PID: 18695 Comm: modprobe Tainted: G W OE --------- - - 4.18.0-240.el8.x86_64 #1
[ 2805.700552] Hardware name: LENOVO 10AACTO1WW/SHARKBAY, BIOS FBKT52AUS 09/23/2013
[ 2805.700561] RIP: 0010:wiphy_register+0x68a/0x940 [cfg80211]
[ 2805.700562] Code: 78 20 00 74 25 83 ea 01 48 8d 14 52 48 c1 e2 04 48 01 c2 48 83 78 10 00 74 1c 48 39 c2 74 5a 48 83 c0 30 48 83 78 20 00 75 e9 <0f> 0b b8 ea ff ff ff e9 8a fa ff ff 48 83 78 18 00 75 dd 0f 0b b8
[ 2805.700563] RSP: 0018:ffffb2e08200f9e0 EFLAGS: 00010246
[ 2805.700564] RAX: ffffffffc1197180 RBX: ffff9b46f6ca24a0 RCX: 0000000000000000
[ 2805.700564] RDX: 0000000000000002 RSI: ffff9b46bd5ca058 RDI: 0000000000000001
[ 2805.700565] RBP: ffffb2e08200fa70 R08: 0000000000000004 R09: 0000000000000003
[ 2805.700565] R10: ffff9b46f6ca7000 R11: ffff9b4706b2c22c R12: ffffb2e081ad64f0
[ 2805.700566] R13: 0000000000000000 R14: ffffb2e081ad644e R15: ffffffffc11a9438
[ 2805.700566] FS: 00007f7918b5f740(0000) GS:ffff9b470f8c0000(0000) knlGS:0000000000000000
[ 2805.700567] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 2805.700568] CR2: 00007fd7a28d50e0 CR3: 00000003b4a5a002 CR4: 00000000001606e0
[ 2805.700568] Call Trace:
[ 2805.700580] ? handle_channel_custom.isra.24.constprop.29+0x31/0x150 [cfg80211]
[ 2805.700616] ? rtw_chbw_to_freq_range+0x40/0x96 [8821cu]
[ 2805.700645] ? rtw_is_dfs_ch+0x34/0x70 [8821cu]
[ 2805.700681] rtw_wiphy_register+0x2a/0x54 [8821cu]
[ 2805.700717] rtw_cfg80211_ndev_res_register+0x15/0x56 [8821cu]
[ 2805.700750] rtw_os_ndev_register+0x110/0x17b [8821cu]
[ 2805.700785] rtw_os_ndevs_register+0xa7/0xf6 [8821cu]
[ 2805.700819] rtw_os_ndevs_init+0x24/0x3a [8821cu]
[ 2805.700853] rtw_drv_init+0x86/0xda [8821cu]
[ 2805.700856] usb_probe_interface+0xe4/0x2f0
[ 2805.700860] really_probe+0x212/0x440
[ 2805.700862] driver_probe_device+0x49/0xc0
[ 2805.700863] device_driver_attach+0x50/0x60
[ 2805.700865] __driver_attach+0x61/0x130
[ 2805.700866] ? device_driver_attach+0x60/0x60
[ 2805.700868] bus_for_each_dev+0x77/0xc0
[ 2805.700871] ? klist_add_tail+0x3b/0x70
[ 2805.700872] bus_add_driver+0x14d/0x1e0
[ 2805.700874] driver_register+0x6b/0xb0
[ 2805.700876] usb_register_driver+0x7a/0x130
[ 2805.700877] ? 0xffffffffc12c3000
[ 2805.700903] rtw_drv_entry+0xc0/0x1000 [8821cu]
[ 2805.700906] do_one_initcall+0x46/0x1c3
[ 2805.700909] ? _cond_resched+0x15/0x30
[ 2805.700912] ? kmem_cache_alloc_trace+0x140/0x1c0
[ 2805.700915] do_init_module+0x5a/0x220
[ 2805.700916] load_module+0x14b4/0x17e0
[ 2805.700919] ? __do_sys_finit_module+0xa8/0x110
[ 2805.700920] __do_sys_finit_module+0xa8/0x110
[ 2805.700923] do_syscall_64+0x5b/0x1a0
[ 2805.700924] entry_SYSCALL_64_after_hwframe+0x65/0xca
[ 2805.700925] RIP: 0033:0x7f7917b4878d
[ 2805.700927] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d cb 56 2c 00 f7 d8 64 89 01 48
[ 2805.700928] RSP: 002b:00007ffeaf4ee418 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[ 2805.700929] RAX: ffffffffffffffda RBX: 0000564b637d4cc0 RCX: 00007f7917b4878d
[ 2805.700929] RDX: 0000000000000000 RSI: 0000564b637d5310 RDI: 0000000000000004
[ 2805.700929] RBP: 0000564b637d5310 R08: 0000000000000000 R09: 0000000000000000
[ 2805.700930] R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000000000
[ 2805.700930] R13: 0000564b637d4df0 R14: 0000000000040000 R15: 0000000000000000
[ 2805.700932] ---[ end trace ffc0ec4263e289df ]---
[ 2805.700971] WARNING: CPU: 3 PID: 18695 at /home/USER/Downloads/EP-AC1661/WiFi/rtl8821CU-5.4.1/os_dep/linux/os_intfs.c:1647 rtw_os_ndev_register+0x64/0x17b [8821cu]
[ 2805.700972] Modules linked in: 8821cu(OE+) cfg80211 nls_utf8 isofs uas usb_storage hidp uinput rfcomm xt_CHECKSUM ipt_MASQUERADE xt_conntrack ipt_REJECT nf_nat_tftp nft_objref nf_conntrack_tftp nft_counter tun bridge stp llc nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nf_tables_set nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip6_tables nft_compat ip_set nf_tables nfnetlink cmac bnep sunrpc intel_rapl_msr intel_rapl_common x86_pkg_temp_thermal intel_powerclamp coretemp snd_hda_codec_realtek kvm_intel snd_hda_codec_generic btusb ledtrig_audio snd_hda_codec_hdmi iTCO_wdt btrtl mei_wdt wmi_bmof kvm iTCO_vendor_support btbcm btintel snd_hda_intel bluetooth snd_intel_dspcfg snd_hda_codec irqbypass intel_cstate snd_hda_core ecdh_generic snd_hwdep snd_seq intel_uncore rfkill snd_seq_device i2c_i801 pcspkr intel_rapl_perf snd_pcm lpc_ich snd_timer mei_me snd mei soundcore wmi ip_tables xfs libcrc32c dm_crypt
[ 2805.700985] sd_mod sg i915 cec intel_gtt i2c_algo_bit drm_kms_helper crct10dif_pclmul crc32_pclmul crc32c_intel syscopyarea ahci sysfillrect sysimgblt fb_sys_fops libahci drm ghash_clmulni_intel libata e1000e video dm_mirror dm_region_hash dm_log dm_mod fuse [last unloaded: cfg80211]
[ 2805.700990] CPU: 3 PID: 18695 Comm: modprobe Tainted: G W OE --------- - - 4.18.0-240.el8.x86_64 #1
[ 2805.700991] Hardware name: LENOVO 10AACTO1WW/SHARKBAY, BIOS FBKT52AUS 09/23/2013
[ 2805.701024] RIP: 0010:rtw_os_ndev_register+0x64/0x17b [8821cu]
[ 2805.701025] Code: 8d a7 f0 34 00 00 b9 20 00 00 00 48 c7 c2 95 9f 0d c1 4c 89 e6 48 89 ef e8 a9 13 87 c0 48 89 df e8 35 bf 01 00 83 f8 01 74 1a <0f> 0b 4c 89 e7 e8 72 03 87 c0 b8 00 00 00 00 5b 5d 41 5c 41 5d 41
[ 2805.701026] RSP: 0018:ffffb2e08200faa0 EFLAGS: 00010297
[ 2805.701027] RAX: 0000000000000000 RBX: ffffb2e081ad3000 RCX: 0000000000000000
[ 2805.701027] RDX: 0000000000000000 RSI: ffff9b46bd5ca058 RDI: 0000000000000001
[ 2805.701028] RBP: ffff9b46f6ca0000 R08: 0000000000000004 R09: 0000000000000003
[ 2805.701028] R10: ffff9b46f6ca7000 R11: ffff9b4706b2c22c R12: ffffb2e081ad64f0
[ 2805.701029] R13: 0000000000000000 R14: ffffb2e081ad644e R15: ffffffffc11a9438
[ 2805.701030] FS: 00007f7918b5f740(0000) GS:ffff9b470f8c0000(0000) knlGS:0000000000000000
[ 2805.701030] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 2805.701031] CR2: 00007fd7a28d50e0 CR3: 00000003b4a5a002 CR4: 00000000001606e0
[ 2805.701031] Call Trace:
[ 2805.701066] rtw_os_ndevs_register+0xa7/0xf6 [8821cu]
[ 2805.701099] rtw_os_ndevs_init+0x24/0x3a [8821cu]
[ 2805.701160] rtw_drv_init+0x86/0xda [8821cu]
[ 2805.701162] usb_probe_interface+0xe4/0x2f0
[ 2805.701164] really_probe+0x212/0x440
[ 2805.701166] driver_probe_device+0x49/0xc0
[ 2805.701178] device_driver_attach+0x50/0x60
[ 2805.701179] __driver_attach+0x61/0x130
[ 2805.701180] ? device_driver_attach+0x60/0x60
[ 2805.701182] bus_for_each_dev+0x77/0xc0
[ 2805.701183] ? klist_add_tail+0x3b/0x70
[ 2805.701184] bus_add_driver+0x14d/0x1e0
[ 2805.701186] driver_register+0x6b/0xb0
[ 2805.701187] usb_register_driver+0x7a/0x130
[ 2805.701188] ? 0xffffffffc12c3000
[ 2805.701223] rtw_drv_entry+0xc0/0x1000 [8821cu]
[ 2805.701225] do_one_initcall+0x46/0x1c3
[ 2805.701227] ? _cond_resched+0x15/0x30
[ 2805.701228] ? kmem_cache_alloc_trace+0x140/0x1c0
[ 2805.701230] do_init_module+0x5a/0x220
[ 2805.701231] load_module+0x14b4/0x17e0
[ 2805.701233] ? __do_sys_finit_module+0xa8/0x110
[ 2805.701234] __do_sys_finit_module+0xa8/0x110
[ 2805.701236] do_syscall_64+0x5b/0x1a0
[ 2805.701237] entry_SYSCALL_64_after_hwframe+0x65/0xca
[ 2805.701238] RIP: 0033:0x7f7917b4878d
[ 2805.701239] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d cb 56 2c 00 f7 d8 64 89 01 48
[ 2805.701240] RSP: 002b:00007ffeaf4ee418 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[ 2805.701241] RAX: ffffffffffffffda RBX: 0000564b637d4cc0 RCX: 00007f7917b4878d
[ 2805.701241] RDX: 0000000000000000 RSI: 0000564b637d5310 RDI: 0000000000000004
[ 2805.701242] RBP: 0000564b637d5310 R08: 0000000000000000 R09: 0000000000000000
[ 2805.701242] R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000000000
[ 2805.701243] R13: 0000564b637d4df0 R14: 0000000000040000 R15: 0000000000000000
[ 2805.701244] ---[ end trace ffc0ec4263e289e0 ]---
[ 2805.710211] WARNING: CPU: 3 PID: 18695 at /home/USER/Downloads/EP-AC1661/WiFi/rtl8821CU-5.4.1/os_dep/linux/os_intfs.c:3105 rtw_os_ndevs_register+0xaf/0xf6 [8821cu]
[ 2805.710212] Modules linked in: 8821cu(OE+) cfg80211 nls_utf8 isofs uas usb_storage hidp uinput rfcomm xt_CHECKSUM ipt_MASQUERADE xt_conntrack ipt_REJECT nf_nat_tftp nft_objref nf_conntrack_tftp nft_counter tun bridge stp llc nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nf_tables_set nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip6_tables nft_compat ip_set nf_tables nfnetlink cmac bnep sunrpc intel_rapl_msr intel_rapl_common x86_pkg_temp_thermal intel_powerclamp coretemp snd_hda_codec_realtek kvm_intel snd_hda_codec_generic btusb ledtrig_audio snd_hda_codec_hdmi iTCO_wdt btrtl mei_wdt wmi_bmof kvm iTCO_vendor_support btbcm btintel snd_hda_intel bluetooth snd_intel_dspcfg snd_hda_codec irqbypass intel_cstate snd_hda_core ecdh_generic snd_hwdep snd_seq intel_uncore rfkill snd_seq_device i2c_i801 pcspkr intel_rapl_perf snd_pcm lpc_ich snd_timer mei_me snd mei soundcore wmi ip_tables xfs libcrc32c dm_crypt
[ 2805.710225] sd_mod sg i915 cec intel_gtt i2c_algo_bit drm_kms_helper crct10dif_pclmul crc32_pclmul crc32c_intel syscopyarea ahci sysfillrect sysimgblt fb_sys_fops libahci drm ghash_clmulni_intel libata e1000e video dm_mirror dm_region_hash dm_log dm_mod fuse [last unloaded: cfg80211]
[ 2805.710231] CPU: 3 PID: 18695 Comm: modprobe Tainted: G W OE --------- - - 4.18.0-240.el8.x86_64 #1
[ 2805.710232] Hardware name: LENOVO 10AACTO1WW/SHARKBAY, BIOS FBKT52AUS 09/23/2013
[ 2805.710269] RIP: 0010:rtw_os_ndevs_register+0xaf/0xf6 [8821cu]
[ 2805.710270] Code: 87 b4 48 00 00 49 8d b5 4e 34 00 00 84 c0 74 0d 49 8d b5 5e 34 00 00 3c 01 49 0f 45 f7 e8 eb f1 ff ff 41 89 c4 83 f8 01 74 b2 <0f> 0b 85 db 75 15 48 63 db 48 8b bc dd 50 01 00 00 48 85 ff 74 05
[ 2805.710271] RSP: 0018:ffffb2e08200fad8 EFLAGS: 00010297
[ 2805.710271] RAX: 0000000000000000 RBX: 0000000000000000 RCX: dead000000000200
[ 2805.710272] RDX: ffff9b46f6ca0060 RSI: ffffb2e081ad6588 RDI: ffffb2e081ad65b0
[ 2805.710273] RBP: ffff9b46f6ca7000 R08: 00000000000062ac R09: 00000000000062ac
[ 2805.710273] R10: 0000000000000000 R11: ffff9b470f8e8c64 R12: 0000000000000000
[ 2805.710274] R13: ffffb2e081ad3000 R14: 0000000000000001 R15: ffffffffc11a9438
[ 2805.710275] FS: 00007f7918b5f740(0000) GS:ffff9b470f8c0000(0000) knlGS:0000000000000000
[ 2805.710275] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 2805.710276] CR2: 00007fd7a28d50e0 CR3: 00000003b4a5a002 CR4: 00000000001606e0
[ 2805.710276] Call Trace:
[ 2805.710315] rtw_os_ndevs_init+0x24/0x3a [8821cu]
[ 2805.710352] rtw_drv_init+0x86/0xda [8821cu]
[ 2805.710354] usb_probe_interface+0xe4/0x2f0
[ 2805.710356] really_probe+0x212/0x440
[ 2805.710357] driver_probe_device+0x49/0xc0
[ 2805.710359] device_driver_attach+0x50/0x60
[ 2805.710360] __driver_attach+0x61/0x130
[ 2805.710361] ? device_driver_attach+0x60/0x60
[ 2805.710363] bus_for_each_dev+0x77/0xc0
[ 2805.710364] ? klist_add_tail+0x3b/0x70
[ 2805.710365] bus_add_driver+0x14d/0x1e0
[ 2805.710367] driver_register+0x6b/0xb0
[ 2805.710368] usb_register_driver+0x7a/0x130
[ 2805.710369] ? 0xffffffffc12c3000
[ 2805.710396] rtw_drv_entry+0xc0/0x1000 [8821cu]
[ 2805.710398] do_one_initcall+0x46/0x1c3
[ 2805.710400] ? _cond_resched+0x15/0x30
[ 2805.710401] ? kmem_cache_alloc_trace+0x140/0x1c0
[ 2805.710403] do_init_module+0x5a/0x220
[ 2805.710404] load_module+0x14b4/0x17e0
[ 2805.710407] ? __do_sys_finit_module+0xa8/0x110
[ 2805.710408] __do_sys_finit_module+0xa8/0x110
[ 2805.710410] do_syscall_64+0x5b/0x1a0
[ 2805.710411] entry_SYSCALL_64_after_hwframe+0x65/0xca
[ 2805.710412] RIP: 0033:0x7f7917b4878d
[ 2805.710413] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d cb 56 2c 00 f7 d8 64 89 01 48
[ 2805.710414] RSP: 002b:00007ffeaf4ee418 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[ 2805.710415] RAX: ffffffffffffffda RBX: 0000564b637d4cc0 RCX: 00007f7917b4878d
[ 2805.710415] RDX: 0000000000000000 RSI: 0000564b637d5310 RDI: 0000000000000004
[ 2805.710416] RBP: 0000564b637d5310 R08: 0000000000000000 R09: 0000000000000000
[ 2805.710416] R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000000000
[ 2805.710417] R13: 0000564b637d4df0 R14: 0000000000040000 R15: 0000000000000000
[ 2805.710418] ---[ end trace ffc0ec4263e289e1 ]---
[ 2805.710860] RTW: WARN free_recv_skb_queue not empty, 8
[ 2805.710889] usbcore: registered new interface driver rtl8821cu
[ 2805.710889] RTW: module init ret=0
UPDATE: With this little change, I was able to compile v5.8.1_34171.20190628_COEX20190509-4141
, but the issue remains.
Hello, I'm creating this issue in case others run into this problem, but also I'm curious if anyone has an explanation/suggestion on how to proceed.
I have successfully compiled the driver (versions 5.4.1 and 5.8.1) on an RPi 3 (Buster 5.4.51). When I connect an EDUP EP-AC1661 there is an error shown in
dmesg
, and it does not work.dmesg
output:The error appears to come from this line: https://github.com/brektrou/rtl8821CU/blob/45a8b4393e3281b969822c81bd93bdb731d58472/hal/rtl8821c/rtl8821c_ops.c#L410
The lines right after the error suggests manually providing a value for
rtw_RFE_type
when loading the module. Based onrtl8821c_ops.c
there appear to be 8 options:If I unload the module (
sudo rmmod 8821cu.ko
) and then re-load it specifying any one of the above types, it seems to work fine:sudo insmod /lib/modules/$(uname -r)/kernel/drivers/net/wireless/realtek/rtl8821cu/8821cu.ko rtw_RFE_type=7
The wifi works just as well if I put
rtw_RFE_type=0
orrtw_RFE_type=1
, etc.Digging a bit deeper, it appears that the RFE Type is used to determine antenna isolation and the BT coexistence mechanism. Is there a way to know which is correct for my wifi dongle, or which is optimal in any given situation?