[cavium-octeon] enable command line mtd partitionning and enable bridging
[openwrt.git] / package / madwifi / files / lib / wifi / madwifi.sh
index 0124285..24d371b 100755 (executable)
@@ -67,15 +67,17 @@ disable_atheros() (
 
 enable_atheros() {
        local device="$1"
-       # Can only set the country code to one setting for the entire system. The last country code is the one that will be applied.
+
+       config_get regdomain "$device" regdomain
+       [ -n "$regdomain" ] && echo "$regdomain" > /proc/sys/dev/$device/regdomain
+
        config_get country "$device" country
        [ -z "$country" ] && country="0"
-       local cc="0"
-       [ -e /proc/sys/dev/$device/countrycode ] && cc="$(cat /proc/sys/dev/$device/countrycode)"
-       if [ ! "$cc" = "$country" ] ; then
-               rmmod ath_pci
-               insmod ath_pci countrycode=$country
-       fi
+       echo "$country" > /proc/sys/dev/$device/countrycode
+
+       config_get_bool outdoor "$device" outdoor "0"
+       echo "$outdoor" > /proc/sys/dev/$device/outdoor
+
        config_get channel "$device" channel
        config_get vifs "$device" vifs
        config_get txpower "$device" txpower
@@ -167,7 +169,7 @@ enable_atheros() {
                esac
 
                case "$mode" in
-                       adhoc|ahdemo)
+                       sta|adhoc|ahdemo)
                                config_get addr "$vif" bssid
                                [ -z "$addr" ] || { 
                                        iwconfig "$ifname" ap "$addr"
@@ -219,7 +221,7 @@ enable_atheros() {
                [ -n "$softled" ] && sysctl -w dev."$device".softled="$softled" >&-
 
                config_get distance "$device" distance
-               [ -n "$distance" ] && athctrl -i "$device" -d "$distance" >&-
+               [ -n "$distance" ] && sysctl -w dev."$device".distance="$distance" >&-
 
                config_get rate "$vif" rate
                [ -n "$rate" ] && iwconfig "$ifname" rate "${rate%%.*}"
@@ -298,8 +300,10 @@ enable_atheros() {
                        config_set "$vif" bridge "$bridge"
                        start_net "$ifname" "$net_cfg"
                }
-               [ -n "$ssid" ] && iwconfig "$ifname" essid on
-               iwconfig "$ifname" essid "$ssid"
+               [ -n "$ssid" ] && {
+                       iwconfig "$ifname" essid on
+                       iwconfig "$ifname" essid "$ssid"
+               }
                set_wifi_up "$vif" "$ifname"
 
                # TXPower settings only work if device is up already
This page took 0.027718 seconds and 4 git commands to generate.