From: Michael Tremer <michael.tremer@ipfire.org>
To: development@lists.ipfire.org
Cc: Michael Tremer <michael.tremer@ipfire.org>
Subject: [PATCH 4/9] hostapd: Add support for the 6 GHz band
Date: Wed, 29 Apr 2026 19:49:29 +0000 [thread overview]
Message-ID: <20260429194934.863108-4-michael.tremer@ipfire.org> (raw)
In-Reply-To: <20260429194934.863108-1-michael.tremer@ipfire.org>
This is mainly adding any center frequencies when the user manually
choses a channel.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
---
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"
--
2.47.3
next prev parent reply other threads:[~2026-04-29 19:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-29 19:49 [PATCH 1/9] hostapd: Force setting reg domain before hostapd starts Michael Tremer
2026-04-29 19:49 ` [PATCH 2/9] wlanap.cgi: Add option to select 6 GHz band Michael Tremer
2026-04-29 19:49 ` [PATCH 3/9] hostapd: Correctly parse capabilities for the " Michael Tremer
2026-04-29 19:49 ` Michael Tremer [this message]
2026-04-29 19:49 ` [PATCH 5/9] hostapd: Configure as indoor AP and increase transmit power Michael Tremer
2026-04-29 19:49 ` [PATCH 6/9] hostapd: Disable 802.11n in 6 GHz band, too Michael Tremer
2026-04-29 19:49 ` [PATCH 7/9] hostapd: Tell the AP that the antennas won't change Michael Tremer
2026-04-29 19:49 ` [PATCH 8/9] hostapd: Fix 40 MHz flags when manually chosing the channel Michael Tremer
2026-04-29 19:49 ` [PATCH 9/9] hostapd: Bump version Michael Tremer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260429194934.863108-4-michael.tremer@ipfire.org \
--to=michael.tremer@ipfire.org \
--cc=development@lists.ipfire.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox