Developing lightweight computation at the DSG edge

Commit c979b4e4 authored by Roger Pueyo Centelles's avatar Roger Pueyo Centelles
Browse files

[qmp-system]: Improve support for 802.11s modes in qMp and wireless settings page.

This patch improves support for 802.11s modes in qMp, which is still in a preliminary support status.

Additionaly, wireless settings page and scripts have been modified to handle the new modes
and also to allow to control parameters like AP ESSID, etc.
parent ae344dfa
......@@ -239,6 +239,8 @@ qmp_configure_wifi_device() {
local mac="$(qmp_uci_get @wireless[$id].mac)"
local name="$(qmp_uci_get @wireless[$id].name)"
local essidap="$(qmp_uci_get @wireless[$id].essidap)"
local mesh80211s="$(qmp_uci_get @wireless[$id].mesh80211s)"
local driver="$(qmp_uci_get wireless.driver)"
local country="$(qmp_uci_get wireless.country)"
local mrate="$(qmp_uci_get wireless.mrate)"
......@@ -247,25 +249,30 @@ qmp_configure_wifi_device() {
local network="$(qmp_get_virtual_iface $device)"
local key="$(qmp_uci_get @wireless[$id].key)"
[ $(echo "$key" | wc -c) -lt 8 ] && encrypt="none" || encrypt="psk2"
local dev_id="$(echo $device | tr -d [A-z])"
dev_id=${dev_id:-$(date +%S)}
local radio="radio$dev_id"
echo "------------------------"
echo "Device $device"
echo "Mac $mac"
echo "Mode $mode"
echo "Driver $driver"
echo "Channel $channel"
echo "Country $country"
echo "Network $network"
echo "Name $name"
echo "HTmode $htmode"
echo "11mode $mode11"
echo "Mrate $mrate"
echo "Device $device"
echo "Mac $mac"
echo "Mode $mode"
echo "Driver $driver"
echo "Channel $channel"
echo "Country $country"
echo "Network $network"
echo "AdHoc ESSID $name"
echo "AP ESSID $essidap"
echo "Mesh network" $mesh80211s
echo "HTmode $htmode"
echo "11mode $mode11"
echo "Mrate $mrate"
echo "------------------------"
[ -z $essidap ] && essidap=$(echo ${name:0:29})"-AP"
[ -z $mesh80211s ] && mesh80211s="qMp"
local vap=0
[ $mode == "adhoc_ap" ] && {
mode="adhoc"
......@@ -303,6 +310,8 @@ qmp_configure_wifi_device() {
-e s/"#QMP_DEVICE"/"$device"/ \
-e s/"#QMP_IFNAME"/"$device"/ \
-e s/"#QMP_SSID"/"$(echo "${name:0:32}" | sed -e 's|/|\\/|g')"/ \
-e s/"#QMP_APSSID"/"$(echo "${essidap:0:32}" | sed -e 's|/|\\/|g')"/ \
-e s/"#QMP_MSSID"/"$(echo "${mesh80211s:0:32}" | sed -e 's|/|\\/|g')"/ \
-e s/"#QMP_BSSID"/"$bssid"/ \
-e s/"#QMP_NETWORK"/"$network"/ \
-e s/"#QMP_ENC"/"$encrypt"/ \
......@@ -317,7 +326,7 @@ qmp_configure_wifi_device() {
-e s/"#QMP_RADIO"/"$radio"/ \
-e s/"#QMP_DEVICE"/"${device}ap"/ \
-e s/"#QMP_IFNAME"/"${device}ap"/ \
-e s/"#QMP_SSID"/"$(echo "${name:0:29}-AP" | sed -e 's|/|\\/|g')"/ \
-e s/"#QMP_SSID"/"$(echo "${essidap:0:32}" | sed -e 's|/|\\/|g')"/ \
-e s/"#QMP_NETWORK"/"lan"/ \
-e s/"#QMP_ENC"/"$encrypt"/ \
-e s/"#QMP_KEY"/"$key"/ \
......
wireless.#QMP_DEVICE.device=#QMP_RADIO
wireless.#QMP_DEVICE.mode=mesh
wireless.#QMP_DEVICE.mesh_id=#QMP_SSID
wireless.#QMP_DEVICE.mesh_id=#QMP_MSSID
wireless.#QMP_DEVICE.network=#QMP_NETWORK
wireless.#QMP_DEVICE.ifname=#QMP_IFNAME
wireless.#QMP_DEVICE.mesh_fwding=0
......@@ -100,36 +100,6 @@ for _,wdev in ipairs(wdevs) do
mode:value("80211s_aplan","[EXPERIMENTAL] 802.11s (mesh) + access point (LAN)")
mode:value("none","Disabled")
-- Network name
local essid = s_wireless:option(Value,"name","ESSID", translate("Name of the WiFi network"))
-- maxlength is documented but not implemented
-- http://luci.subsignal.org/trac/wiki/Documentation/CBI#a.maxlengthnil
-- http://luci.subsignal.org/trac/browser/luci/trunk/libs/web/luasrc/cbi.lua?rev=9834#L1463
essid.maxlength = 32
--[[
essid.default = "qMp"
essid.depends = "adhoc_ap"
essid.depends = "adhoc"
essid.depends = "ap"
essid.depends = "aplan"
essid.depends = "client"
essid.depends = "clientwan"
-- Mesh network name
local 80211smesh = s_wireless:option(Value,"name","ESSID", translate("Name of the WiFi network"))
-- maxlength is documented but not implemented
-- http://luci.subsignal.org/trac/wiki/Documentation/CBI#a.maxlengthnil
-- http://luci.subsignal.org/trac/browser/luci/trunk/libs/web/luasrc/cbi.lua?rev=9834#L1463
essid.maxlength = 32
essid.default = "qMp"
essid.depends = "adhoc_ap"
essid.depends = "adhoc"
essid.depends = "ap"
essid.depends = "aplan"
essid.depends = "client"
essid.depends = "clientwan"
]]--
-- Channel
channel = s_wireless:option(ListValue,"channel","Channel",translate("WiFi channel to be used in this device.<br/>Selecting channels with + or - enables 40MHz bandwidth."))
mymode = m.uci:get("qmp",wdev,"mode")
......@@ -142,22 +112,56 @@ for _,wdev in ipairs(wdevs) do
if ch.channel < 15 then channel:value(ch.channel .. 'b', ch.channel .. 'b') end
end
end
-- Txpower
txpower = s_wireless:option(ListValue,"txpower",translate("Transmission power (dBm)"),translate("Radio power in dBm. Each 3 dB increment doubles the power."))
for _,t in ipairs(qmpinfo.get_txpower(mydev)) do
txpower:value(t,t)
end
-- maxlength is documented but not implemented
-- http://luci.subsignal.org/trac/wiki/Documentation/CBI#a.maxlengthnil
-- http://luci.subsignal.org/trac/browser/luci/trunk/libs/web/luasrc/cbi.lua?rev=9834#L1463
-- WPA key
-- Network ESSID for adhoc
local essid = s_wireless:option(Value,"name","Ad hoc ESSID",
translate("ESSID (network name) to broadcast in ad hoc mode. Every node can use a different one."))
essid.maxlength = 32
essid.default = "qMp"
essid:depends("mode","adhoc")
essid:depends("mode","adhoc_ap")
-- Network name for 80211s
local mesh80211s = s_wireless:option(Value,"mesh80211s","802.11s network",
translate("Name of the 802.11s mesh network. All the nodes must use the same network name."))
mesh80211s.maxlength = 32
mesh80211s.default = "qMp"
mesh80211s:depends("mode","80211s")
mesh80211s:depends("mode","80211s_aplan")
-- Network ESSID for ap or client
local essidap = s_wireless:option(Value,"essidap","AP ESSID",
translate("Name of the WiFi network (ESSID) for access point or client mode."))
essidap.maxlength = 27
essidap.default = "qMp-AP"
essidap:depends("mode","adhoc_ap")
essidap:depends("mode","ap")
essidap:depends("mode","aplan")
essidap:depends("mode","client")
essidap:depends("mode","clientwan")
essidap:depends("mode","80211s_aplan")
-- Network WPA2 key for ap or client
local key=s_wireless:option(Value,"key","WPA2 key",
translate("WPA2 key for AP mode. The minimum lenght is 8 characters.<br/>Leave blank to make it OPEN (recommended)"))
translate("WPA2 key for AP or client modes. The minimum lenght is 8 characters.<br/>Leave blank to make it OPEN (recommended)"))
key.default = ""
key:depends("mode","ap")
key:depends("mode","ap")
key:depends("mode","aplan")
key:depends("mode","adhoc_ap")
key:depends("mode","client")
key:depends("mode","clientwan")
key:depends("mode","80211s_aplan")
-- Txpower
txpower = s_wireless:option(ListValue,"txpower",translate("Transmission power (dBm)"),translate("Radio power in dBm. Each 3 dB increment doubles the power."))
for _,t in ipairs(qmpinfo.get_txpower(mydev)) do
txpower:value(t,t)
end
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment