openwrt / mt76

mac80211 driver for MediaTek MT76x0e, MT76x2e, MT7603, MT7615, MT7628 and MT7688
737 stars 341 forks source link

MT7922 Unable to Start in AP Mode with Encryption #775

Open dellagd opened 1 year ago

dellagd commented 1 year ago

Attempting to use a MT7922 M.2 card (picture below) to stand up an access point in 6G band, which the iw info for the device claims to support. As I understand it, the MT7916 is more targeted at access point use, but I could only find one mPCIe device from AsiaRF with that chipset, not in an M.2 form factor. The system I am hoping to put this device in only has an M.2 slot and USB ports, so the mPCIe option is both more expensive and doesn't even fit. Hoping to make the MT7922 option work as I don't need particularly fancy AP features, I just need it to be in the 6G band.

I am running on linux kernel 6.1.26 using the latest mt76 (https://github.com/openwrt/mt76/commit/cddbd796bbc649debe457f7b34b200bbda4fcc53)

image

Relevant dmesg output. The system boots fine, and at 890 seconds I attempt to enable the AP, which proceeds to hang the luci web interface, though I can still interact with the device over the command line. The looping of chip reset and timeouts continues indefinitely (log cut short here).

[   14.335064] mt7921e 0000:01:00.0: enabling device (0000 -> 0002)
[   14.351616] mt7921e 0000:01:00.0: ASIC revision: 79220010
[   14.433931] mt7921e 0000:01:00.0: HW/SW Version: 0x8a108a10, Build Time: 20230328143229a
[   14.816193] mt7921e 0000:01:00.0: WM Firmware Version: ____000000, Build Time: 20230328143313
[  890.195329] br-lan: port 2(phy0-ap0) entered blocking state
[  890.195852] br-lan: port 2(phy0-ap0) entered disabled state
[  890.196980] device phy0-ap0 entered promiscuous mode
[  890.197825] br-lan: port 2(phy0-ap0) entered blocking state
[  890.198342] br-lan: port 2(phy0-ap0) entered forwarding state
[  890.199520] br-lan: port 2(phy0-ap0) entered disabled state
[  893.302924] mt7921e 0000:01:00.0: Message 00020003 (seq 14) timeout
[  893.303541] phy0-ap0: failed to set key (1, ff:ff:ff:ff:ff:ff) to hardware (-110)
[  896.502989] mt7921e 0000:01:00.0: Message 0004008a (seq 15) timeout
[  899.703118] mt7921e 0000:01:00.0: Message 0004008a (seq 1) timeout
[  902.903191] mt7921e 0000:01:00.0: Message 0004008a (seq 2) timeout
[  906.103261] mt7921e 0000:01:00.0: Message 0004008a (seq 3) timeout
[  909.303383] mt7921e 0000:01:00.0: Message 00020003 (seq 4) timeout
[  909.304000] phy0-ap0: failed to set key (4, ff:ff:ff:ff:ff:ff) to hardware (-110)
[  912.503466] mt7921e 0000:01:00.0: Message 0004008a (seq 5) timeout
[  915.703516] mt7921e 0000:01:00.0: Message 0004008a (seq 6) timeout
[  918.903610] mt7921e 0000:01:00.0: Message 0004008a (seq 7) timeout
[  922.103675] mt7921e 0000:01:00.0: Message 0004008a (seq 8) timeout
[  925.303772] mt7921e 0000:01:00.0: Message 0004008a (seq 9) timeout
[  928.503822] mt7921e 0000:01:00.0: Message 0004008a (seq 10) timeout
[  928.504490] mt7921e 0000:01:00.0: chip reset failed
[  931.703902] mt7921e 0000:01:00.0: Message 00020001 (seq 11) timeout
[  934.903956] mt7921e 0000:01:00.0: Message 00020002 (seq 14) timeout
[  938.104021] mt7921e 0000:01:00.0: Message 00020003 (seq 15) timeout
[  941.304074] mt7921e 0000:01:00.0: Message 00020002 (seq 1) timeout
[  944.504180] mt7921e 0000:01:00.0: Message 00020002 (seq 2) timeout
[  947.704235] mt7921e 0000:01:00.0: Message 0004008a (seq 3) timeout
[  950.904313] mt7921e 0000:01:00.0: Message 0004008a (seq 4) timeout
[  954.104351] mt7921e 0000:01:00.0: Message 0004008a (seq 5) timeout
[  957.304444] mt7921e 0000:01:00.0: Message 0004008a (seq 6) timeout
[  960.504579] mt7921e 0000:01:00.0: Message 0004008a (seq 7) timeout
[  963.704578] mt7921e 0000:01:00.0: Message 0004008a (seq 8) timeout
[  966.904638] mt7921e 0000:01:00.0: Message 0004008a (seq 9) timeout
[  970.104707] mt7921e 0000:01:00.0: Message 0004008a (seq 10) timeout
[  973.304787] mt7921e 0000:01:00.0: Message 0004008a (seq 11) timeout
[  976.504853] mt7921e 0000:01:00.0: Message 0004008a (seq 12) timeout
[  976.505524] mt7921e 0000:01:00.0: chip reset failed
[  979.704950] mt7921e 0000:01:00.0: Message 00020001 (seq 13) timeout
[  982.905124] mt7921e 0000:01:00.0: Message 00020002 (seq 2) timeout
[  986.105267] mt7921e 0000:01:00.0: Message 00020003 (seq 3) timeout
[  989.305366] mt7921e 0000:01:00.0: Message 0004008a (seq 5) timeout
[  992.505497] mt7921e 0000:01:00.0: Message 0004008a (seq 6) timeout
[  995.705637] mt7921e 0000:01:00.0: Message 0004008a (seq 7) timeout
[  998.905762] mt7921e 0000:01:00.0: Message 0004008a (seq 8) timeout
[ 1002.105879] mt7921e 0000:01:00.0: Message 0004008a (seq 11) timeout
[ 1005.306024] mt7921e 0000:01:00.0: Message 0004008a (seq 12) timeout
[ 1008.506146] mt7921e 0000:01:00.0: Message 0004008a (seq 15) timeout
[ 1011.706250] mt7921e 0000:01:00.0: Message 0004008a (seq 1) timeout
[ 1014.906343] mt7921e 0000:01:00.0: Message 0004008a (seq 2) timeout
[ 1018.106482] mt7921e 0000:01:00.0: Message 0004008a (seq 3) timeout
[ 1018.107144] mt7921e 0000:01:00.0: chip reset failed
[ 1021.306592] mt7921e 0000:01:00.0: Message 00020001 (seq 6) timeout
[ 1024.506718] mt7921e 0000:01:00.0: Message 00020002 (seq 9) timeout
[ 1027.706816] mt7921e 0000:01:00.0: Message 00020003 (seq 10) timeout
[ 1030.907061] mt7921e 0000:01:00.0: Message 00020002 (seq 11) timeout
[ 1034.107183] mt7921e 0000:01:00.0: Message 00020002 (seq 12) timeout
[ 1037.307117] mt7921e 0000:01:00.0: Message 0004008a (seq 13) timeout
[ 1040.507212] mt7921e 0000:01:00.0: Message 0004008a (seq 14) timeout
[ 1043.707324] mt7921e 0000:01:00.0: Message 0004008a (seq 15) timeout
[ 1046.907420] mt7921e 0000:01:00.0: Message 0004008a (seq 1) timeout
[ 1050.107513] mt7921e 0000:01:00.0: Message 0004008a (seq 2) timeout
[ 1053.307653] mt7921e 0000:01:00.0: Message 0004008a (seq 3) timeout
[ 1056.507720] mt7921e 0000:01:00.0: Message 0004008a (seq 4) timeout
[ 1059.707783] mt7921e 0000:01:00.0: Message 0004008a (seq 5) timeout
[ 1062.907864] mt7921e 0000:01:00.0: Message 0004008a (seq 6) timeout
[ 1066.107961] mt7921e 0000:01:00.0: Message 0004008a (seq 7) timeout
[ 1066.108618] mt7921e 0000:01:00.0: chip reset failed

It appears whatever issue is happening is related to the use of encryption. I'm able to start up an open AP without issue, but setting any type of encryption produces the following logs.

"iw info" dump for the card ``` Wiphy phy0 wiphy index: 0 max # scan SSIDs: 4 max scan IEs length: 482 bytes max # sched scan SSIDs: 10 max # match sets: 16 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 0x3 RX 0x3 Configured Antennas: TX 0x3 RX 0x3 Supported interface modes: * managed * AP * AP/VLAN * monitor * P2P-client * P2P-GO Band 1: Capabilities: 0x9ff RX LDPC HT20/HT40 SM Power Save disabled RX Greenfield RX HT20 SGI RX HT40 SGI TX STBC RX STBC 1-stream Max AMSDU length: 7935 bytes No DSSS/CCK HT40 Maximum RX AMPDU length 65535 bytes (exponent: 0x003) Minimum RX AMPDU time spacing: No restriction (0x00) HT TX/RX MCS rate indexes supported: 0-15 HE Iftypes: managed HE MAC Capabilities (0x08011a000040): +HTC HE Supported Trigger Frame MAC Padding Duration: 2 OM Control Maximum A-MPDU Length Exponent: 3 A-MSDU in A-MPDU HE PHY Capabilities: (0x2a70ce120dc0b3064e3f00): HE40/2.4GHz HE160/5GHz 242 tone RUs/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 Tx <= 80MHz STBC Rx <= 80MHz Full Bandwidth UL MU-MIMO Partial Bandwidth UL MU-MIMO DCM Max Constellation: 2 DCM Max Constellation Rx: 2 SU Beamformee Beamformee STS <= 80Mhz: 3 Ng = 16 SU Feedback Ng = 16 MU Feedback Codebook Size SU Feedback Codebook Size MU Feedback Triggered CQI Feedback Partial Bandwidth Extended Range PPE Threshold Present Power Boost Factor ar HE SU PPDU & HE PPDU 4x HE-LTF 0.8us GI 20MHz in 40MHz HE PPDU 2.4GHz 20MHz in 160/80+80MHz HE PPDU 80MHz in 160/80+80MHz HE PPDU DCM Max BW: 1 Longer Than 16HE SIG-B OFDM Symbols Non-Triggered CQI Feedback 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 HE RX MCS and NSS set 160 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 160 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 PPE Threshold 0x39 0x1c 0xc7 0x71 0x1c 0x07 EHT Iftypes: managed EHT MAC Capabilities (0x0000): EHT PHY Capabilities: (0x0000000000000000): EHT MCS/NSS: (0x): EHT bw=160 MHz, max NSS for MCS 8-9: Rx=0, Tx=0 EHT bw=160 MHz, max NSS for MCS 10-11: Rx=0, Tx=0 EHT bw=160 MHz, max NSS for MCS 12-13: Rx=0, Tx=0 HE Iftypes: AP HE MAC Capabilities (0x00011a081044): +HTC HE Supported BSR OM Control Maximum A-MPDU Length Exponent: 3 BQR A-MSDU in A-MPDU OM Control UL MU Data Disable RX HE PHY Capabilities: (0x0220ce120000a000000c00): HE40/2.4GHz LDPC Coding in Payload NDP with 4x HE-LTF and 3.2us GI STBC Tx <= 80MHz STBC Rx <= 80MHz Full Bandwidth UL MU-MIMO Partial Bandwidth UL MU-MIMO DCM Max Constellation: 2 DCM Max Constellation Rx: 2 Partial Bandwidth Extended Range PPE Threshold Present TX 1024-QAM RX 1024-QAM 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 PPE Threshold 0x39 0x1c 0xc7 0x71 0x1c 0x07 EHT Iftypes: AP EHT MAC Capabilities (0x0000): EHT PHY Capabilities: (0x0000000000000000): EHT MCS/NSS: (0x): EHT bw=20 MHz, max NSS for MCS 0-7: Rx=0, Tx=0 EHT bw=20 MHz, max NSS for MCS 8-9: Rx=0, Tx=0 EHT bw=20 MHz, max NSS for MCS 10-11: Rx=0, Tx=0 EHT bw=20 MHz, max NSS for MCS 12-13: Rx=0, Tx=0 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] (20.0 dBm) (no IR) * 2472 MHz [13] (20.0 dBm) (no IR) * 2484 MHz [14] (20.0 dBm) (no IR) Band 2: Capabilities: 0x9ff RX LDPC HT20/HT40 SM Power Save disabled RX Greenfield RX HT20 SGI RX HT40 SGI TX STBC RX STBC 1-stream Max AMSDU length: 7935 bytes No DSSS/CCK HT40 Maximum RX AMPDU length 65535 bytes (exponent: 0x003) Minimum RX AMPDU time spacing: No restriction (0x00) HT TX/RX MCS rate indexes supported: 0-15 VHT Capabilities (0x339071f6): Max MPDU length: 11454 Supported Channel Width: 160 MHz RX LDPC short GI (80 MHz) short GI (160/80+80 MHz) TX STBC SU Beamformee MU Beamformee RX antenna pattern consistency TX antenna pattern consistency 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: 0 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: 0 Mbps VHT extended NSS: supported HE Iftypes: managed HE MAC Capabilities (0x08011a000040): +HTC HE Supported Trigger Frame MAC Padding Duration: 2 OM Control Maximum A-MPDU Length Exponent: 3 A-MSDU in A-MPDU HE PHY Capabilities: (0x4c70ce120dc0b3064e3f00): HE40/HE80/5GHz HE160/5GHz 242 tone RUs/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 Tx <= 80MHz STBC Rx <= 80MHz Full Bandwidth UL MU-MIMO Partial Bandwidth UL MU-MIMO DCM Max Constellation: 2 DCM Max Constellation Rx: 2 SU Beamformee Beamformee STS <= 80Mhz: 3 Ng = 16 SU Feedback Ng = 16 MU Feedback Codebook Size SU Feedback Codebook Size MU Feedback Triggered CQI Feedback Partial Bandwidth Extended Range PPE Threshold Present Power Boost Factor ar HE SU PPDU & HE PPDU 4x HE-LTF 0.8us GI 20MHz in 40MHz HE PPDU 2.4GHz 20MHz in 160/80+80MHz HE PPDU 80MHz in 160/80+80MHz HE PPDU DCM Max BW: 1 Longer Than 16HE SIG-B OFDM Symbols Non-Triggered CQI Feedback 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 HE RX MCS and NSS set 160 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 160 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 PPE Threshold 0x39 0x1c 0xc7 0x71 0x1c 0x07 EHT Iftypes: managed EHT MAC Capabilities (0x0000): EHT PHY Capabilities: (0x0000000000000000): EHT MCS/NSS: (0x): EHT bw <= 80 MHz, max NSS for MCS 8-9: Rx=0, Tx=0 EHT bw <= 80 MHz, max NSS for MCS 10-11: Rx=0, Tx=0 EHT bw <= 80 MHz, max NSS for MCS 12-13: Rx=0, Tx=0 EHT bw=160 MHz, max NSS for MCS 8-9: Rx=0, Tx=0 EHT bw=160 MHz, max NSS for MCS 10-11: Rx=0, Tx=0 EHT bw=160 MHz, max NSS for MCS 12-13: Rx=0, Tx=0 HE Iftypes: AP HE MAC Capabilities (0x00011a081044): +HTC HE Supported BSR OM Control Maximum A-MPDU Length Exponent: 3 BQR A-MSDU in A-MPDU OM Control UL MU Data Disable RX HE PHY Capabilities: (0x0420ce120000a000000c00): HE40/HE80/5GHz LDPC Coding in Payload NDP with 4x HE-LTF and 3.2us GI STBC Tx <= 80MHz STBC Rx <= 80MHz Full Bandwidth UL MU-MIMO Partial Bandwidth UL MU-MIMO DCM Max Constellation: 2 DCM Max Constellation Rx: 2 Partial Bandwidth Extended Range PPE Threshold Present TX 1024-QAM RX 1024-QAM 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 PPE Threshold 0x39 0x1c 0xc7 0x71 0x1c 0x07 EHT Iftypes: AP EHT MAC Capabilities (0x0000): EHT PHY Capabilities: (0x0000000000000000): EHT MCS/NSS: (0x): EHT bw <= 80 MHz, max NSS for MCS 8-9: Rx=0, Tx=0 EHT bw <= 80 MHz, max NSS for MCS 10-11: Rx=0, Tx=0 EHT bw <= 80 MHz, max NSS for MCS 12-13: Rx=0, Tx=0 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) (no IR, radar detection) * 5280 MHz [56] (20.0 dBm) (no IR, radar detection) * 5300 MHz [60] (20.0 dBm) (no IR, radar detection) * 5320 MHz [64] (20.0 dBm) (no IR, radar detection) * 5500 MHz [100] (20.0 dBm) (no IR, radar detection) * 5520 MHz [104] (20.0 dBm) (no IR, radar detection) * 5540 MHz [108] (20.0 dBm) (no IR, radar detection) * 5560 MHz [112] (20.0 dBm) (no IR, radar detection) * 5580 MHz [116] (20.0 dBm) (no IR, radar detection) * 5600 MHz [120] (20.0 dBm) (no IR, radar detection) * 5620 MHz [124] (20.0 dBm) (no IR, radar detection) * 5640 MHz [128] (20.0 dBm) (no IR, radar detection) * 5660 MHz [132] (20.0 dBm) (no IR, radar detection) * 5680 MHz [136] (20.0 dBm) (no IR, radar detection) * 5700 MHz [140] (20.0 dBm) (no IR, radar detection) * 5720 MHz [144] (20.0 dBm) (no IR, radar detection) * 5745 MHz [149] (20.0 dBm) (no IR) * 5765 MHz [153] (20.0 dBm) (no IR) * 5785 MHz [157] (20.0 dBm) (no IR) * 5805 MHz [161] (20.0 dBm) (no IR) * 5825 MHz [165] (20.0 dBm) (no IR) * 5845 MHz [169] (disabled) * 5865 MHz [173] (disabled) Band 4: HE Iftypes: managed HE MAC Capabilities (0x08011a000040): +HTC HE Supported Trigger Frame MAC Padding Duration: 2 OM Control Maximum A-MPDU Length Exponent: 3 A-MSDU in A-MPDU HE PHY Capabilities: (0x4c70ce120dc0b3064e3f00): HE40/HE80/5GHz HE160/5GHz 242 tone RUs/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 Tx <= 80MHz STBC Rx <= 80MHz Full Bandwidth UL MU-MIMO Partial Bandwidth UL MU-MIMO DCM Max Constellation: 2 DCM Max Constellation Rx: 2 SU Beamformee Beamformee STS <= 80Mhz: 3 Ng = 16 SU Feedback Ng = 16 MU Feedback Codebook Size SU Feedback Codebook Size MU Feedback Triggered CQI Feedback Partial Bandwidth Extended Range PPE Threshold Present Power Boost Factor ar HE SU PPDU & HE PPDU 4x HE-LTF 0.8us GI 20MHz in 40MHz HE PPDU 2.4GHz 20MHz in 160/80+80MHz HE PPDU 80MHz in 160/80+80MHz HE PPDU DCM Max BW: 1 Longer Than 16HE SIG-B OFDM Symbols Non-Triggered CQI Feedback 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 HE RX MCS and NSS set 160 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 160 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 PPE Threshold 0x39 0x1c 0xc7 0x71 0x1c 0x07 EHT Iftypes: managed EHT MAC Capabilities (0x0000): EHT PHY Capabilities: (0x0000000000000000): EHT MCS/NSS: (0x): EHT bw <= 80 MHz, max NSS for MCS 8-9: Rx=0, Tx=0 EHT bw <= 80 MHz, max NSS for MCS 10-11: Rx=0, Tx=0 EHT bw <= 80 MHz, max NSS for MCS 12-13: Rx=0, Tx=0 EHT bw=160 MHz, max NSS for MCS 8-9: Rx=0, Tx=0 EHT bw=160 MHz, max NSS for MCS 10-11: Rx=0, Tx=0 EHT bw=160 MHz, max NSS for MCS 12-13: Rx=0, Tx=0 HE Iftypes: AP HE MAC Capabilities (0x00011a081044): +HTC HE Supported BSR OM Control Maximum A-MPDU Length Exponent: 3 BQR A-MSDU in A-MPDU OM Control UL MU Data Disable RX HE PHY Capabilities: (0x0420ce120000a000000c00): HE40/HE80/5GHz LDPC Coding in Payload NDP with 4x HE-LTF and 3.2us GI STBC Tx <= 80MHz STBC Rx <= 80MHz Full Bandwidth UL MU-MIMO Partial Bandwidth UL MU-MIMO DCM Max Constellation: 2 DCM Max Constellation Rx: 2 Partial Bandwidth Extended Range PPE Threshold Present TX 1024-QAM RX 1024-QAM 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 PPE Threshold 0x39 0x1c 0xc7 0x71 0x1c 0x07 EHT Iftypes: AP EHT MAC Capabilities (0x0000): EHT PHY Capabilities: (0x0000000000000000): EHT MCS/NSS: (0x): EHT bw <= 80 MHz, max NSS for MCS 8-9: Rx=0, Tx=0 EHT bw <= 80 MHz, max NSS for MCS 10-11: Rx=0, Tx=0 EHT bw <= 80 MHz, max NSS for MCS 12-13: Rx=0, Tx=0 Frequencies: * 5955 MHz [1] (12.0 dBm) * 5975 MHz [5] (12.0 dBm) * 5995 MHz [9] (12.0 dBm) * 6015 MHz [13] (12.0 dBm) * 6035 MHz [17] (12.0 dBm) * 6055 MHz [21] (12.0 dBm) * 6075 MHz [25] (12.0 dBm) * 6095 MHz [29] (12.0 dBm) * 6115 MHz [33] (12.0 dBm) * 6135 MHz [37] (12.0 dBm) * 6155 MHz [41] (12.0 dBm) * 6175 MHz [45] (12.0 dBm) * 6195 MHz [49] (12.0 dBm) * 6215 MHz [53] (12.0 dBm) * 6235 MHz [57] (12.0 dBm) * 6255 MHz [61] (12.0 dBm) * 6275 MHz [65] (12.0 dBm) * 6295 MHz [69] (12.0 dBm) * 6315 MHz [73] (12.0 dBm) * 6335 MHz [77] (12.0 dBm) * 6355 MHz [81] (12.0 dBm) * 6375 MHz [85] (12.0 dBm) * 6395 MHz [89] (12.0 dBm) * 6415 MHz [93] (12.0 dBm) * 6435 MHz [97] (12.0 dBm) * 6455 MHz [101] (12.0 dBm) * 6475 MHz [105] (12.0 dBm) * 6495 MHz [109] (12.0 dBm) * 6515 MHz [113] (12.0 dBm) * 6535 MHz [117] (12.0 dBm) * 6555 MHz [121] (12.0 dBm) * 6575 MHz [125] (12.0 dBm) * 6595 MHz [129] (12.0 dBm) * 6615 MHz [133] (12.0 dBm) * 6635 MHz [137] (12.0 dBm) * 6655 MHz [141] (12.0 dBm) * 6675 MHz [145] (12.0 dBm) * 6695 MHz [149] (12.0 dBm) * 6715 MHz [153] (12.0 dBm) * 6735 MHz [157] (12.0 dBm) * 6755 MHz [161] (12.0 dBm) * 6775 MHz [165] (12.0 dBm) * 6795 MHz [169] (12.0 dBm) * 6815 MHz [173] (12.0 dBm) * 6835 MHz [177] (12.0 dBm) * 6855 MHz [181] (12.0 dBm) * 6875 MHz [185] (12.0 dBm) * 6895 MHz [189] (12.0 dBm) * 6915 MHz [193] (12.0 dBm) * 6935 MHz [197] (12.0 dBm) * 6955 MHz [201] (12.0 dBm) * 6975 MHz [205] (12.0 dBm) * 6995 MHz [209] (12.0 dBm) * 7015 MHz [213] (12.0 dBm) * 7035 MHz [217] (12.0 dBm) * 7055 MHz [221] (12.0 dBm) * 7075 MHz [225] (12.0 dBm) * 7095 MHz [229] (12.0 dBm) * 7115 MHz [233] (12.0 dBm) valid interface combinations: * #{ managed, P2P-client } <= 2, #{ AP, P2P-GO } <= 1, total <= 2, #channels <= 2 HT Capability overrides: * MCS: ff ff ff ff ff ff ff ff ff ff * maximum A-MSDU length * supported channel width * short GI for 40 MHz * max A-MPDU length exponent * min MPDU start spacing max # scan plans: 1 max scan plan interval: 65535 max scan plan iterations: 0 Supported extended features: * [ RRM ]: RRM * [ SET_SCAN_DWELL ]: scan dwell setting * [ BEACON_RATE_LEGACY ]: legacy beacon rate setting * [ BEACON_RATE_HT ]: HT beacon rate setting * [ BEACON_RATE_VHT ]: VHT beacon rate setting * [ FILS_STA ]: STA FILS (Fast Initial Link Setup) * [ CQM_RSSI_LIST ]: multiple CQM_RSSI_THOLD records * [ CONTROL_PORT_OVER_NL80211 ]: control port over nl80211 * [ ACK_SIGNAL_SUPPORT ]: ack signal level support * [ TXQS ]: FQ-CoDel-enabled intermediate TXQs * [ CAN_REPLACE_PTK0 ]: can safely replace PTK 0 when rekeying * [ AIRTIME_FAIRNESS ]: airtime fairness scheduling * [ AQL ]: Airtime Queue Limits (AQL) * [ CONTROL_PORT_NO_PREAUTH ]: disable pre-auth over nl80211 control port support * [ SCAN_FREQ_KHZ ]: scan on kHz frequency support * [ CONTROL_PORT_OVER_NL80211_TX_STATUS ]: tx status for nl80211 control port support * [ BEACON_RATE_HE ]: HE beacon rate support (AP/mesh) ```
dellagd commented 1 year ago

In attempting to debug this, one thing I tried was patching main.c to use MCU_EXT_CMD instead of MCU_UNI_CMD for the set_key process. The idea here was from the mt7915, where the same process was executed with MCU_EXT_CMD.

https://github.com/openwrt/mt76/blob/cddbd796bbc649debe457f7b34b200bbda4fcc53/mt7915/main.c#L422

https://github.com/openwrt/mt76/blob/cddbd796bbc649debe457f7b34b200bbda4fcc53/mt7921/main.c#L570

This resulted in the following patch:

--- a/mt7921/main.c
+++ b/mt7921/main.c
@@ -558,7 +560,7 @@ static int mt7921_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,

    mt76_wcid_key_setup(&dev->mt76, wcid, key);
    err = mt76_connac_mcu_add_key(&dev->mt76, vif, &msta->bip,
-                     key, MCU_UNI_CMD(STA_REC_UPDATE),
+                     key, MCU_EXT_CMD(STA_REC_UPDATE),
                      &msta->wcid, cmd);
    if (err)
        goto out;
@@ -567,7 +569,7 @@ static int mt7921_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
        key->cipher == WLAN_CIPHER_SUITE_WEP40)
        err = mt76_connac_mcu_add_key(&dev->mt76, vif,
                          &mvif->wep_sta->bip,
-                         key, MCU_UNI_CMD(STA_REC_UPDATE),
+                         key, MCU_EXT_CMD(STA_REC_UPDATE),
                          &mvif->wep_sta->wcid, cmd);
 out:
    mt7921_mutex_release(dev);

