wireless_setup_vif_failed() {
local error="$1"
+ echo "Interface $_w_iface setup failed: $error"
}
wireless_setup_failed() {
local error="$1"
+ echo "Device setup failed: $error"
wireless_set_retry 0
}
hwmode_n="${hwmode##n}"
case "$channel" in
- 0|auto)
+ ""|0|auto)
channel=0
auto_channel=1
;;
- [0-9]+) ;;
+ [0-9]*) ;;
*)
wireless_setup_failed "INVALID_CHANNEL"
;;
esac
- [[ "$hwmode_n" = "$hwmode" ]] && {
+ [[ "$hwmode_n" = "$hwmode" ]] || {
enable_ht=1
hwmode="$hwmode_n"
_wireless_add_process() {
_wdev_notify_init $CMD_PROCESS_ADD
+ local exe="$2"
+ [ -L "$exe" ] && exe="$(readlink -f "$exe")"
json_add_int pid "$1"
- json_add_string exe "$2"
+ json_add_string exe "$exe"
[ -n "$3" ] && json_add_boolean required 1
+ exe2="$(readlink -f /proc/$pid/exe)"
+ [ "$exe" = "$exe2" ] && echo "WARNING (wireless_add_process): executable path $exe does not match process $1 path ($exe2)"
_wdev_notify
}
esac
}
-_get_vif_vars() {
- # internal use
- json_get_var _w_type mode
-
- # for drivers
- json_get_var network_bridge bridge
-}
-
for_each_interface() {
local _w_types="$1"; shift
local _w_ifaces _w_iface
for _w_iface in $_w_ifaces; do
json_select "$_w_iface"
if [ -n "$_w_types" ]; then
+ json_get_var network_bridge bridge
json_select config
- _get_vif_vars
+ json_get_var _w_type mode
json_select ..
_w_types=" $_w_types "
[[ "${_w_types%$_w_type*}" = "$_w_types" ]] && {
}
_wdev_common_device_config() {
- config_add_string channel hwmode
+ config_add_string channel hwmode htmode
}
_wdev_common_iface_config() {
- config_add_string mode ssid encryption key
+ config_add_string mode ssid encryption 'key:wpakey'
}
init_wireless_driver() {
case "$cmd" in
dump)
add_driver() {
+ eval "drv_$1_cleanup"
+
json_init
json_add_string name "$1"