Developing lightweight computation at the DSG edge

Commit da914aae authored by p4u's avatar p4u
Browse files

Some Ht40 new freatures added to wireless configuration, and list support for templates

parent 3dfe5cc5
......@@ -25,7 +25,6 @@ config 'qmp' 'wireless'
config 'wireless'
option 'mode' 'adhoc'
option 'channel' '44+'
option 'name' 'qMp'
config 'wireless'
......@@ -34,7 +33,4 @@ config 'wireless'
config 'wireless'
option 'mode' 'adhoc'
option 'name' 'qMp'
......@@ -57,6 +57,15 @@ qmp_uci_add_raw() {
return $r
}
qmp_uci_add_list_raw() {
uci -q add_list $@ > /dev/null
r=$?
uci commit
r=$(( $r + $? ))
[ $r -ne 0 ] && logger -t qMp "UCI returned an error (uci add_list $@)"
return $r
}
qmp_uci_import() {
cat "$1" | while read v; do
[ ! -z "$v" ] && uci set $v
......
......@@ -58,8 +58,6 @@ qmp_check_channel() {
[ "$ht40" == "+" ] && [ -z "$(echo $chaninfo | grep +)" ] && wrong=1
[ "$ht40" == "-" ] && [ -z "$(echo $chaninfo | grep -)" ] && wrong=1
qmp_log "Checking channel $chaninfo for $dev. Desicion=$wrong"
# If something wrong, asking for default parameter
[ $wrong -ne 0 ] && right_channel="$(qmp_wifi_get_default channel $dev $mode)"
......@@ -155,7 +153,8 @@ qmp_configure_wifi_device() {
index=$(qmp_find_wireless_iface $device)
cat $template | sed -e s/"#QMP_DEVICE"/"$device"/ \
# Non list arguments
cat $template | grep -v "^list " | sed -e s/"#QMP_DEVICE"/"$device"/ \
-e s/"#QMP_TYPE"/"$driver"/ \
-e s/"#QMP_MAC"/"$mac"/ \
-e s/"#QMP_CHANNEL"/"$channel"/ \
......@@ -167,6 +166,13 @@ qmp_configure_wifi_device() {
-e s/"#QMP_MODE"/"$mode"/ > $TMP/qmp_wireless_temp
qmp_uci_import $TMP/qmp_wireless_temp
# List arguments
cat $template | grep "^list " | sed s/"^list "//g | sed -e s/"#QMP_DEVICE"/"$device"/ | \
while read l; do
qmp_uci_add_list_raw $l
done
uci reorder wireless.@wifi-iface[$index]=16
uci commit
rm -f $TMP/qmp_wireless_temp
......
......@@ -9,6 +9,10 @@ wireless.#QMP_DEVICE.country=#QMP_COUNTRY
wireless.#QMP_DEVICE.outdoor=1
wireless.#QMP_DEVICE.hwmode=auto
wireless.#QMP_DEVICE.htmode=#QMP_HTMODE
list wireless.#QMP_DEVICE.ht_capab=SHORT-GI-40
list wireless.#QMP_DEVICE.ht_capab=TX-STBC
list wireless.#QMP_DEVICE.ht_capab=RX-STBC1
list wireless.#QMP_DEVICE.ht_capab=DSSS_CCK-40
wireless.@wifi-iface[#QMP_INDEX].device=#QMP_DEVICE
wireless.@wifi-iface[#QMP_INDEX].mode=adhoc
wireless.@wifi-iface[#QMP_INDEX].ssid=#QMP_SSID
......
......@@ -9,6 +9,10 @@ wireless.#QMP_DEVICE.country=#QMP_COUNTRY
wireless.#QMP_DEVICE.outdoor=1
wireless.#QMP_DEVICE.hwmode=auto
wireless.#QMP_DEVICE.htmode=#QMP_HTMODE
list wireless.#QMP_DEVICE.ht_capab=SHORT-GI-40
list wireless.#QMP_DEVICE.ht_capab=TX-STBC
list wireless.#QMP_DEVICE.ht_capab=RX-STBC1
list wireless.#QMP_DEVICE.ht_capab=DSSS_CCK-40
wireless.@wifi-iface[#QMP_INDEX].mode=ap
wireless.@wifi-iface[#QMP_INDEX].ssid=#QMP_SSID
wireless.@wifi-iface[#QMP_INDEX].encryption=none
......
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