summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2008-03-27 18:47:59 +0000
committerFlorian Fainelli <florian@openwrt.org>2008-03-27 18:47:59 +0000
commitd0556cda492f0daead815b41fe59da6196dc1491 (patch)
tree0ca161fb4ec1fad28e12948ca81ad50c6c459053
parent6776a34d73fd2d58691dc714df96cf52d5c07221 (diff)
downloadmtk-20170518-d0556cda492f0daead815b41fe59da6196dc1491.zip
mtk-20170518-d0556cda492f0daead815b41fe59da6196dc1491.tar.gz
mtk-20170518-d0556cda492f0daead815b41fe59da6196dc1491.tar.bz2
Allow setting mac80211 interface into ad-hoc mode (#3247)
SVN-Revision: 10677
-rw-r--r--package/mac80211/files/lib/wifi/mac80211.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/package/mac80211/files/lib/wifi/mac80211.sh b/package/mac80211/files/lib/wifi/mac80211.sh
index 58fa1be..a2e6c68 100644
--- a/package/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/mac80211/files/lib/wifi/mac80211.sh
@@ -66,10 +66,15 @@ enable_mac80211() {
[ "$first" = 1 ] && {
# only need to change freq band and channel on the first vif
- iwconfig "$ifname" channel "$channel" >/dev/null 2>/dev/null
+ iwconfig "$ifname" channel "$channel" >/dev/null 2>/dev/null
+ if [ "$mode" = adhoc ]; then
+ iwlist "$ifname" scan >/dev/null 2>/dev/null
+ sleep 1
+ iwconfig "$ifname" mode ad-hoc >/dev/null 2>/dev/null
+ fi
ifconfig "$ifname" up
sleep 1
- iwconfig "$ifname" channel "$channel" >/dev/null 2>/dev/null
+ iwconfig "$ifname" channel "$channel" >/dev/null 2>/dev/null
}
wpa=