summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2021-05-24 12:37:55 +0200
committerFelix Fietkau <nbd@nbd.name>2021-05-24 12:37:56 +0200
commit62e3cb52941032e13a8ad421454b9bc93382ef75 (patch)
treef354f7d05f0bc717dbb756b8350a4632869ce6ae /scripts
parent42c19303bff5853866292671df30e9cae0fd60d1 (diff)
downloadnetifd-62e3cb52941032e13a8ad421454b9bc93382ef75.tar.gz
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 <nbd@nbd.name>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/netifd-wireless.sh28
1 files 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() {