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

Driver hang on NanoPi / FriendlyWrt, Cannot Start AP Mode #11

Closed sskaje closed 8 months ago

sskaje commented 8 months ago

Platform: NanoPi R6s (arm64, rk3588s) + FriendlyWRT (an OpenWrt fork for NanoPi) Kernel: 5.10, 6.1 Kernel repo: https://github.com/friendlyarm/kernel-rockchip Dongle: Asus AX53 Nano Ethernet connected

Tested on Dell Laptop + Debian Bookworm, amd64, works pefect, with https://github.com/lakinduakash/linux-wifi-hotspot

OpenWrt AP settings: Mode AX, 5GHz, Channel: 36/149, bandwidth: 20/80MHz, Country Code US

Kernel module is loaded on boot, with the 8852bu.conf from this repo.

On this OpenWrt fork, dongle can be recognized.

When I plugged the device in, configured openwrt and clicked apply, Luci not responding, iw list not responding, ifconfig not responding.

If I start the device with dongle plugged in, network hang, cannot access remotely, console access with keyboard + monitor is fine. iw list, ifconfig also responding.

Such not responding, I can't interrupt by ctrl+c from ssh or console. But if it's frozen after luci clicking apply, I can still start an new ssh connection.

If kernel module is not auto loaded on boot, no frozen on boot if with dongle plugged in.

I enabled DEBUG in Makefile, and paste the full dmesg at the bottom, kernel no message at all after rtw_wdev_unregister.

[  367.595343] RTW: cfg80211_rtw_del_virtual_intf(wlan0) unregister ndev
[  367.595417] RTW: rtw_wdev_unregister(wdev=000000006816492c)

RTW88 rtl8822bu + AC53-Nano works well.

Is there anyway to find out what froze the network?

I also tried to follow modifications of other rtl drivers by the device vendor's github, all same behaviors.

lsusb

root@FriendlyWrt:~# lsusb 
Bus 003 Device 002: ID 0b05:1a62 Realtek 802.11ax WLAN Adapter
Bus 002 Device 001: ID 1d6b:0001 Linux 6.1.25 ohci_hcd Generic Platform OHCI controller
Bus 004 Device 001: ID 1d6b:0003 Linux 6.1.25 xhci-hcd xHCI Host Controller
Bus 001 Device 001: ID 1d6b:0002 Linux 6.1.25 ehci_hcd EHCI Host Controller
Bus 003 Device 001: ID 1d6b:0002 Linux 6.1.25 xhci-hcd xHCI Host Controller

no rfkill, no dkms


root@FriendlyWrt:~# iw dev; iw reg get
phy#0
    Interface wlan0
        ifindex 17
        wdev 0x1
        addr a0:36:bc:d7:af:85
        type managed
        channel 36 (5180 MHz), width: 20 MHz (no HT), center1: 5180 MHz
        txpower 12.00 dBm
global
country 00: DFS-UNSET
    (2402 - 2472 @ 40), (N/A, 20), (N/A)
    (2457 - 2482 @ 20), (N/A, 20), (N/A), AUTO-BW, PASSIVE-SCAN
    (2474 - 2494 @ 20), (N/A, 20), (N/A), NO-OFDM, PASSIVE-SCAN
    (5170 - 5250 @ 80), (N/A, 20), (N/A), AUTO-BW, PASSIVE-SCAN
    (5250 - 5330 @ 80), (N/A, 20), (0 ms), DFS, AUTO-BW, PASSIVE-SCAN
    (5490 - 5730 @ 160), (N/A, 20), (0 ms), DFS, PASSIVE-SCAN
    (5735 - 5835 @ 80), (N/A, 20), (N/A), PASSIVE-SCAN
    (57240 - 63720 @ 2160), (N/A, 0), (N/A)

phy#0 (self-managed)
country 99: DFS-UNSET
    (2402 - 2472 @ 40), (6, 20), (N/A), NO-80MHZ, NO-160MHZ
    (5170 - 5330 @ 160), (6, 20), (N/A)
    (5490 - 5590 @ 80), (6, 20), (N/A)
    (5650 - 5710 @ 40), (6, 20), (N/A)
    (5735 - 5835 @ 80), (6, 20), (N/A)

root@FriendlyWrt:~# 
root@FriendlyWrt:~# iw reg set US
root@FriendlyWrt:~# iw dev; iw reg get
phy#0
    Interface wlan0
        ifindex 17
        wdev 0x1
        addr a0:36:bc:d7:af:85
        type managed
        channel 36 (5180 MHz), width: 20 MHz (no HT), center1: 5180 MHz
        txpower 12.00 dBm
