From 62e3cb52941032e13a8ad421454b9bc93382ef75 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 24 May 2021 12:37:55 +0200 Subject: [PATCH] scripts/netifd-wireless.sh: add support for specifying the operating band Add the new 'band' option, which supports the following values: 2g, 5g, 6g, 60g Signed-off-by: Felix Fietkau --- scripts/netifd-wireless.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/scripts/netifd-wireless.sh b/scripts/netifd-wireless.sh index d915402..b920296 100644 --- a/scripts/netifd-wireless.sh +++ b/scripts/netifd-wireless.sh @@ -39,13 +39,12 @@ prepare_key_wep() { } _wdev_prepare_channel() { - json_get_vars channel hwmode + json_get_vars channel band hwmode auto_channel=0 enable_ht=0 htmode= hwmode="${hwmode##11}" - hwmode_n="${hwmode##n}" case "$channel" in ""|0|auto) @@ -58,17 +57,6 @@ _wdev_prepare_channel() { ;; esac - [[ "$hwmode_n" = "$hwmode" ]] || { - enable_ht=1 - hwmode="$hwmode_n" - - json_get_vars htmode - case "$htmode" in - HT20|HT40+|HT40-);; - *) htmode= ;; - esac - } - case "$hwmode" in a|b|g|ad) ;; *) @@ -79,6 +67,18 @@ _wdev_prepare_channel() { fi ;; esac + + case "$band" in + 2g) hwmode=g;; + 5g|6g|60g) hwmode=a;; + *) + case "$hwmode" in + *a) band=5g;; + *ad) band=60g;; + *b|*g) band=2g;; + esac + ;; + esac } _wdev_handler() { @@ -362,7 +362,7 @@ for_each_station() { } _wdev_common_device_config() { - config_add_string channel hwmode htmode noscan + config_add_string channel hwmode band htmode noscan } _wdev_common_iface_config() { -- 2.30.2