[brcm63xx] add bcm63xx_spi based on reading shared/opensource/flash/spiflash.c from...
[openwrt.git] / package / broadcom-wl / files / lib / wifi / broadcom.sh
index b30a3d9..1200212 100644 (file)
@@ -123,7 +123,8 @@ enable_broadcom() {
        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 txpower
+       config_get txpower "$device" txpower
+       local vif_pre_up vif_post_up vif_do_up vif_txpower
 
        _c=0
        nas="$(which nas)"
@@ -152,7 +153,7 @@ enable_broadcom() {
        esac
 
        for vif in $vifs; do
-               config_get txpower "$vif" txpower
+               config_get vif_txpower "$vif" txpower
 
                config_get mode "$vif" mode
                append vif_pre_up "vif $_c" "$N"
@@ -232,12 +233,20 @@ enable_broadcom() {
                        append vif_post_up "monitor $monitor" "$N"
                        append vif_post_up "passive $passive" "$N"
                }
+
+               [ "$mode" = "adhoc" ] && {
+                       config_get bssid "$vif" bssid
+                       [ -n "$bssid" ] && {
+                               append vif_pre_up "des_bssid $bssid" "$N"
+                               append vif_pre_up "allow_mode 1" "$N"
+                       }
+               } || append vif_pre_up "allow_mode 0" "$N"
                
                append vif_post_up "enabled 1" "$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" ] || {
@@ -297,7 +306,11 @@ EOF
        wlc stdin <<EOF
 $vif_do_up
 EOF
-       [ -z "$txpower" ] || iwconfig $device txpower ${txpower}dBm 
+
+       # use vif_txpower (from last wifi-iface) instead of txpower (from
+       # wifi-device) if the latter does not exist
+       txpower=${txpower:-$vif_txpower}
+       [ -z "$txpower" ] || iwconfig $device txpower ${txpower}dBm
 
        eval "$nas_cmd"
 }
This page took 0.023219 seconds and 4 git commands to generate.