openwrt / mt76

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

MT7921e - can't set DFS channel #856

Open danpawlik opened 8 months ago

danpawlik commented 8 months ago

Hi, When I try to set on MT7921e a channel > 100, the interface initialization always fail. For example:

# Channel 104, 80MHZ width:
Sat Jan 13 13:06:52 2024 daemon.notice wpa_supplicant[1723]: Set new config for phy phy0
Sat Jan 13 13:06:52 2024 daemon.notice hostapd: Set new config for phy phy0: /var/run/hostapd-phy0.conf
Sat Jan 13 13:06:52 2024 daemon.notice hostapd: Restart interface for phy phy0
Sat Jan 13 13:06:52 2024 daemon.notice hostapd: Remove interface 'phy0'
Sat Jan 13 13:06:52 2024 daemon.notice hostapd: phy0-ap0: interface state ENABLED->DISABLED
Sat Jan 13 13:06:52 2024 daemon.notice hostapd: phy0-ap0: AP-DISABLED
Sat Jan 13 13:06:52 2024 daemon.notice hostapd: phy0-ap0: CTRL-EVENT-TERMINATING
Sat Jan 13 13:06:52 2024 daemon.err hostapd: rmdir[ctrl_interface=/var/run/hostapd]: Permission denied
Sat Jan 13 13:06:53 2024 daemon.notice hostapd: nl80211: deinit ifname=phy0-ap0 disabled_11b_rates=0
Sat Jan 13 13:06:53 2024 kern.info kernel: [  115.466700] device phy0-ap0 left promiscuous mode
Sat Jan 13 13:06:53 2024 kern.info kernel: [  115.471490] br-lan: port 5(phy0-ap0) entered disabled state
Sat Jan 13 13:06:53 2024 daemon.notice netifd: Network device 'phy0-ap0' link is down
Sat Jan 13 13:06:53 2024 daemon.notice hostapd: Configuration file: data: driver=nl80211 logger_syslog=127 logger_syslog_level=0 logger_stdout=127 logger_stdout_level=0 country_code=PL ieee80211d=1 ieee80211h=1 hw_mode=a beacon_int=100 chanlist=104 tx_queue_data2_burst=2.0 #num_global_macaddr=1 ieee80211n=1 ht_coex=0 ht_capab=[HT40-][LDPC][SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1][MAX-AMSDU-7935] ieee80211ac=1 vht_oper_chwidth=1 vht_oper_centr_freq_seg0_idx=106 vht_capab=[RXLDPC][SHORT-GI-80][TX-STBC-2BY1][SU-BEAMFORMEE][MU-BEAMFORMEE][RX-ANTENNA-PATTERN][TX-ANTENNA-PATTERN][RX-STBC-1][BF-ANTENNA-4][MAX-MPDU-11454][MAX-A-MPDU-LEN-EXP7] ieee80211ax=1 he_oper_chwidth=1 he_oper_centr_freq_seg0_idx=106 he_bss_color=128 he_spr_sr_control=3 he_default_pe_duration=4 he_rts_threshold=1023 he_mu_edca_qos_info_param_count=0 he_mu_edca_qos_info_q_ack=0 he_mu_edca_qos_info_queue_request=0 he_mu_edca_qos_info_txop_request=0 he_mu_edca_ac_be_aifsn=8 he_mu_edca_ac_be_aci=0 he_mu_edca_ac_be_ecwmin=9 he_mu_edca_ac_be_ecwmax=10 he_mu_edca_ac
Sat Jan 13 13:06:53 2024 kern.info kernel: [  115.773851] br-lan: port 5(phy0-ap0) entered blocking state
Sat Jan 13 13:06:53 2024 kern.info kernel: [  115.779516] br-lan: port 5(phy0-ap0) entered disabled state
Sat Jan 13 13:06:53 2024 kern.info kernel: [  115.785204] device phy0-ap0 entered promiscuous mode
Sat Jan 13 13:06:53 2024 kern.info kernel: [  115.790262] br-lan: port 5(phy0-ap0) entered blocking state
Sat Jan 13 13:06:53 2024 kern.info kernel: [  115.795838] br-lan: port 5(phy0-ap0) entered listening state
Sat Jan 13 13:06:53 2024 daemon.notice hostapd: phy0-ap0: interface state UNINITIALIZED->COUNTRY_UPDATE
Sat Jan 13 13:06:53 2024 daemon.notice hostapd: phy0-ap0: interface state COUNTRY_UPDATE->HT_SCAN
Sat Jan 13 13:06:53 2024 daemon.notice netifd: Wireless device 'radio0' is now up
Sat Jan 13 13:06:53 2024 daemon.notice hostapd: phy0-ap0: interface state HT_SCAN->DFS
Sat Jan 13 13:06:53 2024 daemon.notice hostapd: phy0-ap0: DFS-CAC-START freq=5520 chan=104 sec_chan=-1, width=1, seg0=106, seg1=0, cac_time=60s
Sat Jan 13 13:06:53 2024 daemon.err hostapd: DFS start_dfs_cac() failed, -1
Sat Jan 13 13:06:53 2024 daemon.err hostapd: Interface initialization failed
Sat Jan 13 13:06:53 2024 daemon.notice hostapd: phy0-ap0: interface state DFS->DISABLED
Sat Jan 13 13:06:53 2024 daemon.notice hostapd: phy0-ap0: AP-DISABLED

