The latest hostapd and some of the wireless drivers support DFS, which
is required on the 5 GHz band in many countries. This patch adds the
correct option to the hostapd configuration. IEEE802.11h depends on
IEEE802.11d, which in turn requires a country code to be set (the
current version does not actually enforce this and country_ie can be set
without country). DFS can be explicitly disabled by adding dfs=0 in the
wireless config.

Signed-off-by: Matti Laakso <malaa...@elisanet.fi>
---

Index: package/kernel/mac80211/files/lib/wifi/mac80211.sh
===================================================================
--- package/kernel/mac80211/files/lib/wifi/mac80211.sh  (revision 38934)
+++ package/kernel/mac80211/files/lib/wifi/mac80211.sh  (working copy)
@@ -41,9 +41,17 @@
        }
 
        local country_ie=0
-       [ -n "$country" ] && country_ie=1
-       config_get_bool country_ie "$device" country_ie "$country_ie"
-       [ "$country_ie" -gt 0 ] && append base_cfg "ieee80211d=1" "$N"
+       local dfs=0
+       [ -n "$country" ] && {
+               country_ie=1
+               config_get_bool country_ie "$device" country_ie "$country_ie"
+               [ "$country_ie" -gt 0 ] && {
+                       append base_cfg "ieee80211d=1" "$N"
+                       dfs=1
+                       config_get_bool dfs "$device" dfs "$dfs"
+                       [ "$dfs" -gt 0 ] && append base_cfg "ieee80211h=1" "$N"
+               }
+       }
 
        local br brval brstr
        [ -n "$basic_rate_list" ] && {
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to