use the madwifi driver instead of wext in the wpa_supplicant command line. the madwif...
[openwrt.git] / package / madwifi / files / lib / wifi / madwifi.sh
index 5adeee4..be4cad0 100755 (executable)
@@ -14,7 +14,7 @@ scan_atheros() {
                
                config_get mode "$vif" mode
                case "$mode" in
-                       adhoc|ahdemo|sta|ap)
+                       adhoc|ahdemo|sta|ap|monitor)
                                append $mode "$vif"
                        ;;
                        wds)
@@ -43,7 +43,7 @@ scan_atheros() {
                *) echo "$device: Invalid mode combination in config"; return 1;;
        esac
 
-       config_set "$device" vifs "${ap:+$ap }${adhoc:+$adhoc }${ahdemo:+$ahdemo }${sta:+$sta }${wds:+$wds }"
+       config_set "$device" vifs "${ap:+$ap }${adhoc:+$adhoc }${ahdemo:+$ahdemo }${sta:+$sta }${wds:+$wds }${monitor:+$monitor}"
 }
 
 
@@ -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
@@ -120,6 +120,9 @@ enable_atheros() {
                        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;;
@@ -190,9 +193,6 @@ enable_atheros() {
                config_get rts "$vif" rts
                [ -n "$rts" ] && iwconfig "$ifname" rts "${rts%%.*}"
 
-               config_get_bool doth "$vif" 80211h
-               [ -n "$doth" ] && iwpriv "$ifname" doth "$doth"
-
                config_get_bool comp "$vif" compression
                [ -n "$comp" ] && iwpriv "$ifname" compression "$comp"
 
@@ -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" ] || {
@@ -306,7 +304,7 @@ EOF
                                                #add wpa_supplicant calls here
                                        ;;
                                esac
-                               [ -z "$proto" ] || wpa_supplicant ${bridge:+ -b $bridge} -B -D wext -i "$ifname" -c /var/run/wpa_supplicant-$ifname.conf
+                               [ -z "$proto" ] || wpa_supplicant ${bridge:+ -b $bridge} -B -D madwifi -i "$ifname" -c /var/run/wpa_supplicant-$ifname.conf
                        ;;
                esac
                first=0