To my surprise, this seemed to have an effect, and I was suddenly able to start the access point with encryption and associate a station! I have not encountered any crashes so far, and I was also able to start an access point in the 6G band!

However, after this, it seems there is still some sort of issue. When a client associates to the AP, it seems there is an issue with data transmission. I see the following repeating continuously in logs (MAC removed):

Mon May  1 03:21:57 2023 daemon.info dnsmasq-dhcp[1]: DHCPDISCOVER(br-lan) 12:34:56:78:90:AB
Mon May  1 03:21:57 2023 daemon.info dnsmasq-dhcp[1]: DHCPOFFER(br-lan) 192.168.1.116 12:34:56:78:90:AB
Mon May  1 03:22:06 2023 daemon.info dnsmasq-dhcp[1]: DHCPDISCOVER(br-lan) 12:34:56:78:90:AB
Mon May  1 03:22:06 2023 daemon.info dnsmasq-dhcp[1]: DHCPOFFER(br-lan) 192.168.1.116 12:34:56:78:90:AB
Mon May  1 03:22:13 2023 daemon.info dnsmasq-dhcp[1]: DHCPDISCOVER(br-lan) 12:34:56:78:90:AB
Mon May  1 03:22:13 2023 daemon.info dnsmasq-dhcp[1]: DHCPOFFER(br-lan) 192.168.1.116 12:34:56:78:90:AB
Mon May  1 03:22:14 2023 daemon.info dnsmasq-dhcp[1]: DHCPDISCOVER(br-lan) 12:34:56:78:90:AB
Mon May  1 03:22:14 2023 daemon.info dnsmasq-dhcp[1]: DHCPOFFER(br-lan) 192.168.1.116 12:34:56:78:90:AB
Mon May  1 03:22:16 2023 daemon.info dnsmasq-dhcp[1]: DHCPDISCOVER(br-lan) 12:34:56:78:90:AB
Mon May  1 03:22:16 2023 daemon.info dnsmasq-dhcp[1]: DHCPOFFER(br-lan) 192.168.1.116 12:34:56:78:90:AB
Mon May  1 03:22:21 2023 daemon.info dnsmasq-dhcp[1]: DHCPDISCOVER(br-lan) 12:34:56:78:90:AB
Mon May  1 03:22:21 2023 daemon.info dnsmasq-dhcp[1]: DHCPOFFER(br-lan) 192.168.1.116 12:34:56:78:90:AB
Mon May  1 03:22:29 2023 daemon.info dnsmasq-dhcp[1]: DHCPDISCOVER(br-lan) 12:34:56:78:90:AB
Mon May  1 03:22:29 2023 daemon.info dnsmasq-dhcp[1]: DHCPOFFER(br-lan) 192.168.1.116 12:34:56:78:90:AB

This doesn't happen if the AP is running with no encryption, where a client successfully gets a DHCP lease and can communicate. I think this DHCP issue is just an indicator of some sort of general data transmission issue, because if I manually set an IP such that DHCP shouldn't be necessary, it appears I still can't communicate over the link (ping the router).

Any ideas?

morrownr commented 1 year ago

Hi @dellagd

This patch adds firmware files v211120221208 for MT7981 WiFi.

Are you sure that is the correct firmware?

See section 1:

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

morrownr commented 1 year ago

linux-firmware: update firmware for MT7922 WiFi device Update binary firmware for MT7922 WiFi devices

File: firmware/WIFI_MT7922_patch_mcu_1_1_hdr.bin Version: 20230328143229a File: firmware/WIFI_RAM_CODE_MT7922_1.bin Version: 20230328143313

Signed-off-by: Deren Wu deren.wu@mediatek.com Signed-off-by: Josh Boyer jwboyer@kernel.org

dellagd commented 1 year ago

Hey @morrownr, I think the logs I posted above in the first post show those firmware versions called out. I did double check I grabbed the newest available firmware. Happy to check other logs if you have some guidance on how to find them, but I struggled to find more print-outs than this.

morrownr commented 1 year ago

I am running on linux kernel 6.1.26 using the latest mt76 (cddbd79)

The link in the above says:

inux-firmware: add firmware for MT7981 This patch adds firmware files v211120221208 for MT7981 WiFi.

Signed-off-by: Shayne Chen shayne.chen@mediatek.com Signed-off-by: Josh Boyer jwboyer@kernel.org

So, you said you are running the mt7981 firmware.

The mt7981 firmware is not the right firmware for a mt7922 chipset. I pointed you to the right fimrware.

That may or may not have anything to do with you problem.

dellagd commented 1 year ago

Oh, sorry for the confusion. I was just trying to call out the commit hash for the version of openwrt/mt76 I am running. That specific commit does indeed seem to add the firmware files for the mt7981, but I don't think their presence in the filesystem means that the driver would try to load them onto this chipset. The mt7922 firmware files are also present on my filesystem, and I think mt76 is able to ID the chipset and load it with the correct firmware file (correct me if I am wrong).

Thank you for taking a look at this with me!

morrownr commented 1 year ago

I don't think their presence in the filesystem means that the driver would try to load them onto this chipset.

Let me see if I can further explain things. We have been seeing something that is not common with the firmware for the mt7921 and mt7922 chipsets. For many months we have been seeing new firmware monthly for the mt7921 and the mt7922 is not far behind.

My point being that it may be very important for you to make sure you have the very latest firmware and keep it up to date while working your problem. As Dorthey used to say, Toto, we aren't in Kansas anymore. These WiFi 6e drivers and their firmware are incredibly complicated and it appears that regular releases for now are required to keep fixing problems and adding features. It might be a good idea for you to also consider updating to kernel 6.2 or 6.3. You are on the bleeding edge with a product that does not have widespread use yet. I should have a PCIe card with the mt7922 chipset within a couple of weeks so I will see what the state of the driver and firmware is myself soon.

