morrownr / USB-WiFi

USB WiFi Adapter Information for Linux
2.58k stars 171 forks source link

6ghz Access Point Creation with MT7921 #103

Open desultory-zz opened 2 years ago

desultory-zz commented 2 years ago

I'm not able to get this card to create an access point. I've upgraded the firmware to the latest using this wiki as a guide, and had to compile hostapd myself for SAE support, but it seems to be having issues with ACS. I'm sure my hostapd config is wrong, but I can't find any good resources on making wifi 6 APs on linux,

Here is my hostapd compile config:

CONFIG_DRIVER_HOSTAP=y
CONFIG_DRIVER_NL80211=y
CONFIG_LIBNL32=y
CONFIG_RSN_PREAUTH=y
CONFIG_EAP=y
CONFIG_ERP=y
CONFIG_EAP_MD5=y
CONFIG_EAP_TLS=y
CONFIG_EAP_PEAP=y
CONFIG_EAP_GTC=y
CONFIG_EAP_TTLS=y
CONFIG_PKCS12=y
CONFIG_IPV6=y
CONFIG_IEEE80211R=y
CONFIG_WNM=y
CONFIG_IEEE80211AC=y
CONFIG_IEEE80211AX=y
CONFIG_DEBUG_FILE=y
CONFIG_NO_ACCOUNTING=y
CONFIG_NO_RADIUS=y
CONFIG_GETRANDOM=y
CONFIG_TLS=openssl
CONFIG_TLSV12=y
CONFIG_ACS=y
CONFIG_MBO=y
CONFIG_TAXONOMY=y
CONFIG_OWE=y
CONFIG_NO_TKIP=y
CONFIG_DPP=y
CONFIG_DPP2=y
CONFIG_SAE=y

here is my hostapd.conf:

interface=wlan0
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
ssid=test6
country_code=US
ieee80211d=1
ieee80211h=1
hw_mode=a
channel=100
ieee80211ac=1
ieee80211ax=1

beacon_int=100
dtim_period=2
max_num_sta=2007
rts_threshold=-1
fragm_threshold=-1
macaddr_acl=0
auth_algs=3
ignore_broadcast_ssid=0
#wmm_enabled=1
#wmm_ac_bk_cwmin=4
#wmm_ac_bk_cwmax=10
#wmm_ac_bk_aifs=7
#wmm_ac_bk_txop_limit=0
#wmm_ac_bk_acm=0
#wmm_ac_be_aifs=3
#wmm_ac_be_cwmin=4
#wmm_ac_be_cwmax=10
#wmm_ac_be_txop_limit=0
#wmm_ac_be_acm=0
#wmm_ac_vi_aifs=2
#wmm_ac_vi_cwmin=3
#wmm_ac_vi_cwmax=4
#wmm_ac_vi_txop_limit=94
#wmm_ac_vi_acm=0
#wmm_ac_vo_aifs=2
#wmm_ac_vo_cwmin=2
#wmm_ac_vo_cwmax=3
#wmm_ac_vo_txop_limit=47
#wmm_ac_vo_acm=0
broadcast_deauth=1
eapol_key_index_workaround=0
eap_server=0
own_ip_addr=127.0.0.1
wpa=2
wpa_passphrase=password
wpa_key_mgmt=SAE WPA-PSK
rsn_pairwise=CCMP-256 CCMP
ieee80211w=1
sae_password=password6
sae_require_mfp=1
morrownr commented 1 year ago

Hi @desultory-zz

he_oper_centr_freq_seg0_idx=23 (This is required to set the center frequency for channel)

I still don't have a second device that is 6 GHz capable but should soon. I have been running WiFi 6 though.

It is not clear from the hostapd docs if the above is necessary if we use op_class=133. Can you test this?

Thanks for posting this. At some point, it might be nice to start a new post with this info. I am working on a 6e hostapd.conf for my AP mode stuff and I plan on posting it once I have the hardware to actually see if it works. What kind of range and speed are you seeing with 6 GHz?

ibrtuyima commented 1 year ago

in hostapd conf file, they clearly mention the following:

On the 6 GHz band the center freq calculation starts from 5.950 GHz offset.

For example idx=3 would result in 5965 MHz center frequency. **In addition,

he_oper_chwidth is ignored, and the channel width is derived from the

configured operating class or center frequency indexes (see

IEEE P802.11ax/D6.1 Annex E, Table E-4).**

