From 3ddcf50b800cfdfca92400a5922ff1575ff3a8a9 Mon Sep 17 00:00:00 2001
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Tue, 27 Oct 2015 01:56:10 +0100
Subject: [PATCH] Drop htmode field from config, always use HT20

Fixes #487
---
 docs/site-example/site.conf                            | 10 +---------
 docs/user/site.rst                                     |  2 --
 package/gluon-core/check_site.lua                      |  1 -
 .../gluon-core/files/lib/gluon/upgrade/200-wireless    |  2 +-
 4 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/docs/site-example/site.conf b/docs/site-example/site.conf
index 88e9b7341..c9381d93d 100644
--- a/docs/site-example/site.conf
+++ b/docs/site-example/site.conf
@@ -35,13 +35,6 @@
     -- Wireless channel.
     channel = 1,
 
-    -- Specifies the channel width in 802.11n and 802.11ac mode.
-    -- Possible values are:
-    -- HT20 (single 20MHz channel),
-    -- HT40- (2x 20MHz channels, secondary below)
-    -- HT40+ (2x 20MHz channels, secondary above)
-    htmode = 'HT20',
-
     -- ESSID used for client network.
     ap = {
       ssid = 'entenhausen.freifunk.net',
@@ -58,10 +51,9 @@
 
   -- Wireless configuration for 5 GHz interfaces.
   -- This should be equal to the 2.4 GHz variant, except
-  -- for channel and htmode.
+  -- for channel.
   wifi5 = {
     channel = 44,
-    htmode = 'HT20',
     ap = {
       ssid = 'entenhausen.freifunk.net',
     },
diff --git a/docs/user/site.rst b/docs/user/site.rst
index bcc811224..621900936 100644
--- a/docs/user/site.rst
+++ b/docs/user/site.rst
@@ -83,7 +83,6 @@ regdom : optional
 wifi24 : optional
     WLAN configuration for 2.4 GHz devices.
     ``channel`` must be set to a valid wireless channel for your radio.
-    ``htmode`` selects the desired htmode (e.g. HT20, HT40- or HT40+).
 
     There are currently three interface types available. You many choose to
     configure any subset of them:
@@ -108,7 +107,6 @@ wifi24 : optional
 
        wifi24 = {
          channel = 11,
-         htmode = 'HT20',
          ap = {
            ssid = 'entenhausen.freifunk.net',
          },
diff --git a/package/gluon-core/check_site.lua b/package/gluon-core/check_site.lua
index e752dd26f..1647d778e 100644
--- a/package/gluon-core/check_site.lua
+++ b/package/gluon-core/check_site.lua
@@ -28,6 +28,5 @@ for _, config in ipairs({'wifi24', 'wifi5'}) do
     need_string('regdom') -- regdom is only required when wifi24 or wifi5 is configured
 
     need_number(config .. '.channel')
-    need_string(config .. '.htmode')
   end
 end
diff --git a/package/gluon-core/files/lib/gluon/upgrade/200-wireless b/package/gluon-core/files/lib/gluon/upgrade/200-wireless
index ad47bb01b..1225fefde 100755
--- a/package/gluon-core/files/lib/gluon/upgrade/200-wireless
+++ b/package/gluon-core/files/lib/gluon/upgrade/200-wireless
@@ -17,7 +17,7 @@ local function configure_radio(radio, index, config)
     uci:delete('wireless', radio, 'disabled')
 
     uci:set('wireless', radio, 'channel', config.channel)
-    uci:set('wireless', radio, 'htmode', config.htmode)
+    uci:set('wireless', radio, 'htmode', 'HT20')
     uci:set('wireless', radio, 'country', site.regdom)
   end
 end
-- 
GitLab