]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
wlanap.cgi: Migrate to the new MODE parameter
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 22 Sep 2025 10:42:26 +0000 (12: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>
html/cgi-bin/wlanap.cgi

index 7b80da0546af415414d09cebd517e03265a38eda..faa7b9e2fdaad5b283274aa0f196b3cbad4873a7 100644 (file)
@@ -37,6 +37,18 @@ my %wlanapsettings=();
 # Read the configuration file
 &General::readhash("/var/ipfire/wlanap/settings", \%wlanapsettings);
 
+# Set MODE from HW_MODE
+unless (defined $wlanapsettings{'MODE'}) {
+       if ($wlanapsettings{'HW_MODE'} eq "ac") {
+               $wlanapsettings{'MODE'} = "VHT20";
+       } elsif ($wlanapsettings{'HW_MODE'} eq "an" || $wlanapsettings{'HW_MODE'} eq "gn") {
+               $wlanapsettings{'MODE'} = "HT20";
+       }
+
+       # Remove the old value
+       undef $wlanapsettings{'HW_MODE'};
+}
+
 # Set defaults
 &General::set_defaults(\%wlanapsettings, {
        "APMODE" => "on",
@@ -46,7 +58,7 @@ my %wlanapsettings=();
        "TXPOWER" => "auto",
        "CHANNEL" => "0",
        "COUNTRY" => "00",
-       "HW_MODE" => "g",
+       "MODE" => "HT20",
        "PWD" => "",
        "NOSCAN" => "on",
        "CLIENTISOLATION" => "off",