lwfinger / rtw8852cu

GNU General Public License v2.0
26 stars 17 forks source link

6ghz #2

Closed aquilarubra closed 1 year ago

aquilarubra commented 1 year ago

I got a Tenda 6e router. I tested an AX210 and the 8832CU under Windows and Linux.

With unified bands (same SID): The AX210 behaved with no hassles under all systems and chose the 6ghz band as a preference. The 8832CU could not connect. Under Windows, as soon as it is authenticated, the adapter disconnects from devices. Then it becomes available again, it tries to connect again, and the cycle repeats. Sometimes it can connect to the 2.4Ghz band, sometimes it will just say, "cannot connect to this network". After a while, the system becomes unstable and needs a forced reboot. Under Linux, same thing, aside that it won't see the 6ghz band (I set up the country db). It doesn't become unstable, but it just doesn't work.

With 2.4ghz and 5ghz unified, while 6ghz on its own SID: Under Windows it connects with occasional adapter disappearance as before. But it mostly works. Under Linux, still no way to see the 6ghz band.

Conclusion: Unified networks will use WPA3 for all of them. The AX210 seems to handle this. The 8832CU does not handle it. It needs separate SIDs for WPA2 and WPA3. Maybe I cannot find the way to enable region with the 8832CU. But with the AX210 it worked, so I wonder what's wrong.

lwfinger commented 1 year ago

The driver enables WPA3 through CONFIG_WPA3_SUITEB_SUPPORT. It should work.

You can set the region ias follows: As root, create a file /usr/lib/modprobe.d/70-8852cu.conf, and add a line that says: options 8852cu rtw_country_code=US or whatever country is appropriate.

aquilarubra commented 1 year ago

It still doesn't work. I have now the stick on a laptop having an AX210 also. The AX210 lists the 6ghz band, the 8852cu doesn't.

I think that I saw once some configuration of the region in the source code of the driver, but I cannot find it again. But it would seem strange if I have to configure that at build time.

aquilarubra commented 1 year ago

