[OpenWrt-Devel] [PATCH v2 3/3] hostapd: Add uapsd option to netifd.sh

Vittorio G (VittGam) openwrt at vittgam.net
Tue Oct 14 14:05:37 EDT 2014


The uapsd option sets the uapsd_advertisement_enabled flag in hostapd, only if the phy actually supports the option.

Signed-off-by: Vittorio Gambaletta <openwrt at vittgam.net>

---
 package/network/services/hostapd/files/netifd.sh |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/package/network/services/hostapd/files/netifd.sh b/package/network/services/hostapd/files/netifd.sh
index ccea5ff..48bcc9d 100644
--- a/package/network/services/hostapd/files/netifd.sh
+++ b/package/network/services/hostapd/files/netifd.sh
@@ -100,7 +100,7 @@ EOF
 
 hostapd_common_add_bss_config() {
 	config_add_string 'bssid:macaddr' 'ssid:string'
-	config_add_boolean wds wmm hidden
+	config_add_boolean wds wmm uapsd hidden
 
 	config_add_int maxassoc max_inactivity
 	config_add_boolean disassoc_low_ack isolate short_preamble
@@ -163,7 +163,7 @@ hostapd_set_bss_options() {
 		maxassoc max_inactivity disassoc_low_ack isolate auth_cache \
 		wps_pushbutton wps_label ext_registrar wps_pbc_in_m1 \
 		wps_device_type wps_device_name wps_manufacturer wps_pin \
-		macfilter ssid wmm hidden short_preamble rsn_preauth
+		macfilter ssid wmm uapsd hidden short_preamble rsn_preauth
 
 	set_default isolate 0
 	set_default maxassoc 0
@@ -172,6 +172,7 @@ hostapd_set_bss_options() {
 	set_default disassoc_low_ack 1
 	set_default hidden 0
 	set_default wmm 1
+	set_default uapsd 1
 
 	append bss_conf "ctrl_interface=/var/run/hostapd"
 	if [ "$isolate" -gt 0 ]; then
@@ -189,6 +190,10 @@ hostapd_set_bss_options() {
 	append bss_conf "wmm_enabled=$wmm" "$N"
 	append bss_conf "ignore_broadcast_ssid=$hidden" "$N"
 
+	[ -n "$phy" ] && iw phy "$phy" info 2>/dev/null | grep -q 'Device supports AP-side u-APSD.' && {
+		append bss_conf "uapsd_advertisement_enabled=$uapsd" "$N"
+	}
+
 	[ "$wpa" -gt 0 ] && {
 		[ -n "$wpa_group_rekey"  ] && append bss_conf "wpa_group_rekey=$wpa_group_rekey" "$N"
 		[ -n "$wpa_pair_rekey"   ] && append bss_conf "wpa_ptk_rekey=$wpa_pair_rekey"    "$N"
-- 
1.7.9.5
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list