morrownr commented 1 year ago

FYI: You are welcome to stop by my site. It is primarily used for USB-WiFi but we talk about cards sometimes as well. The site is:

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

We use issues for news and discussions. I recently posted news about a new ASUS card with the mt7922 chipset and I ordered one. I'll be posting progress reports in the issue as I bring it online in a couple of weeks.

Regards

dellagd commented 1 year ago

For many months we have been seeing new firmware monthly for the mt7921 and the mt7922 is not far behind.

Yeah, I have been looking through the mediatek firmware releases and was surprised to see so many. That combined with the amount of issues filed regarding these chips lead me to believe things probably just aren't stable yet. I actually even tried loading on an earlier version of firmware in my testing but got the same sort of errors in the logs.

I should have a PCIe card with the mt7922 chipset within a couple of weeks so I will see what the state of the driver and firmware is myself soon.

Ooh, excited to hear it! Will those reports go into a specific issue thread on your repository that I should follow?

I also ordered one of these (AW7916-NPD-1) from AsiaRF which should supposedly also support 6E. We will see what the drivers are like there - I think this chipset is primarily targeted at AP usage at least. The downside is this is a mPCIe card, and the system I am using only has an M.2 slot. I got a converter for now but it isn't ideal for the form factor.

Just wanted to confirm though, I see the following logs printed out on boot:

