aboutsummaryrefslogtreecommitdiffstats
path: root/package/mac80211/files
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-08-13 22:55:59 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-08-13 22:55:59 +0000
commite0712a54a6c5559d2b49038dc99abd6390bc95c2 (patch)
tree9c517bfa140088d08420ddcee25617dffc7b8a7b /package/mac80211/files
parent56093f4fdbacb2fa2d690681be1b7e4009ec4cfb (diff)
downloadupstream-e0712a54a6c5559d2b49038dc99abd6390bc95c2.tar.gz
upstream-e0712a54a6c5559d2b49038dc99abd6390bc95c2.tar.bz2
upstream-e0712a54a6c5559d2b49038dc99abd6390bc95c2.zip
[package] mac80211: use first available channel from current phy if channel is set to "auto"
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@27976 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/mac80211/files')
-rw-r--r--package/mac80211/files/lib/wifi/mac80211.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/package/mac80211/files/lib/wifi/mac80211.sh b/package/mac80211/files/lib/wifi/mac80211.sh
index dbf13b8106..86ec75cec3 100644
--- a/package/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/mac80211/files/lib/wifi/mac80211.sh
@@ -17,7 +17,13 @@ mac80211_hostapd_setup_base() {
config_get basic_rate_list "$device" basic_rate
config_get_bool noscan "$device" noscan
[ -n "$channel" -a -z "$hwmode" ] && wifi_fixup_hwmode "$device"
- [ "$channel" = auto ] && channel=
+
+ [ "$channel" = auto ] && {
+ channel=$(iw phy "$phy" info | \
+ sed -ne '/MHz/ { /disabled\|passive\|radar/d; s/.*\[//; s/\].*//; p; q }')
+ config_set "$device" channel "$channel"
+ }
+
[ -n "$hwmode" ] && {
config_get hwmode_11n "$device" hwmode_11n
[ -n "$hwmode_11n" ] && {