fix madwifi mode setting
authorFelix Fietkau <nbd@openwrt.org>
Sun, 20 Jul 2008 00:51:00 +0000 (00:51 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 20 Jul 2008 00:51:00 +0000 (00:51 +0000)
SVN-Revision: 11882

package/madwifi/files/lib/wifi/madwifi.sh

index 5adeee44be32651b2ed0a51d3cf0af99163a9346..97ad52bae27b5c0f96e1881fa0fee80dcf8e152f 100755 (executable)
@@ -97,6 +97,8 @@ enable_atheros() {
                [ "$first" = 1 ] && {
                        # only need to change freq band and channel on the first vif
                        config_get agmode "$device" agmode
+                       [ -z "$agmode" ] && config_get agmode "$device" mode
+
                        pureg=0
                        case "$agmode" in
                                *b) agmode=11b;;
@@ -105,11 +107,9 @@ enable_atheros() {
                                *a) agmode=11a;;
                                *) agmode=auto;;
                        esac
-                       iwconfig "$ifname" channel "$channel" >/dev/null 2>/dev/null 
                        iwpriv "$ifname" mode "$agmode"
                        iwpriv "$ifname" pureg "$pureg"
                        iwconfig "$ifname" channel "$channel" >/dev/null 2>/dev/null 
-                       ifconfig "$ifname" up
                }
        
                config_get_bool hidden "$vif" hidden 0
@@ -244,8 +244,6 @@ enable_atheros() {
                esac
 
                ifconfig "$ifname" up
-               iwconfig "$ifname" channel "$channel" >/dev/null 2>/dev/null 
-
                local net_cfg bridge
                net_cfg="$(find_net_config "$vif")"
                [ -z "$net_cfg" ] || {