[RFC] Allow advertising of UAPSD functionality in beacon when it is supported outside

Yogesh Ashok Powar yogeshp at marvell.com
Thu Apr 8 05:56:41 EDT 2010


Hostapd does not implement UAPSD functionality. However, if UAPSD functionality
is implemented outside hostapd, add support to advertise the functionality in
beacon.

Signed-off-by: yogeshp at marvell.com
---
 hostapd/config_file.c  |    2 ++
 hostapd/hostapd.conf   |    5 +++++
 src/ap/ap_config.h     |    1 +
 src/ap/wmm.c           |    3 +++
 src/ap/wpa_auth.h      |    1 +
 src/ap/wpa_auth_glue.c |    1 +
 6 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 10b7a35..8916b03 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -1815,6 +1815,8 @@ struct hostapd_config * hostapd_config_read(const char *fname)
 		} else if (os_strcmp(buf, "wme_enabled") == 0 ||
 			   os_strcmp(buf, "wmm_enabled") == 0) {
 			bss->wmm_enabled = atoi(pos);
+		} else if (os_strcmp(buf, "uapsd_advertisement_enabled") == 0) {
+			bss->wmm_uapsd = atoi(pos);
 		} else if (os_strncmp(buf, "wme_ac_", 7) == 0 ||
 			   os_strncmp(buf, "wmm_ac_", 7) == 0) {
 			if (hostapd_config_wmm_ac(conf, buf, pos)) {
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index 473d6b8..603e81b 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -283,6 +283,11 @@ ignore_broadcast_ssid=0
 #
 wmm_enabled=1
 #
+#WMM-PS Unscheduled  Automatic Power Save Delivery [UAPSD]
+#Enable this flag if UAPSD supported outside hostapd (eg., Firmware/driver)
+#
+uapsd_advertisement_enabled=1
+#
 # Low priority / AC_BK = background
 wmm_ac_bk_cwmin=4
 wmm_ac_bk_cwmax=10
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index ce3085f..f509b5b 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -270,6 +270,7 @@ struct hostapd_bss_config {
 	int ignore_broadcast_ssid;
 
 	int wmm_enabled;
+	int wmm_uapsd;
 
 	struct hostapd_vlan *vlan, *vlan_tail;
 
diff --git a/src/ap/wmm.c b/src/ap/wmm.c
index bbed83d..3668130 100644
--- a/src/ap/wmm.c
+++ b/src/ap/wmm.c
@@ -71,6 +71,9 @@ u8 * hostapd_eid_wmm(struct hostapd_data *hapd, u8 *eid)
 	wmm->version = WMM_VERSION;
 	wmm->qos_info = hapd->parameter_set_count & 0xf;
 
+	if (hapd->conf->wmm_uapsd)
+		wmm->qos_info |= 0x80;
+
 	/* fill in a parameter set record for each AC */
 	for (e = 0; e < 4; e++) {
 		struct wmm_ac_parameter *ac = &wmm->ac[e];
diff --git a/src/ap/wpa_auth.h b/src/ap/wpa_auth.h
index daf2851..d0136c7 100644
--- a/src/ap/wpa_auth.h
+++ b/src/ap/wpa_auth.h
@@ -142,6 +142,7 @@ struct wpa_auth_config {
 	int eapol_version;
 	int peerkey;
 	int wmm_enabled;
+	int wmm_uapsd;
 	int okc;
 #ifdef CONFIG_IEEE80211W
 	enum mfp_options ieee80211w;
diff --git a/src/ap/wpa_auth_glue.c b/src/ap/wpa_auth_glue.c
index 4cc1f61..fdaf214 100644
--- a/src/ap/wpa_auth_glue.c
+++ b/src/ap/wpa_auth_glue.c
@@ -47,6 +47,7 @@ static void hostapd_wpa_auth_conf(struct hostapd_bss_config *conf,
 	wconf->eapol_version = conf->eapol_version;
 	wconf->peerkey = conf->peerkey;
 	wconf->wmm_enabled = conf->wmm_enabled;
+	wconf->wmm_uapsd = conf->wmm_uapsd;
 	wconf->okc = conf->okc;
 #ifdef CONFIG_IEEE80211W
 	wconf->ieee80211w = conf->ieee80211w;
-- 
1.5.4.3



More information about the HostAP mailing list