add vlan_mode 0 command to fix the weird google issue in broadcom-wl
[openwrt.git] / package / broadcom-wl / files / lib / wifi / broadcom.sh
index 33a3ebb..2c95102 100644 (file)
@@ -1,3 +1,15 @@
+bridge_interface() {
+       (
+               . /etc/functions.sh
+               include network
+               scan_interfaces
+               cfg="$(find_config "$1")"
+               [ -z "$cfg" ] && return 0
+               config_get iftype "$cfg" type
+               [ "$iftype" = bridge ] && config_get "$iftype" bridge
+       )
+}
+
 scan_broadcom() {
        local device="$1"
 
@@ -69,6 +81,7 @@ setup_broadcom() {
        _c=0
        nas="$(which nas)"
        nas_cmd=
+       if_up=
        for vif in ${adhoc_if:-$sta_if $ap_if}; do
                append vif_pre_up "vif $_c" "$N"
                append vif_post_up "vif $_c" "$N"
@@ -123,18 +136,19 @@ setup_broadcom() {
                append vif_post_up "ssid $ssid" "$N"
                append vif_post_up "enabled 1" "$N"
                
+               config_get ifname "$vif" ifname
+               append if_up "ifconfig $ifname up" ";$N"
                [ -z "$nasopts" ] || {
-                       config_get ifname "$vif" ifname
-                       config_get bridge "$vif" bridge # XXX: integrate with /etc/config/network later
+                       bridge="$(bridge_interface "$ifname")"
                        eval "${vif}_ssid=\"\$ssid\""
                        mode="-A"
                        [ "$vif" = "$sta_if" ] && mode="-S"
-                       [ -z "$nas" ] || nas_cmd="${nas_cmd:+$nas_cmd$N}$nas -P /var/run/nas.$ifname.pid -H 34954 -i $ifname${bridge:+ -l $bridge} $mode -m $auth -w $crypto -s \"\$${vif}_ssid\" -g 3600 $nasopts &"
+                       [ -z "$nas" ] || nas_cmd="${nas_cmd:+$nas_cmd$N}$nas -P /var/run/nas.$ifname.pid -H 34954 ${bridge:+ -l $bridge} -i $ifname $mode -m $auth -w $crypto -s \"\$${vif}_ssid\" -g 3600 $nasopts &"
                }
                _c=$(($_c + 1))
        done
        killall -KILL nas >&- 2>&-
-       cat <<EOF
+       wlc stdin <<EOF
 $ifdown
 
 mssid $mssid
@@ -144,6 +158,7 @@ infra $infra
 ${wet:+wet 1}
 
 radio ${radio:-1}
+vlan_mode 0
 macfilter 0
 maclist none
 wds none
@@ -156,6 +171,7 @@ up
 $vif_post_up
 EOF
        eval "$nas_cmd"
+       eval "$if_up"
 }
 
 
This page took 0.027985 seconds and 4 git commands to generate.