ucode /usr/share/hostap/wdev.uc "$@"
}
+ubus_call() {
+ flock /var/run/hostapd.lock ubus call "$@"
+}
+
drv_mac80211_init_device_config() {
hostapd_common_add_device_config
ubus wait_for wpa_supplicant
}
- local supplicant_res="$(ubus call wpa_supplicant config_set "$data")"
+ local supplicant_res="$(ubus_call wpa_supplicant config_set "$data")"
ret="$?"
[ "$ret" != 0 -o -z "$supplicant_res" ] && wireless_setup_vif_failed WPA_SUPPLICANT_FAILED
hostapd_set_config() {
[ -n "$hostapd_ctrl" ] || {
- ubus call hostapd config_set '{ "phy": "'"$phy"'", "config": "", "prev_config": "'"${hostapd_conf_file}.prev"'" }' > /dev/null
+ ubus_call hostapd config_set '{ "phy": "'"$phy"'", "config": "", "prev_config": "'"${hostapd_conf_file}.prev"'" }' > /dev/null
return 0;
}
ubus wait_for hostapd
- local hostapd_res="$(ubus call hostapd config_set "{ \"phy\": \"$phy\", \"config\":\"${hostapd_conf_file}\", \"prev_config\": \"${hostapd_conf_file}.prev\"}")"
+ local hostapd_res="$(ubus_call hostapd config_set "{ \"phy\": \"$phy\", \"config\":\"${hostapd_conf_file}\", \"prev_config\": \"${hostapd_conf_file}.prev\"}")"
ret="$?"
[ "$ret" != 0 -o -z "$hostapd_res" ] && {
wireless_setup_failed HOSTAPD_START_FAILED
[ -n "$wpa_supp_init" ] || return 0
- ubus call wpa_supplicant config_set '{ "phy": "'"$phy"'" }' > /dev/null
+ ubus_call wpa_supplicant config_set '{ "phy": "'"$phy"'" }' > /dev/null
}
mac80211_setup_supplicant() {
local phy="$1"
hostapd_conf_file="/var/run/hostapd-$phy.conf"
- ubus call hostapd config_set '{ "phy": "'"$phy"'", "config": "", "prev_config": "'"$hostapd_conf_file"'" }' > /dev/null
- ubus call wpa_supplicant config_set '{ "phy": "'"$phy"'", "config": [] }' > /dev/null
+ ubus_call hostapd config_set '{ "phy": "'"$phy"'", "config": "", "prev_config": "'"$hostapd_conf_file"'" }' > /dev/null
+ ubus_call wpa_supplicant config_set '{ "phy": "'"$phy"'", "config": [] }' > /dev/null
wdev_tool "$phy" set_config '{}'
}