[cavium-octeon] enable command line mtd partitionning and enable bridging
[openwrt.git] / package / madwifi / files / lib / wifi / madwifi.sh
index 52086f0..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
@@ -120,10 +122,10 @@ enable_atheros() {
                        *fh) hwmode=fh;;
                        *) hwmode=auto;;
                esac
-               iwpriv "$ifname" mode "$hwmode"
                iwpriv "$ifname" pureg "$pureg"
 
                [ "$first" = 1 ] && {
+                       iwpriv "$ifname" mode "$hwmode"
                        iwconfig "$ifname" channel "$channel" >/dev/null 2>/dev/null 
                }
        
@@ -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%%.*}"
@@ -257,6 +259,9 @@ enable_atheros() {
                config_get_bool turbo "$vif" turbo
                [ -n "$turbo" ] && iwpriv "$ifname" turbo "$turbo"
 
+               config_get_bool beacon_power "$vif" beacon_power
+               [ -n "$beacon_power" ] && iwpriv "$ifname" beacon_pwr "$beacon_power"
+
                config_get_bool doth "$vif" doth 0
                [ -n "$doth" ] && iwpriv "$ifname" doth "$doth"
 
@@ -295,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.025177 seconds and 4 git commands to generate.