add ssize_t definition to site files, fix up size for x86_64
[openwrt.git] / package / madwifi / files / lib / wifi / madwifi.sh
index be4cad0..9d08e1f 100755 (executable)
@@ -18,14 +18,13 @@ scan_atheros() {
                                append $mode "$vif"
                        ;;
                        wds)
                                append $mode "$vif"
                        ;;
                        wds)
-                               config_get addr "$vif" bssid
                                config_get ssid "$vif" ssid
                                config_get ssid "$vif" ssid
-                               [ -z "$addr" -a -n "$ssid" ] && {
-                                       config_set "$vif" wds 1
-                                       config_set "$vif" mode sta
-                                       mode="sta"
-                                       addr="$ssid"
-                               }
+                               [ -z "$ssid" ] && continue
+
+                               config_set "$vif" wds 1
+                               config_set "$vif" mode sta
+                               mode="sta"
+                               addr="$ssid"
                                ${addr:+append $mode "$vif"}
                        ;;
                        *) echo "$device($vif): Invalid mode, ignored."; continue;;
                                ${addr:+append $mode "$vif"}
                        ;;
                        *) echo "$device($vif): Invalid mode, ignored."; continue;;
@@ -120,9 +119,6 @@ enable_atheros() {
                        iwpriv "$ifname" ff "$ff"
                fi
 
                        iwpriv "$ifname" ff "$ff"
                fi
 
-               config_get wdssep "$vif" wdssep
-               [ -n "$wdssep" ] && iwpriv "$ifname" wdssep "$wdssep"
-
                config_get wds "$vif" wds
                case "$wds" in
                        1|on|enabled) wds=1;;
                config_get wds "$vif" wds
                case "$wds" in
                        1|on|enabled) wds=1;;
@@ -130,6 +126,11 @@ enable_atheros() {
                esac
                iwpriv "$ifname" wds "$wds"
 
                esac
                iwpriv "$ifname" wds "$wds"
 
+               [ "$mode" = ap -a "$wds" = 1 ] && {
+                       config_get_bool wdssep "$vif" wdssep 1
+                       [ -n "$wdssep" ] && iwpriv "$ifname" wdssep "$wdssep"
+               }
+
                wpa=
                case "$enc" in
                        WEP|wep)
                wpa=
                case "$enc" in
                        WEP|wep)
@@ -150,10 +151,6 @@ enable_atheros() {
                esac
 
                case "$mode" in
                esac
 
                case "$mode" in
-                       wds)
-                               config_get addr "$vif" bssid
-                               iwpriv "$ifname" wds_add "$addr"
-                       ;;
                        adhoc|ahdemo)
                                config_get addr "$vif" bssid
                                [ -z "$addr" ] || { 
                        adhoc|ahdemo)
                                config_get addr "$vif" bssid
                                [ -z "$addr" ] || { 
This page took 0.02807 seconds and 4 git commands to generate.