From patchwork Wed Apr 29 19:49:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 9767 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail01.haj.ipfire.org", Issuer "R12" (not verified)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4g5SZ32jh0z3x94 for ; Wed, 29 Apr 2026 19:49:47 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [IPv6:2001:678:b28::201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail02.haj.ipfire.org", Issuer "E8" (not verified)) by mail01.ipfire.org (Postfix) with ESMTPS id 4g5SZ24dyfz7Pb for ; Wed, 29 Apr 2026 19:49:46 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4g5SZ16ZB1z333n for ; Wed, 29 Apr 2026 19:49:45 +0000 (UTC) X-Original-To: development@lists.ipfire.org Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail01.haj.ipfire.org", Issuer "R12" (not verified)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4g5SYt0Yvzz30HY for ; Wed, 29 Apr 2026 19:49:38 +0000 (UTC) Received: from michael.haj.ipfire.org (michael.haj.ipfire.org [172.28.1.242]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "michael.haj.ipfire.org", Issuer "E7" (not verified)) by mail01.ipfire.org (Postfix) with ESMTPS id 4g5SYs6RS5z5hT; Wed, 29 Apr 2026 19:49:37 +0000 (UTC) Received: by michael.haj.ipfire.org (Postfix, from userid 0) id 4g5SYs4F0YzTj3W; Wed, 29 Apr 2026 19:49:37 +0000 (UTC) From: Michael Tremer To: development@lists.ipfire.org Cc: Michael Tremer Subject: [PATCH 4/9] hostapd: Add support for the 6 GHz band Date: Wed, 29 Apr 2026 19:49:29 +0000 Message-ID: <20260429194934.863108-4-michael.tremer@ipfire.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260429194934.863108-1-michael.tremer@ipfire.org> References: <20260429194934.863108-1-michael.tremer@ipfire.org> Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 This is mainly adding any center frequencies when the user manually choses a channel. Signed-off-by: Michael Tremer --- config/hostapd/config | 4 +- src/initscripts/packages/hostapd | 129 ++++++++++++++++++++++++++++--- 2 files changed, 120 insertions(+), 13 deletions(-) diff --git a/config/hostapd/config b/config/hostapd/config index 8bf19375b..7bda725a7 100644 --- a/config/hostapd/config +++ b/config/hostapd/config @@ -375,9 +375,9 @@ CONFIG_MBO=y CONFIG_TAXONOMY=y # Fast Initial Link Setup (FILS) (IEEE 802.11ai) -#CONFIG_FILS=y +CONFIG_FILS=y # FILS shared key authentication with PFS -#CONFIG_FILS_SK_PFS=y +CONFIG_FILS_SK_PFS=y # Include internal line edit mode in hostapd_cli. This can be used to provide # limited command line editing and history support. diff --git a/src/initscripts/packages/hostapd b/src/initscripts/packages/hostapd index 0bd90bda2..c8d3ffce1 100644 --- a/src/initscripts/packages/hostapd +++ b/src/initscripts/packages/hostapd @@ -125,6 +125,7 @@ write_config() { local he_phy_flags=0 local eht_mac_flags=0 local eht_phy_flags=0 + local channel_offset # Set some default BAND if none is set if [ -z "${CONFIG["BAND"]}" ]; then @@ -332,6 +333,16 @@ write_config() { esac fi + # Set channel offset + case "${CONFIG["BAND"]}" in + 6g) + channel_offset=1 + ;; + *) + channel_offset=0 + ;; + esac + # Header echo "# Automatically generated configuration" echo "# DO NOT EDIT" @@ -391,7 +402,7 @@ write_config() { # Compute the channel segment index if [ "${CONFIG["CHANNEL"]}" -gt 0 ]; then - case "$(( (${CONFIG["CHANNEL"]} / 4) % 2 ))" in + case "$(( ((${CONFIG["CHANNEL"]} / 4) + channel_offset) % 2 ))" in 0) vht_oper_centr_freq_seg0_idx="$(( ${CONFIG["CHANNEL"]} - 2 ))" ;; @@ -409,7 +420,7 @@ write_config() { # Compute the channel segment index if [ "${CONFIG["CHANNEL"]}" -gt 0 ]; then - case "$(( (${CONFIG["CHANNEL"]} / 4) % 4 ))" in + case "$(( ((${CONFIG["CHANNEL"]} / 4) + channel_offset) % 4 ))" in 0) vht_oper_centr_freq_seg0_idx="$(( ${CONFIG["CHANNEL"]} - 6 ))" ;; @@ -433,15 +444,46 @@ write_config() { # Compute the channel segment index if [ "${CONFIG["CHANNEL"]}" -gt 0 ]; then - case "${CONFIG["CHANNEL"]}" in - 36|40|44|48|52|56|60|64) - vht_oper_centr_freq_seg0_idx=50 - ;; - 100|104|108|112|116|120|124|128) - vht_oper_centr_freq_seg0_idx=114 + case "${CONFIG["BAND"]}" in + # 6 GHz + 6g) + case "${CONFIG["CHANNEL"]}" in + 1|5|9|13|17|21|25|29) + vht_oper_centr_freq_seg0_idx=15 + ;; + 33|37|41|45|49|53|57|61) + vht_oper_centr_freq_seg0_idx=47 + ;; + 65|69|73|77|81|85|89|93) + vht_oper_centr_freq_seg0_idx=79 + ;; + 97|101|105|109|113|117|121|125) + vht_oper_centr_freq_seg0_idx=111 + ;; + 129|133|137|141|145|149|153|157) + vht_oper_centr_freq_seg0_idx=143 + ;; + 161|165|169|173|177|181|185|189) + vht_oper_centr_freq_seg0_idx=175 + ;; + 193|197|201|205|209|213|217|221) + vht_oper_centr_freq_seg0_idx=207 + ;; + esac ;; - 149|153|157|161|165|169|173|177) - vht_oper_centr_freq_seg0_idx=163 + # 5 GHz + 5g) + case "${CONFIG["CHANNEL"]}" in + 36|40|44|48|52|56|60|64) + vht_oper_centr_freq_seg0_idx=50 + ;; + 100|104|108|112|116|120|124|128) + vht_oper_centr_freq_seg0_idx=114 + ;; + 149|153|157|161|165|169|173|177) + vht_oper_centr_freq_seg0_idx=163 + ;; + esac ;; esac fi @@ -465,6 +507,31 @@ write_config() { local eht_oper_centr_freq_seg0_idx="${he_oper_centr_freq_seg0_idx}" case "${CONFIG["MODE"]}" in + EHT320) + enable_be=1 + eht_oper_chwidth=9 + + # Compute the channel segment index + case "${CONFIG["BAND"]}" in + 6g) + case "${CONFIG["CHANNEL"]}" in + 1|5|9|13|17|21|25|29|33|37|41|45|49|53|57|61) + eht_oper_centr_freq_seg0_idx=31 + ;; + 65|69|73|77|81|85|89|93|97|101|105|109|113|117|121|125) + eht_oper_centr_freq_seg0_idx=95 + ;; + 129|133|137|141|145|149|153|157|161|165|169|173|177|181|185|189) + eht_oper_centr_freq_seg0_idx=159 + ;; + 193|197|201|205|209|213|217|221) + eht_oper_centr_freq_seg0_idx=191 + ;; + esac + ;; + esac + ;; + EHT*) enable_be=1 ;; @@ -472,7 +539,7 @@ write_config() { # Set hardware mode case "${CONFIG["BAND"]}" in - 5g) + 6g|5g) echo "hw_mode=a" ;; 2g) @@ -480,6 +547,46 @@ write_config() { ;; esac + # Adjust settings for 6 GHz + case "${CONFIG["BAND"]}" in + 6g) + # Disable 802.11ac + enable_ac=0 + + # Enable 802.11w management frame protection + CONFIG["IEEE80211W"]="on" + + # Send FILS Discovery frames every 20 TUs (~20 ms) + # for faster AP detection by the clients + echo "fils_discovery_min_interval=20" + echo "fils_discovery_max_interval=20" + ;; + esac + + local op_class= + + # Configure global operating class + case "${CONFIG["BAND"]}" in + 6g) + case "${CONFIG["MODE"]}" in + EHT320) + op_class=137 + ;; + HE20|EHT20) + op_class=131 + ;; + HE*|EHT*) + op_class="$(( 132 + vht_oper_chwidth ))" + ;; + esac + ;; + esac + + # Set global operating class + if [ -n "${op_class}" ]; then + echo "op_class=${op_class}" + fi + # Enable 802.11be? if [ "${enable_be}" -eq 1 ]; then echo "ieee80211be=1"