hostapd: add support for auto-channel selection
authorFelix Fietkau <nbd@openwrt.org>
Mon, 25 Nov 2013 15:43:30 +0000 (15:43 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 25 Nov 2013 15:43:30 +0000 (15:43 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 38915

package/kernel/mac80211/files/lib/wifi/mac80211.sh
package/network/services/hostapd/files/hostapd-full.config
package/network/services/hostapd/files/hostapd-mini.config

index 13afa813b0c95aa378bc9e66013aa32daec43231..1994ca38d447153780f38edd21bbd191944f490e 100644 (file)
@@ -19,11 +19,8 @@ mac80211_hostapd_setup_base() {
 
        [ -n "$channel" -a -z "$hwmode" ] && wifi_fixup_hwmode "$device"
 
-       [ "$channel" = auto ] && {
-               channel=$(iw phy "$phy" info | \
-                       sed -ne '/MHz/ { /disabled\|passive\|radar/d; s/.*\[//; s/\].*//; p; q }')
-               config_set "$device" channel "$channel"
-       }
+       hostapd_channel=$channel
+       [ "$channel" = auto -o "$channel" = 0 ] && hostapd_channel=acs_survey
 
        [ -n "$hwmode" ] && {
                config_get hwmode_11n "$device" hwmode_11n
@@ -97,7 +94,7 @@ tx_queue_data0_cwmin=3
 tx_queue_data0_cwmax=7
 tx_queue_data0_burst=1.5
 ${hwmode:+hw_mode=$hwmode}
-${channel:+channel=$channel}
+${hostapd_channel:+channel=$hostapd_channel}
 ${beacon_int:+beacon_int=$beacon_int}
 ${country:+country_code=$country}
 ${noscan:+noscan=$noscan}
index 2b7178118138b1b6d1aa0b3f3912e6d86ba4893d..bc999c04a1e895a1b68d3de3bcc626eea49b3bb0 100644 (file)
@@ -164,4 +164,6 @@ CONFIG_NO_DUMP_STATE=y
 CONFIG_WPS=y
 CONFIG_FULL_DYNAMIC_VLAN=y
 
+CONFIG_ACS=y
+
 CONFIG_UBUS=y
index 0f0284bdc0e6a6aa85794bf82ef5e5045229f196..01a04cb237e667b097c076995586667c75b9a889 100644 (file)
@@ -157,4 +157,6 @@ CONFIG_TLS=internal
 CONFIG_NO_RANDOM_POOL=y
 CONFIG_NO_DUMP_STATE=y
 
+CONFIG_ACS=y
+
 CONFIG_UBUS=y