Output of iw reg get (I don't know why the working AX210 sets the country as DE; the router has no configuration of the region):

global country IT: DFS-ETSI (2400 - 2483 @ 40), (N/A, 20), (N/A) (5150 - 5250 @ 80), (N/A, 23), (N/A), NO-OUTDOOR, AUTO-BW (5250 - 5350 @ 80), (N/A, 20), (0 ms), NO-OUTDOOR, DFS, AUTO-BW (5470 - 5725 @ 160), (N/A, 26), (0 ms), DFS (5725 - 5875 @ 80), (N/A, 13), (N/A) (5945 - 6425 @ 160), (N/A, 23), (N/A), NO-OUTDOOR (57000 - 66000 @ 2160), (N/A, 40), (N/A)

phy#1 (self-managed) country IT: DFS-UNSET (2402 - 2482 @ 40), (6, 20), (N/A), NO-80MHZ, NO-160MHZ (5170 - 5330 @ 160), (6, 20), (N/A) (5490 - 5710 @ 160), (6, 20), (N/A) (5735 - 5835 @ 80), (6, 20), (N/A)

phy#0 (self-managed) country DE: DFS-UNSET (2402 - 2437 @ 40), (6, 22), (N/A), AUTO-BW, NO-HT40MINUS, NO-80MHZ, NO-160MHZ (2422 - 2462 @ 40), (6, 22), (N/A), AUTO-BW, NO-80MHZ, NO-160MHZ (2447 - 2482 @ 40), (6, 22), (N/A), AUTO-BW, NO-HT40PLUS, NO-80MHZ, NO-160MHZ (5170 - 5190 @ 160), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40MINUS, PASSIVE-SCAN (5190 - 5210 @ 160), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40PLUS, PASSIVE-SCAN (5210 - 5230 @ 160), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40MINUS, PASSIVE-SCAN (5230 - 5250 @ 160), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40PLUS, PASSIVE-SCAN (5250 - 5270 @ 160), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40MINUS, PASSIVE-SCAN (5270 - 5290 @ 160), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40PLUS, PASSIVE-SCAN (5290 - 5310 @ 160), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40MINUS, PASSIVE-SCAN (5310 - 5330 @ 160), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40PLUS, PASSIVE-SCAN (5490 - 5510 @ 220), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40MINUS, PASSIVE-SCAN (5510 - 5530 @ 220), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40PLUS, PASSIVE-SCAN (5530 - 5550 @ 220), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40MINUS, PASSIVE-SCAN (5550 - 5570 @ 220), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40PLUS, PASSIVE-SCAN (5570 - 5590 @ 220), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40MINUS, PASSIVE-SCAN (5590 - 5610 @ 220), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40PLUS, PASSIVE-SCAN (5610 - 5630 @ 220), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40MINUS, PASSIVE-SCAN (5630 - 5650 @ 220), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40PLUS, PASSIVE-SCAN (5650 - 5670 @ 80), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40MINUS, NO-160MHZ, PASSIVE-SCAN (5670 - 5690 @ 80), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40PLUS, NO-160MHZ, PASSIVE-SCAN (5690 - 5710 @ 80), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40MINUS, NO-160MHZ, PASSIVE-SCAN (5735 - 5755 @ 80), (6, 22), (N/A), AUTO-BW, NO-HT40MINUS, NO-160MHZ (5755 - 5775 @ 80), (6, 22), (N/A), AUTO-BW, NO-HT40PLUS, NO-160MHZ (5775 - 5795 @ 80), (6, 22), (N/A), AUTO-BW, NO-HT40MINUS, NO-160MHZ (5795 - 5815 @ 80), (6, 22), (N/A), AUTO-BW, NO-HT40PLUS, NO-160MHZ (5815 - 5835 @ 40), (6, 22), (N/A), AUTO-BW, NO-HT40MINUS, NO-80MHZ, NO-160MHZ (5945 - 5965 @ 480), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40PLUS, PASSIVE-SCAN (5965 - 5985 @ 480), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40MINUS, PASSIVE-SCAN (5985 - 6005 @ 480), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40PLUS, PASSIVE-SCAN (6005 - 6025 @ 480), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40MINUS, PASSIVE-SCAN (6025 - 6045 @ 480), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40PLUS, PASSIVE-SCAN (6045 - 6065 @ 480), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40MINUS, PASSIVE-SCAN (6065 - 6085 @ 480), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40PLUS, PASSIVE-SCAN (6085 - 6105 @ 480), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40MINUS, PASSIVE-SCAN (6105 - 6125 @ 480), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40PLUS, PASSIVE-SCAN (6125 - 6145 @ 480), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40MINUS, PASSIVE-SCAN (6145 - 6165 @ 480), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40PLUS, PASSIVE-SCAN (6165 - 6185 @ 480), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40MINUS, PASSIVE-SCAN (6185 - 6205 @ 480), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40PLUS, PASSIVE-SCAN (6205 - 6225 @ 480), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40MINUS, PASSIVE-SCAN (6225 - 6245 @ 480), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40PLUS, PASSIVE-SCAN (6245 - 6265 @ 480), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40MINUS, PASSIVE-SCAN (6265 - 6285 @ 480), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40PLUS, PASSIVE-SCAN (6285 - 6305 @ 480), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40MINUS, PASSIVE-SCAN (6305 - 6325 @ 480), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40PLUS, PASSIVE-SCAN (6325 - 6345 @ 480), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40MINUS, PASSIVE-SCAN (6345 - 6365 @ 480), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40PLUS, PASSIVE-SCAN (6365 - 6385 @ 480), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40MINUS, PASSIVE-SCAN (6385 - 6405 @ 480), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40PLUS, PASSIVE-SCAN (6405 - 6425 @ 480), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40MINUS, PASSIVE-SCAN

aquilarubra commented 1 year ago

phy#1 is the 8832cu phy#0 is the AX210

lwfinger commented 1 year ago

Why is phy#1 set for IT and phy#0 set for DE?

aquilarubra commented 1 year ago

IT is what I have set. I don't know why and from where the ax210 gets DE.

Anyway, since the ax210 is working, I tried setting everything to DE. But still the 8832cu does not see the 6ghz band.

aquilarubra commented 1 year ago

If it may help, here is the output of "systool -vm 8852cu":

Module = "8852cu"

Attributes: coresize = "6275072" initsize = "0" initstate = "live" refcnt = "0" srcversion = "CDF3BCA1ACFF1C4B0A5B1F6" taint = "OE" uevent = version = "v1.19.2-107-g2751ef875.20221230"

Parameters: if2name = "wlan%d" ifname = "wlan%d" rtw_FileMaskEfuse = "0" rtw_GLNA_type = "0" rtw_OffEfuseMask = "0" rtw_TxBBSwing_2G = "255" rtw_TxBBSwing_5G = "255" rtw_adaptivity_en = "0" rtw_adaptivity_idle_probability= "0" rtw_adaptivity_mode = "0" rtw_adaptivity_th_edcca_hl_diff= "0" rtw_adaptivity_th_l2h_ini= "0" rtw_ampdu_enable = "1" rtw_amplifier_type_2g= "0" rtw_amplifier_type_5g= "0" rtw_amsdu_mode = "0" rtw_ant_num = "0" rtw_antdiv_cfg = "2" rtw_antdiv_type = "0" rtw_ap_fwd_b2u_flags= "8" rtw_ap_src_b2u_flags= "8" rtw_band = "1" rtw_band_type = "7" rtw_bcn_hint_valid_ms= "60000" rtw_beamform_cap = "130" rtw_btcoex_enable = "2" rtw_busy_thresh = "40" rtw_bw_mode = "817" rtw_ch_switch_offload= "0" rtw_channel_plan = "65535" rtw_channel = "36" rtw_check_hw_status = "0" rtw_chip_version = "0" rtw_country_code = "IT" rtw_country_ie_slave_en_ifbmp= "255" rtw_country_ie_slave_en_mode= "0" rtw_country_ie_slave_en_role= "3" rtw_country_ie_slave_flags= "1" rtw_country_ie_slave_scan_int_ms= "60000" rtw_decrypt_phy_file= "0" rtw_dfs_region_domain= "0" rtw_dis_ch_flags = "(null)" rtw_drv_ant_band_switch= "1" rtw_dyn_txbf = "1" rtw_dynamic_agg_enable= "1" rtw_edcca_cs_th = "0" rtw_edcca_th_2g = "0" rtw_edcca_th_5g = "0" rtw_en_dyn_rrsr = "1" rtw_en_ecsa = "1" rtw_en_gro = "1" rtw_en_napi = "1" rtw_excl_chs = rtw_full_ch_in_p2p_handshake= "0" rtw_halrf_ability = "4294967295" rtw_he_enable = "1" rtw_hiq_filter = "1" rtw_ht_enable = "1" rtw_hw_rts_en = "1" rtw_hw_wps_pbc = "1" rtw_hwpwrp_detect = "0" rtw_init_regd_always_apply= "0" rtw_initmac = "(null)" rtw_iqk_fw_offload = "0" rtw_lbkmode = "0" rtw_load_phy_file = "1744" rtw_low_power = "0" rtw_lowrate_two_xmit= "1" rtw_max_amsdu_len = "1" rtw_max_bss_cnt = "0" rtw_max_roaming_times= "2" rtw_mp_mode = "0" rtw_network_mode = "0" rtw_pci_dynamic_aspm_linkctrl= "0" rtw_phy_file_path = "/lib/firmware/" rtw_phydm_ability = "4294967295" rtw_pll_ref_clk_sel = "15" rtw_powertracking_type= "64" rtw_pwrtrim_enable = "0" rtw_qos_opt_enable = "0" rtw_quick_addba_req = "0" rtw_quota_turbo_en = "0" rtw_rf_path = "8" rtw_rfe_type = "255" rtw_rfintfs = "2" rtw_rfk_ability = "4294967295" rtw_roch_extend_dur = "500" rtw_roch_max_away_dur= "500" rtw_roch_min_home_dur= "1500" rtw_rrsr_value = "-1" rtw_rx_ampdu_amsdu = "2" rtw_rx_ampdu_sz_limit_1ss= rtw_rx_ampdu_sz_limit_2ss= rtw_rx_ampdu_sz_limit_3ss= rtw_rx_ampdu_sz_limit_4ss= rtw_rx_nss = "0" rtw_rxgain_offset_2g= "0" rtw_rxgain_offset_5gh= "0" rtw_rxgain_offset_5gl= "0" rtw_rxgain_offset_5gm= "0" rtw_scan_interval_thr= "16000" rtw_scan_pch_ex = "0" rtw_single_ant_path = "0" rtw_stbc_cap = "307" rtw_sw_proto_bf_cap_phy0= "130" rtw_sw_proto_bf_cap_phy1= "130" rtw_switch_usb_mode = "0" rtw_target_tx_pwr_2g_a= rtw_target_tx_pwr_2g_b= rtw_target_tx_pwr_2g_c= rtw_target_tx_pwr_2g_d= rtw_target_tx_pwr_5g_a= rtw_target_tx_pwr_5g_b= rtw_target_tx_pwr_5g_c= rtw_target_tx_pwr_5g_d= rtw_tx_ampdu_amsdu = "2" rtw_tx_ampdu_num = "0" rtw_tx_bw_mode = "817" rtw_tx_nss = "0" rtw_tx_pwr_by_rate = "1" rtw_tx_pwr_lmt_enable= "0" rtw_usb_rxagg_mode = "2" rtw_user_regd_always_apply= "0" rtw_vcs_type = "1" rtw_vht_24g_enable = "0" rtw_vht_enable = "1" rtw_vht_rx_mcs_map = "43690" rtw_vo_edca = "0" rtw_vrtl_carrier_sense= "1" rtw_wifi_spec = "0" rtw_wireless_mode = "63" rtw_wmm_enable = "1" rtw_wowlan_sta_mix_mode= "0"

Sections: .altinstr_replacement= "0xffffffffc2e95bf3" .altinstructions = "0xffffffffc2e96000" .bss = "0xffffffffc30feb00" .call_sites = "0xffffffffc2fc03f8" .data = "0xffffffffc30a53e0" .exit.data = "0xffffffffc30fe720" .exit.text = "0xffffffffc2e95c00" .gnu.linkonce.this_module= "0xffffffffc30fe740" .ibt_endbr_seal = "0xffffffffc2fecebc" .init.data = "0xffffffffc2934000" .init.text = "0xffffffffc2933000" .note.Linux = "0xffffffffc30938f4" .note.gnu.build-id = "0xffffffffc30938d0" .note.gnu.property = "0xffffffffc3093890" .orc_unwind = "0xffffffffc2ff3218" .orc_unwind_ip = "0xffffffffc30535f6" .printk_index = "0xffffffffc30f8688" .retpoline_sites = "0xffffffffc2fae8b8" .return_sites = "0xffffffffc2fb5ce0" .rodata = "0xffffffffc2e96020" .rodata.str1.1 = "0xffffffffc2f90a7e" .rodata.str1.8 = "0xffffffffc2f58f70" .smp_locks = "0xffffffffc2fad2f4" .strtab = "0xffffffffc29cb8e8" .symtab = "0xffffffffc2935000" .text = "0xffffffffc2c22000" bug_table = "0xffffffffc3094000" __mcount_loc = "0xffffffffc2f494ac" param = "0xffffffffc2fad3f0" __patchable_function_entries= "0xffffffffc3095320"

lwfinger commented 1 year ago

The database for CRDA shows the following for IT: country TT: DFS-FCC (2402 - 2482 @ 40), (20) (5170 - 5250 @ 80), (17), AUTO-BW (5250 - 5330 @ 80), (24), DFS, AUTO-BW (5490 - 5730 @ 160), (24), DFS (5735 - 5835 @ 80), (30)

In other words, no 6 GHz band.

On the other hand, DE has the following: country DE: DFS-ETSI (2400 - 2483.5 @ 40), (100 mW) (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI

short range devices (ETSI EN 300 440-1)

    (5725 - 5875 @ 80), (25 mW)
    # WiFi 6E
    (5945 - 6425 @ 160), (23), NO-OUTDOOR, wmmrule=ETSI
    # 60 GHz band channels 1-4 (ETSI EN 302 567)
    (57000 - 66000 @ 2160), (40)

The 6G band is allowed.

I get lost trying to follow what is allowed in the channel plans of the driver. The code is one misdirection after another.

aquilarubra commented 1 year ago

You got country TT.

Italy has 6ghz allowed:

country IT: DFS-ETSI (2402 - 2482 @ 40), (30) (5170 - 5250 @ 80), (30), AUTO-BW (5250 - 5330 @ 80), (30), DFS, AUTO-BW (5490 - 5710 @ 160), (30), DFS

60 GHz band channels 1-4, ref: Etsi En 302 567

(57000 - 66000 @ 2160), (30)

Maybe some other settings are missing, such as the plan. I can see that it is possible to initialize country and a bunch of things in the Makefile. Or maybe this driver is just still immature and needs some work.

lwfinger commented 1 year ago

Sorry about my mistake.

You are welcome to dig around in the code to find the problem. I will spend that time getting USB devices handled under rtw89 instead.

rmandrad commented 1 year ago

@aquilarubra would you mind to share your linux config (hostapd or similar) ? the CONFIG_IEEE80211_BAND_6GHZ seems to drive the code to enable/disable 6GHZ and if not define disables it seems ... check include/drv_conf.h

aquilarubra commented 1 year ago

I set it aside. I have a Netgear A8000 that works, now.

lwfinger commented 1 year ago

That routine does the following:

ifndef CONFIG_IEEE80211_BAND_6GHZ

define CONFIG_IEEE80211_BAND_6GHZ 0

endif

If you want to enable 6GHz operations, add a line that says

define CONFIG_IEEE80211_BAND_6GHZ 1

just above this section. I have neither an 8852cu, nor a 6GHz router, thus I have no idea if it works.

I added the above line and pushed the fix.

vitor-alves commented 10 months ago

@lwfinger Thank so much for working on this great project and making it public. Thanks to you I got an Aliexpress usb adapter to work. I was almost giving up because I coudn't find linux drivers. Your driver worked perfectly. You are doing what Realtek should have done. Thank you!

lwfinger commented 10 months ago

This is Realtek's driver. All I do is make it compile on older kernels.