wireless config:

cat /etc/config/wireless

config wifi-device 'radio0'
    option type 'mac80211'
    option path 'soc/11310000.pcie/pci0001:00/0001:00:00.0/0001:01:00.0'
    option channel '104'
    option band '5g'
    option htmode 'HE80'
    option country 'PL'
    option cell_density '0'
    option log_level '0'
    option txpower '21'

config wifi-iface 'default_radio0'
    option device 'radio0'
    option network 'lan'
    option mode 'ap'
    option ssid 'MyAP'
    option encryption 'psk2+ccmp'
    option key 'mypassword'
    option ieee80211r '1'
    option nasid 'r4-5'
    option mobility_domain 'aaaa'
    option ft_over_ds '1'
    option ft_psk_generate_local '1'
    option ieee80211k '1'
    option time_advertisement '2'
    option time_zone 'CET-1CEST,M3.5.0,M10.5.0/3'
    option wnm_sleep_mode '1'
    option bss_transition '1'
    option proxy_arp '1'
    option ieee80211w '1'

Similar error I got on different channel and different width.

There is also another issue with MT7921e, that 6GHz band is not possible to set.

Djfe commented 8 months ago

the first thing was just fixed, I don't know about the second one https://github.com/openwrt/openwrt/commit/c909fdad1870361d5a6f0c0a2437d062e988f559

This is not part of any release, yet. But if you build the 23.05 release branch and use that or use a snaphot then you will get the fix. Else you'll have to wait

danpawlik commented 8 months ago

@Djfe I'm using snapshot version, but created by my own (the BPI-R4 device branch is still in progress) and the issue is still there. I will try to dig more in few days (if I will have time).

Djfe commented 8 months ago

which commit?

danpawlik commented 8 months ago

I checkout to Daniels fork branch in PR: https://github.com/openwrt/openwrt/pull/14140 . Even rebase to HEAD does not change anything.

lukasz1992 commented 8 months ago

I do not think mt7921 supports DFS right now, I do not see necessary code.

especially NL80211_EXT_FEATURE_RADAR_BACKGROUND is not being set.

morrownr commented 7 months ago

I do not think mt7921 supports DFS right now, I do not see necessary code.

The mt7612u and mt7610u drivers do not support DFS channels either. I think AP mode DFS support requires additional certification and the Mediatek management decision has been made not to support it. I think this is a BIG mistake. I have adapters that use various Realtek chips and they do support AP mode DFS. Example: rtl8812au chipset with out-of-kernel driver. In fact, this message is coming to you through an AP that is using an adapter with a rtl8812au chipset and it is running on channel 116.