summaryrefslogtreecommitdiffstats
path: root/package/mac80211/files
diff options
context:
space:
mode:
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-02-26 14:53:03 +0000
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-02-26 14:53:03 +0000
commite6d9c8710c5c27c2249c333b5aa5429a9ef2338b (patch)
treef3ec8fdf86ae76944b070f0e48c24d7d19f6ef4e /package/mac80211/files
parent420070ce079ea4cdbef144b02f02e940880bc1d8 (diff)
[package] allow mac80211 devices to be configured to do 802.11s, requires iw
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@14669 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/mac80211/files')
-rw-r--r--package/mac80211/files/lib/wifi/mac80211.sh18
1 files changed, 16 insertions, 2 deletions
diff --git a/package/mac80211/files/lib/wifi/mac80211.sh b/package/mac80211/files/lib/wifi/mac80211.sh
index 8f3ed4a25..77c797635 100644
--- a/package/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/mac80211/files/lib/wifi/mac80211.sh
@@ -13,14 +13,14 @@ scan_mac80211() {
config_get mode "$vif" mode
case "$mode" in
- adhoc|sta|ap|monitor)
+ adhoc|sta|ap|monitor|mesh)
append $mode "$vif"
;;
*) echo "$device($vif): Invalid mode, ignored."; continue;;
esac
done
- config_set "$device" vifs "${ap:+$ap }${adhoc:+$adhoc }${ahdemo:+$ahdemo }${sta:+$sta }${wds:+$wds }${monitor:+$monitor}"
+ config_set "$device" vifs "${ap:+$ap }${adhoc:+$adhoc }${ahdemo:+$ahdemo }${sta:+$sta }${wds:+$wds }${monitor:+$monitor }${mesh:+$mesh}"
}
@@ -53,6 +53,7 @@ enable_mac80211() {
config_get txpower "$device" txpower
local first=1
+ local mesh_idx=0
for vif in $vifs; do
ifconfig "$ifname" down 2>/dev/null
config_get ifname "$vif" ifname
@@ -75,6 +76,13 @@ enable_mac80211() {
sleep 1
iwconfig "$ifname" mode ad-hoc >/dev/null 2>/dev/null
fi
+ # mesh interface should be created only for the first interface
+ if [ "$mode" = mesh ]; then
+ config_get mesh_id "$vif" mesh_id
+ if [ -n "$mesh_id" ]; then
+ iw dev "$ifname" interface add msh$mesh_idx type mp mesh_id $mesh_id
+ fi
+ fi
sleep 1
iwconfig "$ifname" channel "$channel" >/dev/null 2>/dev/null
}
@@ -162,8 +170,14 @@ enable_mac80211() {
}
fi
;;
+ mesh)
+ # special case where physical interface should be down for mesh to work
+ ifconfig "$ifname" down
+ ifconfig "msh$mesh_idx" up
+ ;;
esac
first=0
+ mesh_idx=$(expr $mesh_idx + 1)
done
}