hostapd: add IEEE 802.11v support
authorLorenzo Santina <lorenzo.santina@edu.unito.it>
Sat, 30 Sep 2017 11:01:11 +0000 (13:01 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 21 Feb 2018 18:28:50 +0000 (19:28 +0100)
Add Wireless Network Management (IEEE 802.11v)
support to:
- hostapd-full
- wpa_supplicant-full

It must be enabled at runtime via UCI with:
- option ieee80211v '1'

Add UCI support for:
- time_advertisement
- time_zone
- wnm_sleep_mode
- bss_transition

Signed-off-by: Lorenzo Santina <lorenzo.santina@edu.unito.it>
package/network/services/hostapd/files/hostapd-full.config
package/network/services/hostapd/files/hostapd.sh
package/network/services/hostapd/files/wpa_supplicant-full.config

index fe627676d84555d35c2b5d7074acf07f88697a55..786afad2bcc6f37d499c44a2513da709bf07d30e 100644 (file)
@@ -153,7 +153,7 @@ CONFIG_IEEE80211N=y
 
 # Wireless Network Management (IEEE Std 802.11v-2011)
 # Note: This is experimental and not complete implementation.
-#CONFIG_WNM=y
+CONFIG_WNM=y
 
 # IEEE 802.11ac (Very High Throughput) support
 CONFIG_IEEE80211AC=y
index 8217f8c2ab1db06835e70a7d24b6f3b97a2e9fc6..334694abfa4442fb842c199ba99fdc5c0f19f2a1 100644 (file)
@@ -189,6 +189,10 @@ hostapd_common_add_bss_config() {
        config_add_int wps_ap_setup_locked wps_independent
        config_add_string wps_device_type wps_device_name wps_manufacturer wps_pin
 
+       config_add_boolean ieee80211v wnm_sleep_mode bss_transition
+       config_add_int time_advertisement
+       config_add_string time_zone
+
        config_add_boolean ieee80211r pmk_r1_push ft_psk_generate_local ft_over_ds
        config_add_int r0_key_lifetime reassociation_deadline
        config_add_string mobility_domain r1_key_holder
@@ -393,6 +397,21 @@ hostapd_set_bss_options() {
                append bss_conf "iapp_interface=$ifname" "$N"
        }
 
+       json_get_vars ieee80211v
+       set_default ieee80211v 0
+       if [ "$ieee80211v" -eq "1" ]; then
+               json_get_vars time_advertisement time_zone wnm_sleep_mode bss_transition
+
+               set_default time_advertisement 0
+               set_default wnm_sleep_mode 0
+               set_default bss_transition 0
+
+               append bss_conf "time_advertisement=$time_advertisement" "$N"
+               [ -n "$time_zone" ] && append bss_conf "time_zone=$time_zone" "$N"
+               append bss_conf "wnm_sleep_mode=$wnm_sleep_mode" "$N"
+               append bss_conf "bss_transition=$bss_transition" "$N"
+       fi
+
        if [ "$wpa" -ge "1" ]; then
                json_get_vars ieee80211r
                set_default ieee80211r 0
index 81fa8f5393147b371fca7280cba8752939940fa8..c22e1cca5d02dd27b17e35f71f5cae92eb0fb8aa 100644 (file)
@@ -465,7 +465,7 @@ CONFIG_NO_RANDOM_POOL=y
 
 # Wireless Network Management (IEEE Std 802.11v-2011)
 # Note: This is experimental and not complete implementation.
-#CONFIG_WNM=y
+CONFIG_WNM=y
 
 # Interworking (IEEE 802.11u)
 # This can be used to enable functionality to improve interworking with