]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
hostapd: Filter out some unsupported VHT caps by driver
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 23 Jul 2025 13:46:09 +0000 (15:46 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 22 Sep 2025 11:46:24 +0000 (11:46 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/initscripts/packages/hostapd

index 0e58c3f1cf4743350a3d8004454d60e9fb3f3c3b..53d77545fc8c1a262f2af7fdc851aba06e55ffee 100644 (file)
@@ -86,6 +86,11 @@ declare -A VHT_CAPS=(
        [0x20000000]="[TX-ANTENNA-PATTERN]"
 )
 
+declare -A VHT_CAPS_DRIVER_FILTERS=(
+       # ath12k does not support Short GI for 160 MHz
+       [ath12k_pci]="$(( 0xffffffff & ~0x00000020 ))"
+)
+
 find_interface() {
        local address="${1}"
 
@@ -137,6 +142,12 @@ write_config() {
                ht_flags="$(( ${ht_flags} & ${HT_CAPS_DRIVER_FILTERS[${driver}]} ))"
        fi
 
+       # Fix the VHT caps because some drivers don't support everything
+       # that the actual hardware supports (or have it turned off because of bugs).
+       if [ -n "${VHT_CAPS_DRIVER_FILTERS[${driver}]}" ]; then
+               vht_flags="$(( ${vht_flags} & ${VHT_CAPS_DRIVER_FILTERS[${driver}]} ))"
+       fi
+
        # HT Capabilities
        for flag in ${!HT_CAPS[@]}; do
                if (( ${ht_flags} & ${flag} )); then