[   14.433931] mt7921e 0000:01:00.0: HW/SW Version: 0x8a108a10, Build Time: 20230328143229a
[   14.816193] mt7921e 0000:01:00.0: WM Firmware Version: ____000000, Build Time: 20230328143313

Those strings match the versions you called out for the latest firmware I should be using, so I think I have the latest firmware going on right now. Please let me know if I should try something different here. I'll see if I can get on a later kernel.

File: firmware/WIFI_MT7922_patch_mcu_1_1_hdr.bin Version: 20230328143229a File: firmware/WIFI_RAM_CODE_MT7922_1.bin Version: 20230328143313

morrownr commented 1 year ago

Will those reports go into a specific issue thread on your repository that I should follow?

Yes

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

You are welcome to make a similar new issue about your little card so we can follow along. I would be interested in a link where one can be ordered.

The mt7916 is interesting. It is mostly aimed at routers I assume?

dellagd commented 1 year ago

That's my understanding - we will see how the software support pans out though.

corecell commented 1 year ago

I have same problem.

Board: NanoPI R5C Kernel: Linux nanopi 6.4-rc1 OpenWRT: unofficial build r0-803e80d mt76: cddbd796bbc649debe457f7b34b200bbda4fcc53 Firmwares builtin:

mt7921e 0000:01:00.0: HW/SW Version: 0x8a108a10, Build Time: 20230328143229a
mt7921e 0000:01:00.0: WM Firmware Version: ____000000, Build Time: 20230328143313
8628325955ef1b26960327a774e38d5f  BT_RAM_CODE_MT7922_1_1_hdr.bin
9ba39f2ad888d63df937650af8ae3126  WIFI_MT7922_patch_mcu_1_1_hdr.bin
14eab07f220ded220f4424cb96c5cc28  WIFI_RAM_CODE_MT7922_1.bin

Checked with last firmwares from kernel.org:

4001b4ceb0bad72c439e2143f87ae47e  BT_RAM_CODE_MT7922_1_1_hdr.bin
de29098ddf1773051601de2e9ab60657  WIFI_MT7922_patch_mcu_1_1_hdr.bin
14c08c8298b639ee52409b5e9711a083  WIFI_RAM_CODE_MT7922_1.bin

I found that, when you set cipher in wireless security to:

Working config:

config wifi-device 'radio0'
    option type 'mac80211'
    option path '3c0000000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0'
    option channel 'auto'
    option band '5g'
    option htmode 'VHT40'
    option cell_density '0'
    option txpower '5'
    option country 'UA'

config wifi-iface 'wifinet0'
    option device 'radio0'
    option mode 'ap'
    option ssid 'myssid'
    option encryption 'psk2+tkip+ccmp'
    option key 'mypassword'
    option network 'lan'

The wireless card works fine most of the time (not tested for heavy load, used only for my smartphone), but I still had two freezes (same issue). I didn't save dmesg log for the first time stuck, but as far as I remember the problem was something like this: pcieport 0000:00:00.0: AER: Multiple Corrected error received

fhteagle commented 1 year ago

Interesting find. Two questions for those that have one:

  1. Does it do dual band dual connect when operating as AP? As in, can it simultaneously make a 2.4ghz and a 5ghz AP, and connect clients on both at the same time?
  2. Is the heatsink mounted with glue (removable with mild heat?), screwed on, or hard connected on?
dellagd commented 1 year ago

Does it do dual band dual connect when operating as AP? As in, can it simultaneously make a 2.4ghz and a 5ghz AP, and connect clients on both at the same time?

Right now I am using it as a 6GHz AP and a 2.4GHz client. It looks like the secondary radio in the DBDC card is only 2.4GHz. It lists AP as a capability for that radio but I haven't tried it yet.

Is the heatsink mounted with glue (removable with mild heat?), screwed on, or hard connected on?

I'm not sure - I think you could reach out to AsiaRF if you wanted to know, they were responsive to me over email. I will note that the orange heatsink pictured actually was not present on the unit I received, it's just the metal can that you can see beneath the orange heatsink.

antnyfls commented 1 year ago

I had similar issues with a mt7922 card on OpenWrt, that were fixed with the latest hostapd update https://github.com/openwrt/openwrt/commit/cd804c1ebb34c9740f8ad9fe393a81f3efb7b009

exkc commented 10 months ago

Right now I am using it as a 6GHz AP and a 2.4GHz client. It looks like the secondary radio in the DBDC card is only 2.4GHz. It lists AP as a capability for that radio but I haven't tried it yet.

secondary radio dont work for me . i tried to set up two wifi network (one is 2.4 one is 5g) in luci and it didnt work.

i am using openwrt 65380dc41cc39d5f9e73f509848d327d60470ea2 with whatever m76 it shipped in that commit (as well as mtk wifi firmware from artix(that mt76 dont have the firmware for my card))

Right now i am using MT7922 for 5g wifi only and cheap second hand tp link ar9545 card (TP-LINK TL-WN781ND v2) for 2g wifi.

antnyfls commented 10 months ago

secondary radio dont work for me . i tried to set up two wifi network (one is 2.4 one is 5g) in luci and it didnt work.

@exkc mt7922 wifi card is single band for dual band you need one like this https://asiarf.com/product/wi-fi-6e-m-2-ae-key-module-mt7916-aw7916-aed/

exkc commented 10 months ago

oh sry yeah I got confused between the two.I dont really need dual band. i could have only one 2.4g wifi . 5g wifi isnt that necessary for me.Anyway since I have cheap second hand tp link ar9545 card (TP-LINK TL-WN781ND v2) , so i can use MT7922 for 5g wifi only and cheap second hand tp link ar9545 card (TP-LINK TL-WN781ND v2) for 2g wifi.

petrkr commented 8 months ago

secondary radio dont work for me . i tried to set up two wifi network (one is 2.4 one is 5g) in luci and it didnt work.

@exkc mt7922 wifi card is single band for dual band you need one like this https://asiarf.com/product/wi-fi-6e-m-2-ae-key-module-mt7916-aw7916-aed/

You mean dual-radio, not dual band probably.

DualBand means it have two bands, (like 2.4 and 5 ghz bands) but this radio is actually tripple band, as it has also 6ghz

So you mean single radio / double radio? Like it can run two bands at once