]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
hostapd: Optionally select which antennas to use
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 23 Jul 2025 15:42:14 +0000 (17:42 +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 7ac9daa58cc010ccc630da7ef039e6086d2586c5..84576e3780d752ab4db29d07ff9deb92ef266e93 100644 (file)
@@ -516,6 +516,17 @@ write_config() {
                echo "ht_capab=${ht_caps[@]}"
        fi
 
+       # Configure antennas
+       if [ -z "${RX_ANTENNAS}" ]; then
+               RX_ANTENNAS="0xffffffff"
+       fi
+       if [ -z "${TX_ANTENNAS}" ]; then
+               TX_ANTENNAS="0xffffffff"
+       fi
+
+       # Set the antennas to use
+       iw phy "${phy}" set antenna "${TX_ANTENNAS}" "${RX_ANTENNAS}" &>/dev/null
+
        # Enable authentication
        echo "auth_algs=1"