global
country US: DFS-FCC
    (2400 - 2472 @ 40), (N/A, 30), (N/A)
    (5150 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
    (5250 - 5350 @ 80), (N/A, 23), (0 ms), DFS, AUTO-BW
    (5470 - 5730 @ 160), (N/A, 23), (0 ms), DFS
    (5730 - 5850 @ 80), (N/A, 30), (N/A), AUTO-BW
    (5850 - 5895 @ 40), (N/A, 27), (N/A), NO-OUTDOOR, AUTO-BW, PASSIVE-SCAN
    (57240 - 71000 @ 2160), (N/A, 40), (N/A)

phy#0 (self-managed)
country US: DFS-UNSET
    (2402 - 2482 @ 40), (6, 20), (N/A), NO-80MHZ, NO-160MHZ
    (5170 - 5330 @ 160), (6, 20), (N/A)
    (5490 - 5730 @ 160), (6, 20), (N/A)
    (5735 - 5895 @ 160), (6, 20), (N/A)

root@FriendlyWrt:~# uci show wireless
wireless.radio0=wifi-device
wireless.radio0.type='mac80211'
wireless.radio0.path='platform/usbdrd3_0/fc000000.usb/xhci-hcd.7.auto/usb3/3-1/3-1:1.0'
wireless.radio0.band='5g'
wireless.radio0.cell_density='0'
wireless.radio0.channel='36'
wireless.radio0.htmode='HE20'
wireless.radio0.country='US'
wireless.default_radio0=wifi-iface
wireless.default_radio0.device='radio0'
wireless.default_radio0.network='lan'
wireless.default_radio0.mode='ap'
wireless.default_radio0.encryption='psk2'
wireless.default_radio0.ssid='AX55-Nano'
wireless.default_radio0.key='...'

iw list

root@FriendlyWrt:~# iw list
Wiphy phy0
    wiphy index: 0
    max # scan SSIDs: 9
    max scan IEs length: 2304 bytes
    max # sched scan SSIDs: 0
    max # match sets: 0
    Retry short limit: 7
    Retry long limit: 4
    Coverage class: 0 (up to 0m)
    Device supports AP-side u-APSD.
    Device supports T-DLS.
    Available Antennas: TX 0 RX 0
    Supported interface modes:
         * IBSS
         * managed
         * AP
         * monitor
         * P2P-client
         * P2P-GO
    Band 1:
        Capabilities: 0x19e3
            RX LDPC
            HT20/HT40
            Static SM Power Save
            RX HT20 SGI
            RX HT40 SGI
            TX STBC
            RX STBC 1-stream
            Max AMSDU length: 7935 bytes
            DSSS/CCK HT40
        Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
        Minimum RX AMPDU time spacing: 16 usec (0x07)
        HT Max RX data rate: 300 Mbps
        HT TX/RX MCS rate indexes supported: 0-15
        HE Iftypes: AP
            HE MAC Capabilities (0x0001120a0060):
                +HTC HE Supported
                All Ack
                BSR
                OM Control
                Maximum A-MPDU Length Exponent: 2
                OPS
                A-MSDU in A-MPDU
            HE PHY Capabilities: (0x02701a580dc0270e91b900):
                HE40/2.4GHz
                Device Class: 1
                LDPC Coding in Payload
                HE SU PPDU with 1x HE-LTF and 0.8us GI
                NDP with 4x HE-LTF and 3.2us GI
                STBC Rx <= 80MHz
                Doppler Tx
                DCM Max Constellation Rx: 3
                Rx HE MU PPDU from Non-AP STA
                SU Beamformee
                Beamformee STS <= 80Mhz: 3
                Ng = 16 SU Feedback
                Ng = 16 MU Feedback
                Codebook Size SU Feedback
                Codebook Size MU Feedback
                Triggered SU Beamforming Feedback
                Partial Bandwidth Extended Range
                Power Boost Factor ar
                HE SU PPDU & HE PPDU 4x HE-LTF 0.8us GI
                Max NC: 1
                HE ER SU PPDU 4x HE-LTF 0.8us GI
                HE ER SU PPDU 1x HE-LTF 0.8us GI
                DCM Max BW: 2
                Longer Than 16HE SIG-B OFDM Symbols
                RX 1024-QAM
                RX Full BW SU Using HE MU PPDU with Compression SIGB
                RX Full BW SU Using HE MU PPDU with Non-Compression SIGB
            HE RX MCS and NSS set <= 80 MHz
                1 streams: MCS 0-11
                2 streams: MCS 0-11
                3 streams: not supported
                4 streams: not supported
                5 streams: not supported
                6 streams: not supported
                7 streams: not supported
                8 streams: not supported
            HE TX MCS and NSS set <= 80 MHz
                1 streams: MCS 0-11
                2 streams: MCS 0-11
                3 streams: not supported
                4 streams: not supported
                5 streams: not supported
                6 streams: not supported
                7 streams: not supported
                8 streams: not supported
        HE Iftypes: managed
            HE MAC Capabilities (0x0801120a8060):
                +HTC HE Supported
                Trigger Frame MAC Padding Duration: 2
                All Ack
                BSR
                OM Control
                Maximum A-MPDU Length Exponent: 2
                OPS
                A-MSDU in A-MPDU
            HE PHY Capabilities: (0x02701a1f0d00270e91bd00):
                HE40/2.4GHz
                Device Class: 1
                LDPC Coding in Payload
                HE SU PPDU with 1x HE-LTF and 0.8us GI
                NDP with 4x HE-LTF and 3.2us GI
                STBC Rx <= 80MHz
                Doppler Tx
                DCM Max Constellation: 3
                DCM Max NSS Tx: 1
                DCM Max Constellation Rx: 3
                SU Beamformee
                Beamformee STS <= 80Mhz: 3
                Codebook Size SU Feedback
                Codebook Size MU Feedback
                Triggered SU Beamforming Feedback
                Partial Bandwidth Extended Range
                Power Boost Factor ar
                HE SU PPDU & HE PPDU 4x HE-LTF 0.8us GI
                Max NC: 1
                HE ER SU PPDU 4x HE-LTF 0.8us GI
                HE ER SU PPDU 1x HE-LTF 0.8us GI
                DCM Max BW: 2
                Longer Than 16HE SIG-B OFDM Symbols
                TX 1024-QAM
                RX 1024-QAM
                RX Full BW SU Using HE MU PPDU with Compression SIGB
                RX Full BW SU Using HE MU PPDU with Non-Compression SIGB
            HE RX MCS and NSS set <= 80 MHz
                1 streams: MCS 0-11
                2 streams: MCS 0-11
                3 streams: not supported
                4 streams: not supported
                5 streams: not supported
                6 streams: not supported
                7 streams: not supported
                8 streams: not supported
            HE TX MCS and NSS set <= 80 MHz
                1 streams: MCS 0-11
                2 streams: MCS 0-11
                3 streams: not supported
                4 streams: not supported
                5 streams: not supported
                6 streams: not supported
                7 streams: not supported
                8 streams: not supported
        Frequencies:
            * 2412 MHz [1] (20.0 dBm)
            * 2417 MHz [2] (20.0 dBm)
            * 2422 MHz [3] (20.0 dBm)
            * 2427 MHz [4] (20.0 dBm)
            * 2432 MHz [5] (20.0 dBm)
            * 2437 MHz [6] (20.0 dBm)
            * 2442 MHz [7] (20.0 dBm)
            * 2447 MHz [8] (20.0 dBm)
            * 2452 MHz [9] (20.0 dBm)
            * 2457 MHz [10] (20.0 dBm)
            * 2462 MHz [11] (20.0 dBm)
            * 2467 MHz [12] (disabled)
            * 2472 MHz [13] (disabled)
            * 2484 MHz [14] (disabled)
    Band 2:
        Capabilities: 0x19e3
            RX LDPC
            HT20/HT40
            Static SM Power Save
            RX HT20 SGI
            RX HT40 SGI
            TX STBC
            RX STBC 1-stream
            Max AMSDU length: 7935 bytes
            DSSS/CCK HT40
        Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
        Minimum RX AMPDU time spacing: 16 usec (0x07)
        HT Max RX data rate: 300 Mbps
        HT TX/RX MCS rate indexes supported: 0-15
        VHT Capabilities (0x03c011b1):
            Max MPDU length: 7991
            Supported Channel Width: neither 160 nor 80+80
            RX LDPC
            short GI (80 MHz)
            TX STBC
            SU Beamformee
            +HTC-VHT
        VHT RX MCS set:
            1 streams: MCS 0-9
            2 streams: MCS 0-9
            3 streams: not supported
            4 streams: not supported
            5 streams: not supported
            6 streams: not supported
            7 streams: not supported
            8 streams: not supported
        VHT RX highest supported: 867 Mbps
        VHT TX MCS set:
            1 streams: MCS 0-9
            2 streams: MCS 0-9
            3 streams: not supported
            4 streams: not supported
            5 streams: not supported
            6 streams: not supported
            7 streams: not supported
            8 streams: not supported
        VHT TX highest supported: 867 Mbps
        HE Iftypes: AP
            HE MAC Capabilities (0x0001120a0060):
                +HTC HE Supported
                All Ack
                BSR
                OM Control
                Maximum A-MPDU Length Exponent: 2
                OPS
                A-MSDU in A-MPDU
            HE PHY Capabilities: (0x04701a580dc0270e91b900):
                HE40/HE80/5GHz
                Device Class: 1
                LDPC Coding in Payload
                HE SU PPDU with 1x HE-LTF and 0.8us GI
                NDP with 4x HE-LTF and 3.2us GI
                STBC Rx <= 80MHz
                Doppler Tx
                DCM Max Constellation Rx: 3
                Rx HE MU PPDU from Non-AP STA
                SU Beamformee
                Beamformee STS <= 80Mhz: 3
                Ng = 16 SU Feedback
                Ng = 16 MU Feedback
                Codebook Size SU Feedback
                Codebook Size MU Feedback
                Triggered SU Beamforming Feedback
                Partial Bandwidth Extended Range
                Power Boost Factor ar
                HE SU PPDU & HE PPDU 4x HE-LTF 0.8us GI
                Max NC: 1
                HE ER SU PPDU 4x HE-LTF 0.8us GI
                HE ER SU PPDU 1x HE-LTF 0.8us GI
                DCM Max BW: 2
                Longer Than 16HE SIG-B OFDM Symbols
                RX 1024-QAM
                RX Full BW SU Using HE MU PPDU with Compression SIGB
                RX Full BW SU Using HE MU PPDU with Non-Compression SIGB
            HE RX MCS and NSS set <= 80 MHz
                1 streams: MCS 0-11
                2 streams: MCS 0-11
                3 streams: not supported
                4 streams: not supported
                5 streams: not supported
                6 streams: not supported
                7 streams: not supported
                8 streams: not supported
            HE TX MCS and NSS set <= 80 MHz
                1 streams: MCS 0-11
                2 streams: MCS 0-11
                3 streams: not supported
                4 streams: not supported
                5 streams: not supported
                6 streams: not supported
                7 streams: not supported
                8 streams: not supported
        HE Iftypes: managed
            HE MAC Capabilities (0x0801120a8060):
                +HTC HE Supported
                Trigger Frame MAC Padding Duration: 2
                All Ack
                BSR
                OM Control
                Maximum A-MPDU Length Exponent: 2
                OPS
                A-MSDU in A-MPDU
            HE PHY Capabilities: (0x04701a1f0d00270e91bd00):
                HE40/HE80/5GHz
                Device Class: 1
                LDPC Coding in Payload
                HE SU PPDU with 1x HE-LTF and 0.8us GI
                NDP with 4x HE-LTF and 3.2us GI
                STBC Rx <= 80MHz
                Doppler Tx
                DCM Max Constellation: 3
                DCM Max NSS Tx: 1
                DCM Max Constellation Rx: 3
                SU Beamformee
                Beamformee STS <= 80Mhz: 3
                Codebook Size SU Feedback
                Codebook Size MU Feedback
                Triggered SU Beamforming Feedback
                Partial Bandwidth Extended Range
                Power Boost Factor ar
                HE SU PPDU & HE PPDU 4x HE-LTF 0.8us GI
                Max NC: 1
                HE ER SU PPDU 4x HE-LTF 0.8us GI
                HE ER SU PPDU 1x HE-LTF 0.8us GI
                DCM Max BW: 2
                Longer Than 16HE SIG-B OFDM Symbols
                TX 1024-QAM
                RX 1024-QAM
                RX Full BW SU Using HE MU PPDU with Compression SIGB
                RX Full BW SU Using HE MU PPDU with Non-Compression SIGB
            HE RX MCS and NSS set <= 80 MHz
                1 streams: MCS 0-11
                2 streams: MCS 0-11
                3 streams: not supported
                4 streams: not supported
                5 streams: not supported
                6 streams: not supported
                7 streams: not supported
                8 streams: not supported
            HE TX MCS and NSS set <= 80 MHz
                1 streams: MCS 0-11
                2 streams: MCS 0-11
                3 streams: not supported
                4 streams: not supported
                5 streams: not supported
                6 streams: not supported
                7 streams: not supported
                8 streams: not supported
        Frequencies:
            * 5180 MHz [36] (20.0 dBm)
            * 5200 MHz [40] (20.0 dBm)
            * 5220 MHz [44] (20.0 dBm)
            * 5240 MHz [48] (20.0 dBm)
            * 5260 MHz [52] (20.0 dBm)
            * 5280 MHz [56] (20.0 dBm)
            * 5300 MHz [60] (20.0 dBm)
            * 5320 MHz [64] (20.0 dBm)
            * 5500 MHz [100] (20.0 dBm)
            * 5520 MHz [104] (20.0 dBm)
            * 5540 MHz [108] (20.0 dBm)
            * 5560 MHz [112] (20.0 dBm)
            * 5580 MHz [116] (20.0 dBm)
            * 5600 MHz [120] (disabled)
            * 5620 MHz [124] (disabled)
            * 5640 MHz [128] (disabled)
            * 5660 MHz [132] (20.0 dBm)
            * 5680 MHz [136] (20.0 dBm)
            * 5700 MHz [140] (20.0 dBm)
            * 5720 MHz [144] (disabled)
            * 5745 MHz [149] (20.0 dBm)
            * 5765 MHz [153] (20.0 dBm)
            * 5785 MHz [157] (20.0 dBm)
            * 5805 MHz [161] (20.0 dBm)
            * 5825 MHz [165] (20.0 dBm)
            * 5845 MHz [169] (disabled)
            * 5865 MHz [173] (disabled)
            * 5885 MHz [177] (disabled)
    interface combinations are not supported
    max # scan plans: 1
    max scan plan interval: -1
    max scan plan iterations: 0
    Supported extended features:

Default dmesg

[   23.622942] platform mtd_vendor_storage: deferred probe pending
[  104.952369] usb 3-1: new high-speed USB device number 2 using xhci-hcd
[  105.132948] usb 3-1: New USB device found, idVendor=0b05, idProduct=1a62, bcdDevice= 0.00
[  105.133000] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  105.133025] usb 3-1: Product: 802.11ax WLAN Adapter
[  105.133048] usb 3-1: Manufacturer: Realtek
[  105.133069] usb 3-1: SerialNumber: 00e04c000001
[  105.526915] eric-tx CALL alloc_txring !!!!

