config_get ssid "$vif" ssid
config_get mode "$vif" mode
- [ "$mode" = "wds" ] || iwconfig "$phy" essid -- "$ssid"
+ [ "$mode" = "wds" ] || iwconfig "$phy" essid ${ssid:+-- }"${ssid:-any}"
case "$mode" in
sta)
;;
ap) iwconfig "$phy" mode master;;
wds) iwpriv "$phy" wds_add "$ssid";;
+ adhoc) iwconfig "$phy" mode ad-hoc;;
*) iwconfig "$phy" mode "$mode";;
esac
}
-check_device() {
+check_prism2_device() {
[ ${1%[0-9]} = "wlan" ] && config_set "$1" phy "$1"
config_get phy "$1" phy
[ -z "$phy" ] && {
[ -d wlan* ] || return
for dev in $(ls -d wlan* 2>&-); do
found=0
- config_foreach check_device wifi-device
+ config_foreach check_prism2_device wifi-device
[ "$found" -gt 0 ] && continue
cat <<EOF
-
config wifi-device radio$devidx
option type prism2
option channel 11
option mode ap
option ssid OpenWrt
option encryption none
+
EOF
devidx=$(($devidx + 1))
done