mac80211: merge a LED related locking fix
[openwrt.git] / package / hostap-driver / files / lib / wifi / hostap.sh
index 8ad378b..1491c6d 100755 (executable)
@@ -39,6 +39,9 @@ scan_prism2() {
        config_get vifs "$device" vifs
        local _c=0
        for vif in $vifs; do
+               config_get_bool disabled "$vif" disabled 0
+               [ $disabled = 0 ] || continue
+
                config_get mode "$vif" mode
                case "$mode" in
                        adhoc|sta|ap|monitor)
@@ -112,7 +115,7 @@ enable_prism2() {
                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)
@@ -124,6 +127,7 @@ enable_prism2() {
                        ;;
                        ap) iwconfig "$phy" mode master;;
                        wds) iwpriv "$phy" wds_add "$ssid";;
+                       adhoc) iwconfig "$phy" mode ad-hoc;;
                        *) iwconfig "$phy" mode "$mode";;
                esac
 
@@ -220,7 +224,7 @@ enable_prism2() {
 
 }
 
-check_device() {
+check_prism2_device() {
        [ ${1%[0-9]} = "wlan" ] && config_set "$1" phy "$1"
        config_get phy "$1" phy
        [ -z "$phy" ] && {
@@ -242,10 +246,9 @@ detect_prism2() {
        [ -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
@@ -260,6 +263,7 @@ config wifi-iface
        option mode     ap
        option ssid     OpenWrt
        option encryption none
+
 EOF
        devidx=$(($devidx + 1))
        done
This page took 0.024382 seconds and 4 git commands to generate.