dmesg with CONFIG_RTW_DEBUG on and log level = 5

[   86.211070] usbcore: deregistering interface driver rtl8852bu
[   88.052164] RTW: module init start
[   88.052198] RTW: rtl8852bu v1.19.3-45-g7583a804a.20230505
[   88.052254] RTW: rtw_inetaddr_notifier_register
[   88.052354] usbcore: registered new interface driver rtl8852bu
[   88.052364] RTW: module init ret=0
[   99.292842] usb 3-1: new high-speed USB device number 2 using xhci-hcd
[   99.473414] usb 3-1: New USB device found, idVendor=0b05, idProduct=1a62, bcdDevice= 0.00
[   99.473469] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   99.473494] usb 3-1: Product: 802.11ax WLAN Adapter
[   99.473516] usb 3-1: Manufacturer: Realtek
[   99.473537] usb 3-1: SerialNumber: 00e04c000001
[   99.477244] RTW: +rtw_dev_probe
[   99.477290] RTW: 
[   99.477290] usb_endpoint_descriptor(0):
[   99.477310] RTW: bLength=7
[   99.477326] RTW: bDescriptorType=5
[   99.477342] RTW: bEndpointAddress=84
[   99.477359] RTW: wMaxPacketSize=512
[   99.477376] RTW: bInterval=0
[   99.477392] RTW: RT_usb_endpoint_is_bulk_in = 4
[   99.477410] RTW: USB EP MAX_PKT_SZ:512-512
[   99.477427] RTW: USB#0 bulkin size:512
[   99.477434] RTW: 
[   99.477434] usb_endpoint_descriptor(1):
[   99.477460] RTW: bLength=7
[   99.477474] RTW: bDescriptorType=5
[   99.477489] RTW: bEndpointAddress=5
[   99.477504] RTW: wMaxPacketSize=512
[   99.477520] RTW: bInterval=0
[   99.477535] RTW: RT_usb_endpoint_is_bulk_out = 5
[   99.477550] RTW: USB EP MAX_PKT_SZ:512-512
[   99.477567] RTW: USB#0 bulkout size:512
[   99.477574] RTW: 
[   99.477574] usb_endpoint_descriptor(2):
[   99.477599] RTW: bLength=7
[   99.477614] RTW: bDescriptorType=5
[   99.477628] RTW: bEndpointAddress=6
[   99.477643] RTW: wMaxPacketSize=512
[   99.477658] RTW: bInterval=0
[   99.477673] RTW: RT_usb_endpoint_is_bulk_out = 6
[   99.477689] RTW: USB EP MAX_PKT_SZ:512-512
[   99.477705] RTW: USB#1 bulkout size:512
[   99.477712] RTW: 
[   99.477712] usb_endpoint_descriptor(3):
[   99.477737] RTW: bLength=7
[   99.477752] RTW: bDescriptorType=5
[   99.477767] RTW: bEndpointAddress=7
[   99.477782] RTW: wMaxPacketSize=512
[   99.477797] RTW: bInterval=0
[   99.477812] RTW: RT_usb_endpoint_is_bulk_out = 7
[   99.477827] RTW: USB EP MAX_PKT_SZ:512-512
[   99.477844] RTW: USB#2 bulkout size:512
[   99.477851] RTW: 
[   99.477851] usb_endpoint_descriptor(4):
[   99.477876] RTW: bLength=7
[   99.477892] RTW: bDescriptorType=5
[   99.477908] RTW: bEndpointAddress=9
[   99.477924] RTW: wMaxPacketSize=512
[   99.477940] RTW: bInterval=0
[   99.477955] RTW: RT_usb_endpoint_is_bulk_out = 9
[   99.477972] RTW: USB EP MAX_PKT_SZ:512-512
[   99.477991] RTW: USB#3 bulkout size:512
[   99.477998] RTW: 
[   99.477998] usb_endpoint_descriptor(5):
[   99.478024] RTW: bLength=7
[   99.478039] RTW: bDescriptorType=5
[   99.478054] RTW: bEndpointAddress=a
[   99.478070] RTW: wMaxPacketSize=512
[   99.478086] RTW: bInterval=0
[   99.478101] RTW: RT_usb_endpoint_is_bulk_out = a
[   99.478118] RTW: USB EP MAX_PKT_SZ:512-512
[   99.478135] RTW: USB#4 bulkout size:512
[   99.478142] RTW: 
[   99.478142] usb_endpoint_descriptor(6):
[   99.478167] RTW: bLength=7
[   99.478183] RTW: bDescriptorType=5
[   99.478197] RTW: bEndpointAddress=b
[   99.478213] RTW: wMaxPacketSize=512
[   99.478230] RTW: bInterval=0
[   99.478244] RTW: RT_usb_endpoint_is_bulk_out = b
[   99.478259] RTW: USB EP MAX_PKT_SZ:512-512
[   99.478275] RTW: USB#5 bulkout size:512
[   99.478282] RTW: 
[   99.478282] usb_endpoint_descriptor(7):
[   99.478308] RTW: bLength=7
[   99.478323] RTW: bDescriptorType=5
[   99.478338] RTW: bEndpointAddress=c
[   99.478355] RTW: wMaxPacketSize=512
[   99.478371] RTW: bInterval=0
[   99.478386] RTW: RT_usb_endpoint_is_bulk_out = c
[   99.478403] RTW: USB EP MAX_PKT_SZ:512-512
[   99.478419] RTW: USB#6 bulkout size:512
[   99.478428] RTW: nr_endpoint=8, in_num=1, out_num=7
[   99.478428] 
[   99.478456] RTW: USB_SPEED_HIGH
[   99.478874] PHL: _update_cntry_prop_5g_bp, prop of (CN) = 0x07.
[   99.478904] PHL: _update_cntry_prop_5g_bp, prop of (IL) = 0x0F.
[   99.479372] PHL: [MAC] MAC_AX_MAJOR_VER = 0
[   99.479372] MAC_AX_PROTOTYPE_VER = 29
[   99.479372] MAC_AX_SUB_VER = 32
[   99.479372] MAC_AX_SUB_INDEX = 2
[   99.480429] PHL: rtw_hal_mac_get_log_efuse_size: Logical efuse size = 2064!
[   99.480469] PHL: rtw_hal_mac_get_log_efuse_size: Logical efuse size = 1296!
[   99.480490] PHL: rtw_hal_mac_get_efuse_a_die_size: Efuse a die size = 16!
[   99.480511] PHL: rtw_hal_mac_get_efuse_mask_size: efuse mask size = 129
[   99.480538] PHL: rtw_hal_mac_get_efuse_mask_size: efuse mask size = 81
[   99.480577] PHL: rtw_hal_mac_get_log_efuse_bt_size: BT Efuse log size = 1024!
[   99.480605] PHL: rtw_hal_mac_get_efuse_bt_mask_size: bt efuse mask size = 64
[   99.480994] PHL: [BTC], hal_btc_init(): Init 8852B!!
[   99.481037] PHL: hal_hci_cfg_8852bu ===>
[   99.481056] PHL: USB_SPEED_HIGH
[   99.481074] PHL: Bulk-Out size - 512
[   99.481091] PHL: Bulk-Out Number - 7
[   99.481108] PHL: Bulk-In Number - 1
[   99.481128] PHL: [MAC-INFO]- CV : 1
[   99.481146] PHL: [MAC-INFO]- ACV : 1
[   99.481163] PHL: [MAC-INFO]- tx_ch_num: 19
[   99.481180] PHL: [MAC-INFO]- tx_data_ch_num: 10
[   99.481198] PHL: [MAC-INFO]- wd_body_len: 24
[   99.481214] PHL: [MAC-INFO]- wd_info_len: 24
[   99.481231] PHL: [MAC-INFO]- pwr_seq_ver: 20
[   99.481247] PHL: [MAC-INFO]- fifo_size: 196608
[   99.481263] PHL: [MAC-INFO]- macid_num: 32
[   99.481280] PHL: [MAC-INFO]- wl_efuse_size: 1536
[   99.481296] PHL: [MAC-INFO]- efuse_size: 1216
[   99.481312] PHL: [MAC-INFO]- log_efuse_size: 2048
[   99.481329] PHL: [MAC-INFO]- bt_efuse_size: 512
[   99.481344] PHL: [MAC-INFO]- sec_ctrl_efuse_size: 4
[   99.481360] PHL: [MAC-INFO]- sec_data_efuse_size: 192
[   99.481434] PHL: ERROR phl_mr_ctrl_init mcc init fail
[   99.481465] PHL: phl_msg_hub_init
[   99.481535] PHL: [TM]: phl_test_module_init
[   99.481581] PHL: _dispr_ctrl_init(): 
[   99.481628] PHL: _phl_ser_mdl_init:: cser->evtsrc = 2
[   99.481653] PHL: [PS_CMD], phl_register_ps_module(): 
[   99.481680] PHL: [PS_CMD], _ps_mdl_init(): 
[   99.481714] PHL: [PS_CMD], _ps_common_info_init(): 
[   99.481734] PHL: [BTCCMD], phl_register_btc_module(): 
[   99.481761] PHL: [BTCCMD], _btc_cmd_init(): 
[   99.481841] PHL: --> _phl_snd_cmd_module_init
[   99.481877] PHL: phl_macid_ctrl_init macid max_num:32
[   99.484549] PHL: [PSTA] ###### FUN - phl_stainfo_ctrl_init LINE - 909 #######
[   99.484582] PHL: [PSTA] PHL_MAX_STA_NUM:128
[   99.484600] PHL: [PSTA] sta_ctrl - q_cnt :128
[   99.484617] PHL: #################################
[   99.863370] RTW: RFE Type: 1
[   99.863747] eric-tx CALL alloc_txring !!!!
[   99.863767] RTW: eric-tx [alloc_txring] alloc_sz = 562, alloc_sz_txreq = 24576
[   99.864170] RTW: rtw_cmd_ap_add_del_sta_req_init((null)): 
[   99.864198] RTW: can't get autopm:
[   99.864217] RTW: rtw_macaddr_cfg mac addr:a0:36:bc:d7:af:85
[   99.864233] RTW: bDriverStopped:False, bSurpriseRemoved:False, netif_up:0, hw_init_completed:0
[   99.864254] RTW: init_link_mlme_default_rate_set: support CCK
[   99.864265] RTW: init_link_mlme_default_rate_set: support OFDM
[   99.864279] RTW: WARN rtw_rfctl_dfs_init DFS region domain: NONE is not supported by HAL, set to NONE
[   99.864329] RTW: devobj_decide_init_chplan chplan:0x34
[   99.864341] RTW: devobj_decide_init_chplan chplan_6g:0x00
[   99.864351] RTW: devobj_decide_init_chplan disable_sw_chplan:0
[   99.864365] RTW: rtw_rfctl_decide_init_chplan chplan:0x34
[   99.864385] RTW: rtw_chset_apply_from_rtk_priv chplan:0x34 chplan_6g:0x00
[   99.864415] RTW: rtw_rfctl_chset_apply_regulatory ch num:32
[   99.864540] RTW: rtw_cfg80211_init_wiphy_band:rf_type=2
[   99.864560] RTW: [HT] HAL Support LDPC = 0x03
[   99.864569] RTW: [HT] HAL Support STBC = 0x03
[   99.864584] RTW: NDP_4x32 is set.
[   99.864597] RTW: NDP_4x32 is set.
[   99.864609] RTW: [HT] HAL Support LDPC = 0x03
[   99.864618] RTW: [HT] HAL Support STBC = 0x03
[   99.864627] RTW: [VHT] Support LDPC = 0x03
[   99.864637] RTW: [VHT] Support STBC = 0x03
[   99.864646] RTW: [VHT] Support Beamformee
[   99.864657] RTW: [VHT] Declare supporting RX LDPC
[   99.864665] RTW: [VHT] Declare supporting SGI 80MHz
[   99.864672] RTW: [VHT] Declare supporting TX STBC
[   99.864681] RTW: [VHT] Declare supporting RX STBC = 1
[   99.864689] RTW: [VHT] Declare supporting SU Beamformee
[   99.864696] RTW: [VHT] Declare supporting VHT variant HT Control
[   99.864704] RTW: [VHT] Declare supporting RX A-MPDU Length Exponent = 7
[   99.864716] RTW: NDP_4x32 is set.
[   99.864726] RTW: NDP_4x32 is set.
[   99.864737] RTW: rtw_wiphy_alloc(phy0)
[   99.864775] RTW: rtw_wdev_alloc(padapter=00000000f284caa9)
[   99.864791] RTW: rtw_wiphy_register(phy0)
[   99.864800] RTW: Register RTW cfg80211 vendor cmd(0x67) interface
[   99.865178] RTW: add rule_00(2.4G, 2412, 2462, 0x0)
[   99.865199] RTW: add rule_01(5G, 5180, 5320, 0x0)
[   99.865211] RTW: add rule_02(5G, 5500, 5580, 0x0)
[   99.865222] RTW: add rule_03(5G, 5660, 5700, 0x0)
[   99.865234] RTW: add rule_04(5G, 5745, 5825, 0x0)
[   99.865330] RTW: rtw_ndev_init(wlan0) if1 mac_addr=a0:36:bc:d7:af:85
[   99.865600] RTW: rtw_ndev_notifier_call(wlan0) state:17 -  
[   99.866268] RTW: cfg80211_rtw_get_txpower
[   99.866295] RTW: rtw_ndev_notifier_call(wlan0) state:5 -  
[   99.866569] RTW: [HW-CAP] ic_name:rtl8852b
[   99.866585] RTW: [HW-CAP] macid_num:32
[   99.866595] RTW: [HW-CAP] sec_cap:0x01
[   99.866604] RTW: [HW-CAP] sec_cam_ent_num:0
[   99.866614] RTW: [HW-CAP] rfpath_num_2g:2
[   99.866623] RTW: [HW-CAP] rfpath_num_5g:2
[   99.866631] RTW: [HW-CAP] rf_reg_path_num:2
[   99.866640] RTW: [HW-CAP] max_tx_cnt:2
[   99.866648] RTW: [HW-CAP] band_cap:2G 5G 
[   99.866666] RTW: [HW-CAP] bw_cap:20M 40M 80M 
[   99.866684] RTW: [HW-CAP] proto_cap:b g n ac 
[   99.866703] RTW: [HW-CAP] wl_func:P2P MIRACAST TDLS 
[   99.866721] RTW: -rtw_dev_probe success
[  120.589610] RTW: rtw_reg_notifier(phy0)
[  120.589649] RTW: initiator:USER, wiphy_idx:-1, type:USER
[  120.589665] RTW: alpha2:US
[  120.589676] RTW: dfs_region:UNSET
[  120.589686] RTW: intersect:0
[  120.589697] RTW: processed:0
[  120.589706] RTW: country_ie_env:ANY
[  120.589721] RTW: rtw_set_country_cmd country_code:"US"
[  120.589749] RTW: rtw_set_chplan_hdl iface_id:0 src:RTK_PRIV inr:USER alpha2:US
[  120.589786] RTW: default domain:0x1b applied, txpwr_lmt:?FCC
[  120.589801] RTW: world wide applied, txpwr_lmt:WW
[  120.590554] RTW: rtw_chset_apply_from_rtk_priv chplan:0x1B chplan_6g:0x00
[  120.590595] RTW: rtw_rfctl_chset_apply_regulatory ch num:41
[  120.590761] RTW: add rule_00(2.4G, 2412, 2472, 0x0)
[  120.590781] RTW: add rule_01(5G, 5180, 5320, 0x0)
[  120.590796] RTW: add rule_02(5G, 5500, 5720, 0x0)
[  120.590810] RTW: add rule_03(5G, 5745, 5885, 0x0)
[  126.563493] RTW: cfg80211_rtw_get_txpower
[  190.754172] RTW: cfg80211_rtw_get_txpower
[  248.137833] RTW: rtw_reg_notifier(phy0)
[  248.137872] RTW: initiator:USER, wiphy_idx:-1, type:USER
[  248.137888] RTW: alpha2:US
[  248.137899] RTW: dfs_region:UNSET
[  248.137910] RTW: intersect:0
[  248.137920] RTW: processed:0
[  248.137930] RTW: country_ie_env:ANY
[  248.137946] RTW: rtw_set_country_cmd country_code:"US"
[  248.137973] RTW: rtw_set_chplan_hdl iface_id:0 src:RTK_PRIV inr:USER alpha2:US
[  258.547323] RTW: cfg80211_rtw_get_txpower
[  266.981038] RTW: cfg80211_rtw_get_txpower
[  271.162654] RTW: cfg80211_rtw_get_txpower
[  277.352934] RTW: cfg80211_rtw_set_power_mgmt(wlan0) enabled:0, timeout:-1
[  278.841777] RTW: cfg80211_rtw_get_txpower
[  303.463965] RTW: cfg80211_rtw_set_txpower
[  304.751807] RTW: cfg80211_rtw_set_txpower
[  307.646164] RTW: cfg80211_rtw_get_txpower
[  313.568816] RTW: cfg80211_rtw_set_txpower
[  314.878533] RTW: cfg80211_rtw_get_txpower
[  340.120597] RTW: cfg80211_rtw_get_txpower
[  340.123803] RTW: cfg80211_rtw_get_txpower
[  340.128336] RTW: cfg80211_rtw_get_txpower
[  340.246744] RTW: cfg80211_rtw_get_txpower
[  340.249889] RTW: cfg80211_rtw_get_txpower
[  340.253249] RTW: cfg80211_rtw_get_txpower
[  342.229414] RTW: cfg80211_rtw_get_txpower
[  342.235895] RTW: cfg80211_rtw_get_txpower
[  342.238153] RTW: cfg80211_rtw_get_txpower
[  345.258486] RTW: cfg80211_rtw_get_txpower
[  345.261730] RTW: cfg80211_rtw_get_txpower
[  345.265088] RTW: cfg80211_rtw_get_txpower
[  349.479526] RTW: cfg80211_rtw_get_txpower
[  349.485949] RTW: cfg80211_rtw_get_txpower
[  349.488028] RTW: cfg80211_rtw_get_txpower
[  350.267923] RTW: cfg80211_rtw_get_txpower
[  350.270800] RTW: cfg80211_rtw_get_txpower
[  350.274010] RTW: cfg80211_rtw_get_txpower
[  353.952586] RTW: cfg80211_rtw_get_txpower
[  353.955415] RTW: cfg80211_rtw_get_txpower
[  353.958598] RTW: cfg80211_rtw_get_txpower
[  355.195084] RTW: cfg80211_rtw_get_txpower
[  355.200390] RTW: cfg80211_rtw_get_txpower
[  355.202377] RTW: cfg80211_rtw_get_txpower
[  358.801132] RTW: cfg80211_rtw_get_txpower
[  358.806365] RTW: cfg80211_rtw_get_txpower
[  358.812366] RTW: cfg80211_rtw_get_txpower
[  363.821988] RTW: cfg80211_rtw_get_txpower
[  363.827229] RTW: cfg80211_rtw_get_txpower
[  363.833225] RTW: cfg80211_rtw_get_txpower
[  364.532522] RTW: cfg80211_rtw_get_txpower
[  364.540715] RTW: cfg80211_rtw_get_txpower
[  364.544557] RTW: cfg80211_rtw_get_txpower
[  367.595343] RTW: cfg80211_rtw_del_virtual_intf(wlan0) unregister ndev
[  367.595417] RTW: rtw_wdev_unregister(wdev=000000006816492c)
morrownr commented 8 months ago

Hi @sskaje

I've been looking over the information you posted. You aren't going to like what I am going say but please try to understand. From the README:

Note: OpenWRT is not supported. OpenWRT provides drivers for USB WiFi adapters. OpenWRT provided drivers include support for the MT7921au (AXE3000), MT7612u (AC1200), MT7610u (AC600) chipsets. It is a challenge to use Realtek based adapters that use out-of-kernel drivers with OpenWRT so it is strongly advised to use the already supported chipsets.

Words of advice: You will hurt yourself trying to make this work but that is unnecessary given the usb wifi drivers that are already provided in OpenWRT. Recommend you go to the site Main Menu:

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

Reading menu item 1 is a good idea. Then open menu item 2 as it contains a lot of adapters that work in OpenWRT. I use adapters with mt7921au, mt7612u and my7610u. Use Luci to update Software and search with mt7.

Hope this helps,

@morrownr

sskaje commented 8 months ago

Hi @morrownr , thank you for your reply and also the "site Main Menu" repo.

You're right, realtek's official drivers are not reliable (including rtw88), some chip+driver works everywhere, some works only on popular linux + arch, or some device + certain config.

This nanopi has debian/ubuntu with same kernel from vendor, also hang, that's why I start an issue and ask if there is anything I can do to find out what causes the kernel or network related modules hang, maybe kernel misconfigured, etc.

