From patchwork Wed Apr 29 19:49:33 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 9772 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 4g5SZ92Cmfz3wkr for ; Wed, 29 Apr 2026 19:49:53 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.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 4g5SZ90B1Nz7NG for ; Wed, 29 Apr 2026 19:49:53 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4g5SZ73DzXz333s for ; Wed, 29 Apr 2026 19:49:51 +0000 (UTC) X-Original-To: development@lists.ipfire.org Received: from mail01.ipfire.org (mail01.haj.ipfire.org [IPv6:2001:678:b28::25]) (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 4g5SYt2HfXz32g0 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 4g5SYt06vsz7H3; Wed, 29 Apr 2026 19:49:38 +0000 (UTC) Received: by michael.haj.ipfire.org (Postfix, from userid 0) id 4g5SYs6kGWzTj2T; Wed, 29 Apr 2026 19:49:37 +0000 (UTC) From: Michael Tremer To: development@lists.ipfire.org Cc: Michael Tremer Subject: [PATCH 8/9] hostapd: Fix 40 MHz flags when manually chosing the channel Date: Wed, 29 Apr 2026 19:49:33 +0000 Message-ID: <20260429194934.863108-8-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 Signed-off-by: Michael Tremer --- src/initscripts/packages/hostapd | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/initscripts/packages/hostapd b/src/initscripts/packages/hostapd index eb00e11d3..3d6ea4f69 100644 --- a/src/initscripts/packages/hostapd +++ b/src/initscripts/packages/hostapd @@ -189,6 +189,9 @@ write_config() { local he_caps=() local eht_caps=() + # Clear [HT40+][HT40-] + ht_flags="$(( ht_flags & ~0x0002 ))" + # HT Capabilities for flag in ${!HT_CAPS[@]}; do if (( ${ht_flags} & ${flag} )); then @@ -381,8 +384,32 @@ write_config() { local enable_n=0 case "${CONFIG["MODE"]}" in - HT*|VHT*|HE*|EHT*) + HT20|VHT20|HE20|EHT20) + enable_n=1 + ;; + + *40|*80|*160|*320) enable_n=1 + + case "${CONFIG["BAND"]}" in + 6g|5g) + case "$(( ((${CONFIG["CHANNEL"]} / 4) + channel_offset) % 2 ))" in + 0) + ht_caps+=( "[HT40-]" ) + ;; + 1) + ht_caps+=( "[HT40+]" ) + ;; + esac + ;; + 2g) + if [ "${CONFIG["CHANNEL"]}" -lt 7 ]; then + ht_caps+=( "[HT40+]" ) + else + ht_caps+=( "[HT40-]" ) + fi + ;; + esac ;; esac