diff options
author | Florian Fainelli <florian@openwrt.org> | 2008-03-27 18:47:59 +0000 |
---|---|---|
committer | Florian Fainelli <florian@openwrt.org> | 2008-03-27 18:47:59 +0000 |
commit | 7518138756e6f28740bcdeac2ea9f278d38d889c (patch) | |
tree | 0fcafc410488141b921b1e0366c475bcb0052d5a /package/mac80211/files | |
parent | ef083ad3985e658a032f7e3ded9d197fbd96f04b (diff) | |
download | upstream-7518138756e6f28740bcdeac2ea9f278d38d889c.tar.gz upstream-7518138756e6f28740bcdeac2ea9f278d38d889c.tar.bz2 upstream-7518138756e6f28740bcdeac2ea9f278d38d889c.zip |
Allow setting mac80211 interface into ad-hoc mode (#3247)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@10677 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/mac80211/files')
-rw-r--r-- | package/mac80211/files/lib/wifi/mac80211.sh | 9 |
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 58fa1be492..a2e6c685c0 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= |