morrownr / rtl8852bu

Linux Driver for USB WiFi Adapters that are based on the RTL8832BU and RTL8852BU Chipsets - v1.19.3 - 20230505
Other
81 stars 13 forks source link

Experiment with support for TP-LINK TX20U (not PLUS!) #30

Closed lordjim1985 closed 1 month ago

lordjim1985 commented 1 month ago

Hello,

I'm writing to inform You that made an experiment with TP-LINK TX20U (not Plus Version) and added in os_dep/linux/usb_intf.c following identifiers: 0x35bc, 0x0100.

To my suprise everything works quite well even with 802.11ax. I'm testing the device as Access Point with hostapd.

It is relatively cheap AX1800 dongle.

TP-LINK officialy does not provide a linux driver.

Do you have any recommendations for any additional testing?

morrownr commented 1 month ago

Hi @lordjim1985

Do you have any recommendations for any additional testing?

Yes. It would help confirm that the patch I just submitted is correct if you could remove the driver, delete the driver subdirectory and then start over with a fresh download. If that works, things checkout good. Let me know.

To remove the driver:

$ sudo sh remove-driver.sh

Thanks for the info.

lordjim1985 commented 1 month ago

Hi there,

I've removed my changes. Cleaned the build dir and pulled your changes. I've built the driver sucessfully on Ubuntu 23.10 Mantic. The driver works well.

I'm using the following hostapd.conf:

logger_syslog=-1 logger_syslog_level=2 logger_stdout=-1 logger_stdout_level=2 interface=wlx74fece4c7190 bridge=br0 driver=nl80211 hw_mode=a country_code=PL channel=36 vht_oper_centr_freq_seg0_idx=42 ssid=ExampleSSIDofWiFiNetwork ignore_broadcast_ssid=0 ieee80211d=1 ieee80211n=1 ieee80211w=1 ht_capab=[MAX-AMSDU-7935][HT40+][SHORT-GI-20][SHORT-GI-40][DSSS_CCK-40][TX-STBC][RX-STBC1] ieee80211ac=1 ieee80211ax=1 vht_capab=[SHORT-GI-80][SU-BEAMFORMEE] vht_oper_chwidth=1 auth_algs=1 wpa=2 wpa_passphrase=SecretPasshphrase wpa_key_mgmt=WPA-PSK WPA-PSK-SHA256 SAE rsn_pairwise=CCMP sae_require_mfp=1 macaddr_acl=0 wmm_enabled=1

And the following settings in 8852bu.conf :

options 8852bu rtw_switch_usb_mode=0 rtw_he_enable=1 rtw_vht_enable=1 rtw_dfs_region_domain=0.

I'm getting about 32.5MB/s on 802.11ax with WPA3 enabled.

With the following options:

options 8852bu rtw_switch_usb_mode=1 rtw_he_enable=2 rtw_vht_enable=2 rtw_dfs_region_domain=0.

I'm getting about 37-40MB/s on 802.11ax with WPA3 enabled.

lordjim1985 commented 1 month ago

Hi,

Im here with an update. It seems that enabling 802.11n mode only causes the driver to crash. For some reason the 5Ghz options are working while the 802.11n are causing a crash. What information i can provide for futher debugging?

lordjim1985 commented 1 month ago

Hello,

another update. After upgrading Ubuntu 23.10 to Ubuntu 24.04 the 802.11n mode also works, though quite slow it is operational.

The kernel was changed from 6.5.0 to 6.8.0 during upgrade.

lordjim1985 commented 1 month ago

Hi,

the performance on 802.11n channel 4 was low. I've switched to channel 11 and not I get 7.86MB/s on 802.11n. So as far as I can tell it works. Though some messages in dmesg are worrying me. I'm pasting the output:

[ 3473.989582] UBSAN: array-index-out-of-bounds in /var/lib/dkms/rtl8852bu/1.19.3/build/os_dep/linux/wifi_regd.c:264:18 [ 3473.989587] index 0 is out of range for type 'RT_CHANNEL_INFO [*]' [ 3473.989589] CPU: 1 PID: 13721 Comm: modprobe Tainted: G OE 6.8.0-31-generic #31-Ubuntu [ 3473.989592] Hardware name: Shenzhen DOKE electronic co., LTD MP80/MP80, BIOS 5.26 09/27/2023 [ 3473.989593] Call Trace: [ 3473.989596] [ 3473.989600] dump_stack_lvl+0x48/0x70 [ 3473.989612] dump_stack+0x10/0x20 [ 3473.989614] ubsan_handle_out_of_bounds+0xc6/0x110 [ 3473.989619] rtw_update_wiphy_regd+0x11b/0x560 [8852bu] [ 3473.989866] rtw_regd_change_complete_sync+0x5b/0x150 [8852bu] [ 3473.990023] ? rtw_regd_change_complete_sync+0x5b/0x150 [8852bu] [ 3473.990184] rtw_wiphy_register+0xb8/0xc0 [8852bu] [ 3473.990342] rtw_cfg80211_dev_res_register+0x15/0x30 [8852bu] [ 3473.990495] rtw_os_ndevs_register+0x21/0xf0 [8852bu] [ 3473.990643] rtw_os_ndevs_init+0x34/0x50 [8852bu] [ 3473.990793] rtw_dev_probe+0x589/0x5d0 [8852bu] [ 3473.990949] usb_probe_interface+0xeb/0x300 [ 3473.990954] really_probe+0x1c4/0x410 [ 3473.990957] driver_probe_device+0x8c/0x180 [ 3473.990959] driver_probe_device+0x24/0xd0 [ 3473.990961] driver_attach+0x10b/0x210 [ 3473.990963] ? _pfxdriver_attach+0x10/0x10 [ 3473.990965] bus_for_each_dev+0x8a/0xf0 [ 3473.990968] driver_attach+0x1e/0x30 [ 3473.990970] bus_add_driver+0x156/0x260 [ 3473.990972] driver_register+0x5e/0x130 [ 3473.990974] usb_register_driver+0x83/0x170 [ 3473.990978] ? pfx_rtw_drv_entry+0x10/0x10 [8852bu] [ 3473.991122] rtw_drv_entry+0x55/0xff0 [8852bu] [ 3473.991272] ? pfx_rtw_drv_entry+0x10/0x10 [8852bu] [ 3473.991425] do_one_initcall+0x5b/0x340 [ 3473.991431] do_init_module+0xc0/0x2c0 [ 3473.991436] load_module+0xba1/0xcf0 [ 3473.991439] init_module_from_file+0x96/0x100 [ 3473.991440] ? init_module_from_file+0x96/0x100 [ 3473.991443] idempotent_init_module+0x11c/0x2b0 [ 3473.991445] x64_sys_finit_module+0x64/0xd0 [ 3473.991447] x64_sys_call+0x1d6e/0x25c0 [ 3473.991448] do_syscall_64+0x7f/0x180 [ 3473.991453] ? syscall_exit_to_user_mode+0x86/0x260 [ 3473.991456] ? do_syscall_64+0x8c/0x180 [ 3473.991458] ? do_syscall_64+0x8c/0x180 [ 3473.991460] ? x64_sys_openat+0x55/0xa0 [ 3473.991464] ? syscall_exit_to_user_mode+0x86/0x260 [ 3473.991466] ? do_syscall_64+0x8c/0x180 [ 3473.991468] ? do_syscall_64+0x8c/0x180 [ 3473.991470] ? irqentry_exit+0x43/0x50 [ 3473.991473] ? exc_page_fault+0x94/0x1b0 [ 3473.991476] entry_SYSCALL_64_after_hwframe+0x73/0x7b [ 3473.991480] RIP: 0033:0x7222df52725d [ 3473.991500] Code: ff 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 8b bb 0d 00 f7 d8 64 89 01 48 [ 3473.991502] RSP: 002b:00007ffec42cb798 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 3473.991505] RAX: ffffffffffffffda RBX: 00005f888b48de60 RCX: 00007222df52725d [ 3473.991506] RDX: 0000000000000004 RSI: 00005f888b48e300 RDI: 0000000000000003 [ 3473.991507] RBP: 00007ffec42cb850 R08: 0000000000000040 R09: 00007ffec42cb7e0 [ 3473.991509] R10: 00007222df603b20 R11: 0000000000000246 R12: 00005f888b48e300 [ 3473.991510] R13: 0000000000040000 R14: 00005f888b48df90 R15: 00005f888b48e300 [ 3473.991512] [ 3473.991529] ---[ end trace ]---

morrownr commented 1 month ago

@lordjim1985

I can fix that USBAN problem as I have time but it likely is not causing any problems.

I can help you more, especially with AP mode, as I have some spare time... maybe this evening but please understand that this is not what I would call a good driver. I'm really disappointed in the WiFi 6 Linux driver from Realtek. If you can still return this adapter, you might want to consider that option.. The Main Menu here at this site has a lot of information that you may want to read:

https://github.com/morrownr/USB-WiFi

Scroll down. Menu items 1 and 2 are a good place to start.

lordjim1985 commented 1 month ago

Ho @morrownr,

Well it is your free time so it is up to you :)

I can return it of course but it works quite well in Windows and thanks to you most of the functions I need under Linux are operational so simply speaking: i'll find uses for it.

Thanks for your great work and the information you provided. If you need me i'll also be available in the evening.

morrownr commented 1 month ago

@lordjim1985

I am going to go ahead and close this issue. If you need help with AP mode or you see another problem, Let me know.