summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2006-11-18 23:38:07 +0000
committerFelix Fietkau <nbd@openwrt.org>2006-11-18 23:38:07 +0000
commitc31771f2034e240a5d9ce6409dd36ac45015feeb (patch)
treeee1393e75ad325d035be6d72bc06a626ee4c7a94
parentb1d1701fd6d3177e1455190610be25212bbe7b7c (diff)
downloadmtk-20170518-c31771f2034e240a5d9ce6409dd36ac45015feeb.zip
mtk-20170518-c31771f2034e240a5d9ce6409dd36ac45015feeb.tar.gz
mtk-20170518-c31771f2034e240a5d9ce6409dd36ac45015feeb.tar.bz2
add distance/slottime setting to broadcom.sh (fixes #950)
SVN-Revision: 5578
-rw-r--r--package/broadcom-wl/files/lib/wifi/broadcom.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/package/broadcom-wl/files/lib/wifi/broadcom.sh b/package/broadcom-wl/files/lib/wifi/broadcom.sh
index 2238275..92548e5 100644
--- a/package/broadcom-wl/files/lib/wifi/broadcom.sh
+++ b/package/broadcom-wl/files/lib/wifi/broadcom.sh
@@ -92,12 +92,24 @@ enable_broadcom() {
config_get maxassoc "$device" maxassoc
config_get wds "$device" wds
config_get vifs "$device" vifs
+ config_get distance "$device" distance
+ config_get slottime "$device" slottime
local vif_pre_up vif_post_up vif_do_up
_c=0
nas="$(which nas)"
nas_cmd=
if_up=
+
+ [ -z "$slottime" ] && {
+ [ -n "$distance" ] && {
+ # slottime = 9 + (distance / 150) + (distance % 150 ? 1 : 0)
+ slottime="$((9 + ($distance / 150) + 1 - (150 - ($distance % 150)) / 150 ))"
+ }
+ } || {
+ slottime="${slottime:--1}"
+ }
+
for vif in $vifs; do
config_get mode "$vif" mode
append vif_pre_up "vif $_c" "$N"
@@ -207,6 +219,7 @@ wds ${wds:-none}
channel ${channel:-0}
country ${country:-IL0}
maxassoc ${maxassoc:-128}
+slottime ${slottime:--1}
$vif_pre_up
up