From 6f454294df0af17c883ad7fc5339eb245b37a2c6 Mon Sep 17 00:00:00 2001 From: billz Date: Tue, 7 Nov 2023 14:06:57 +0000 Subject: [PATCH] Constants for 5GHz channel min/max --- config/config.php | 3 ++- includes/hostapd.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config/config.php b/config/config.php index 74b75da39..20debf6a4 100755 --- a/config/config.php +++ b/config/config.php @@ -32,7 +32,8 @@ define('RASPI_ACCESS_CHECK_DNS', 'one.one.one.one'); // Constant for the 5GHz wireless regulatory domain -define("HOSTAPD_5GHZ_CHANNEL_MIN", 100); +define("RASPI_5GHZ_CHANNEL_MIN", 100); +define("RASPI_5GHZ_CHANNEL_MAX", 192); // Enable basic authentication for the web admin. define('RASPI_AUTH_ENABLED', true); diff --git a/includes/hostapd.php b/includes/hostapd.php index 90ac4fcc0..36411f35e 100755 --- a/includes/hostapd.php +++ b/includes/hostapd.php @@ -190,7 +190,7 @@ function SaveHostAPDConfig($wpa_array, $enc_types, $modes, $interfaces, $reg_dom $status->addMessage('Attempting to set channel to invalid number.', 'danger'); $good_input = false; } - if (intval($_POST['channel']) < 1 || intval($_POST['channel']) > RASPI_5GHZ_MAX_CHANNEL) { + if (intval($_POST['channel']) < 1 || intval($_POST['channel']) > RASPI_5GHZ_CHANNEL_MAX) { $status->addMessage('Attempting to set channel outside of permitted range', 'danger'); $good_input = false; } @@ -445,7 +445,7 @@ function updateHostapdConfig($ignore_broadcast_ssid,$wifiAPEnable,$bridgedEnable $config.= 'channel='.$_POST['channel'].PHP_EOL; // Set VHT center frequency segment value - if ((int)$_POST['channel'] < HOSTAPD_5GHZ_CHANNEL_MIN) { + if ((int)$_POST['channel'] < RASPI_5GHZ_CHANNEL_MIN) { $vht_freq_idx = 42; } else { $vht_freq_idx = 155;