so looking for IEEE P802.11ax/D6.1 Annex E, Table E-4, to understand how WIFI operates in 6Ghz band (https://mentor.ieee.org/802.11/dcn/20/11-20-0646-00-00ax-update-to-6ghz-operating-classes.docx)(Table E-4—Global operating classes)

Range is not so good, just few meters aways (3 - 6 meters).

Speed test as follows:

image

amisix commented 1 year ago

I was able to get this working on a Raspberry Pi 4B with a Comfast CF-953AX and @morrownr's extensive help. Thank you @ibrtuyima for your additional hostapd.conf settings. The speed isn't there yet but it's on the 6Ghz band!

A note: Windows 10 does not support Wifi 6e - you must use Windows 11 for a client if you're not using a capable linux version.

Wifi 6e iperf3 Number 1

Wifi 6e Windows 11

laszlo-t commented 1 year ago

FYI: I just happened to reread the title of this issue:

6ghz Access Point Creation with MT7921

The mt7921 chipset that you can do WiFi 6 as in AX. It cannot do 6 GHz channels. WiFi 6e can do 6 GHz channels. You need a mt7921k (for pcie) or mt7921au (for usb) to do 6 GHz channels. Take a look in your iw list output under band 4.

@morrownr I bought a Fenvi MPE-AX1800H mini pci-e card (MT7921) and it works for me. Access Point on 6Ghz (80Mhz, HU country code)

OpenWrt SNAPSHOT r22117-7ae4716243 / LuCI Master git-23.039.28596-41e9b8d

mt7921_6ghz_ap

root@OpenWrt:~# lspci | grep MEDIATEK
04:00.0 Network controller: MEDIATEK Corp. MT7921 802.11ax PCI Express Wireless Network Adapter

I'm using these firmware files: File: mediatek/WIFI_MT7961_patch_mcu_1_2_hdr.bin Version: 20230117170855a File: mediatek/WIFI_RAM_CODE_MT7961_1.bin Version: 20230117170942

root@OpenWrt:~# uname -a
Linux OpenWrt 5.15.94 #0 SMP Sun Feb 19 18:44:39 2023 x86_64 GNU/Linux

                Frequencies:
                        * 5955 MHz [1] (23.0 dBm)
                        * 5975 MHz [5] (23.0 dBm)
                        * 5995 MHz [9] (23.0 dBm)
                        * 6015 MHz [13] (23.0 dBm)
                        * 6035 MHz [17] (23.0 dBm)
                        * 6055 MHz [21] (23.0 dBm)
                        * 6075 MHz [25] (23.0 dBm)
                        * 6095 MHz [29] (23.0 dBm)
                        * 6115 MHz [33] (23.0 dBm)
                        * 6135 MHz [37] (23.0 dBm)
                        * 6155 MHz [41] (23.0 dBm)
                        * 6175 MHz [45] (23.0 dBm)
                        * 6195 MHz [49] (23.0 dBm)
                        * 6215 MHz [53] (23.0 dBm)
                        * 6235 MHz [57] (23.0 dBm)
                        * 6255 MHz [61] (23.0 dBm)
                        * 6275 MHz [65] (23.0 dBm)
                        * 6295 MHz [69] (23.0 dBm)
                        * 6315 MHz [73] (23.0 dBm)
                        * 6335 MHz [77] (23.0 dBm)
                        * 6355 MHz [81] (23.0 dBm)
                        * 6375 MHz [85] (23.0 dBm)
                        * 6395 MHz [89] (23.0 dBm)
                        * 6415 MHz [93] (23.0 dBm)
                        * 6435 MHz [97] (disabled)
                        * 6455 MHz [101] (disabled)
                        * 6475 MHz [105] (disabled)
                        * 6495 MHz [109] (disabled)
                        * 6515 MHz [113] (disabled)
                        * 6535 MHz [117] (disabled)
                        * 6555 MHz [121] (disabled)
                        * 6575 MHz [125] (disabled)
                        * 6595 MHz [129] (disabled)
                        * 6615 MHz [133] (disabled)
                        * 6635 MHz [137] (disabled)
                        * 6655 MHz [141] (disabled)
                        * 6675 MHz [145] (disabled)
                        * 6695 MHz [149] (disabled)
                        * 6715 MHz [153] (disabled)
                        * 6735 MHz [157] (disabled)
                        * 6755 MHz [161] (disabled)
                        * 6775 MHz [165] (disabled)
                        * 6795 MHz [169] (disabled)
                        * 6815 MHz [173] (disabled)
                        * 6835 MHz [177] (disabled)
                        * 6855 MHz [181] (disabled)
                        * 6875 MHz [185] (disabled)
                        * 6895 MHz [189] (disabled)
                        * 6915 MHz [193] (disabled)
                        * 6935 MHz [197] (disabled)
                        * 6955 MHz [201] (disabled)
                        * 6975 MHz [205] (disabled)
                        * 6995 MHz [209] (disabled)
                        * 7015 MHz [213] (disabled)
                        * 7035 MHz [217] (disabled)
                        * 7055 MHz [221] (disabled)
                        * 7075 MHz [225] (disabled)
                        * 7095 MHz [229] (disabled)
                        * 7115 MHz [233] (disabled)
laszlo-t commented 1 year ago

@morrownr can you update the pci-e wifi card list with the above?