luci-mod-network: support newer wireless.wifi-device.band option
authorJo-Philipp Wich <jo@mein.io>
Wed, 9 Jun 2021 07:59:15 +0000 (09:59 +0200)
committerJo-Philipp Wich <jo@mein.io>
Sat, 12 Jun 2021 18:01:57 +0000 (20:01 +0200)
commitab7717b2b40a553ebe967515d8d14c05269cdd2f
tree2a1123714f29335f67033e9d0f014751ebb4cd28
parentb9b279c4cc4c59e995afd4008e1ff4ea2091d25d
luci-mod-network: support newer wireless.wifi-device.band option

OpenWrt switched from "option hwmode" to "option band" in order to select
the frequency band to use for the radio phy.

Extend the channel selector to recognize and use an existing "option band"
to select the appropriate channel list. When operating upon a wireless
configuration still using "option hwmode", then translate it to a band
value internally and translate it back to "option hwmode" on save.

This should provide forward- and backwards compatibility with both current
OpenWrt master and older versions still using hwmode.

Fixes: #5106
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 0829d31290e7c902743fbd86ea91b06ee90c6e42)
modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js