Added support for 2.6.27 kernel
[openwrt.git] / package / broadcom-wl / files / lib / wifi / broadcom.sh
index 5f87282..e60674a 100644 (file)
@@ -5,10 +5,12 @@ scan_broadcom() {
        local wds
        local adhoc sta apmode mon
        local adhoc_if sta_if ap_if mon_if
        local wds
        local adhoc sta apmode mon
        local adhoc_if sta_if ap_if mon_if
+       local _c=0
 
        config_get vifs "$device" vifs
        for vif in $vifs; do
                config_get mode "$vif" mode
 
        config_get vifs "$device" vifs
        for vif in $vifs; do
                config_get mode "$vif" mode
+               _c=$(($_c + 1))
                case "$mode" in
                        adhoc)
                                adhoc=1
                case "$mode" in
                        adhoc)
                                adhoc=1
@@ -24,7 +26,10 @@ scan_broadcom() {
                        ;;
                        wds)
                                config_get addr "$vif" bssid
                        ;;
                        wds)
                                config_get addr "$vif" bssid
-                               [ -z "$addr" ] || append wds "$addr"
+                               [ -z "$addr" ] || {
+                                       addr=$(echo "$addr" | tr 'A-F' 'a-f')
+                                       append wds "$addr"
+                               }
                        ;;
                        monitor)
                                mon=1
                        ;;
                        monitor)
                                mon=1
@@ -50,7 +55,11 @@ scan_broadcom() {
 
        ap=1
        infra=1
 
        ap=1
        infra=1
-       mssid=1
+       if [ "$_c" -gt 1 ]; then
+               mssid=1
+       else
+               mssid=
+       fi
        apsta=0
        radio=1
        monitor=0
        apsta=0
        radio=1
        monitor=0
@@ -113,6 +122,7 @@ enable_broadcom() {
        config_get_bool frameburst "$device" frameburst
        config_get macfilter "$device" macfilter
        config_get maclist "$device" maclist
        config_get_bool frameburst "$device" frameburst
        config_get macfilter "$device" macfilter
        config_get maclist "$device" maclist
+       config_get macaddr "$device" macaddr
        local vif_pre_up vif_post_up vif_do_up
 
        _c=0
        local vif_pre_up vif_post_up vif_do_up
 
        _c=0
@@ -145,6 +155,7 @@ enable_broadcom() {
                config_get mode "$vif" mode
                append vif_pre_up "vif $_c" "$N"
                append vif_post_up "vif $_c" "$N"
                config_get mode "$vif" mode
                append vif_pre_up "vif $_c" "$N"
                append vif_post_up "vif $_c" "$N"
+               append vif_do_up "vif $_c" "$N"
                
                [ "$mode" = "sta" ] || {
                        config_get_bool hidden "$vif" hidden 0
                
                [ "$mode" = "sta" ] || {
                        config_get_bool hidden "$vif" hidden 0
@@ -202,7 +213,7 @@ enable_broadcom() {
                                        *) auth=2; wsec=2;;
                                esac
                                eval "${vif}_key=\"\$key\""
                                        *) auth=2; wsec=2;;
                                esac
                                eval "${vif}_key=\"\$key\""
-                               nasopts="-r \"\$${vif}_key\" -h $server -p $port"
+                               nasopts="-r \"\$${vif}_key\" -h $server -p ${port:-1812}"
                        ;;
                esac
                append vif_do_up "wsec $wsec" "$N"
                        ;;
                esac
                append vif_do_up "wsec $wsec" "$N"
@@ -224,6 +235,7 @@ enable_broadcom() {
                
                config_get ifname "$vif" ifname
                #append if_up "ifconfig $ifname up" ";$N"
                
                config_get ifname "$vif" ifname
                #append if_up "ifconfig $ifname up" ";$N"
+               [ -z "$macaddr" ] || append if_up "ifconfig $ifname hw ether $macaddr" ";$N"
                local net_cfg bridge
                net_cfg="$(find_net_config "$vif")"
                [ -z "$net_cfg" ] || {
                local net_cfg bridge
                net_cfg="$(find_net_config "$vif")"
                [ -z "$net_cfg" ] || {
This page took 0.028873 seconds and 4 git commands to generate.