I choose AX55 nano because it is small enough, like logitech's mouse/keyboard dongle, I can always leave it plugged in the small ARM device, not as wireless router but make my nanopi can be connected when I forgot to bring a ethernet adapter.

And also thank you for your recommendation, I did look up some MTK's alternatives, if I want to make my nanopi as wireless router, MT7921au devices are better choices.

morrownr commented 8 months ago

This nanopi has debian/ubuntu with same kernel from vendor, also hang, that's why I start an issue and ask if there is anything I can do to find out what causes the kernel or network related modules hang, maybe kernel misconfigured, etc.

Finding the cause could be a challenge. Fixing it, if it is found, could be a real challenge as well. I did the best I could with this Realtek source but while working on it, I knew I needed to warn users that there are better alternatives out there. These Realtek out-of-kernel drivers are simply not made for desktop, server and even sbc use. They seem to be made for embedded systems and getting help from Realtek is not something that is available unless you are an adapter maker.

On the other hand, Mediatek appears to be all in with Linux wifi. Their drivers are Linux WiFi Standards compilant and we have the ability to communicate problems to the Mediatek kernel devs so as to get problems fixed, Kernel 6.7 will see a new MT7925 driver for a new WiFi 7 chipset that will be available for USB and PCIe. Hopefully we see the chipset made available to makers in 2024 and we will see adapters in late 2024 or early 2025. Note how the driver is going in long before we can buy an adapter. This is similar to Intel, AMD and other power players in the Linux world. The difference between Mediatek and Realtek Linux support for USB WiFi is huge.

I wish you luck if you decide to continue getting your adapter working but I'll need you to narrow down what the problem likely is before I can take a crack at it as I am very busy on other projects right now.

@morrownr

sskaje commented 8 months ago

@morrownr Thank you, I think I should try MTK devices instead of wasting time on realtek.

morrownr commented 8 months ago

Do you need help checking to see what drivers are in the kernel of FriendlyWRT? I am not familiar with it but it might a good idea to check before you get a new adapter.

OpenWRT has drivers and firmware for several adapters including the following: mt7921au, mt7612u and mt7610u. With OpenWRT, you have to install the packages for the drivers. I so not know how FWRT works?

sskaje commented 8 months ago

@morrownr , Thank you, I can do it by myself, and I have experiences porting latest rtw88 to get rtl8822bu work.

The kernel driver for mt76 are here, I see mt7921 code with usb is included.

https://github.com/friendlyarm/kernel-rockchip/tree/nanopi6-v6.1.y/drivers/net/wireless/mediatek/mt76

morrownr commented 8 months ago

Remember that in-kernel drivers require one or more firmware files:

https://github.com/morrownr/USB-WiFi/blob/main/home/How_to_Install_Firmware_for_Mediatek_based_USB_WiFi_adapters.md

Don't forget to check them.

sskaje commented 8 months ago

Remember that in-kernel drivers require one or more firmware files:

https://github.com/morrownr/USB-WiFi/blob/main/home/How_to_Install_Firmware_for_Mediatek_based_USB_WiFi_adapters.md

Don't forget to check them.

Thank you, your guide helped me again on MT7922

morrownr commented 8 months ago

You are welcome. I have a PCIe card based on the mt7922 I really like it and I thought I saw signs of a usb version of the mt7922 would be made available but am not so sure now with the mt7925 driver going into kernel 6.7 as we speak. The mt7925 WILL have a usb version per the patches adding the new driver to the kernel. It is a WiFi 7 capable chipset. Hopefully we have adapters available for purchase at some point in 2024.