[PATCH 1/3] AP: consider uapsd support

Eliad Peller eliad at wizery.com
Wed Aug 31 06:30:28 EDT 2011


Check whether the driver advertises support for uapsd
in ap mode, and evaluate wmm_uapsd only in this case.

Signed-off-by: Eliad Peller <eliad at wizery.com>
---
(need to sync nl80211_copy.h first)

 src/ap/wmm.c                 |    3 ++-
 src/drivers/driver.h         |    2 ++
 src/drivers/driver_nl80211.c |    6 ++++++
 3 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/ap/wmm.c b/src/ap/wmm.c
index a6d9b89..9bdf5dc 100644
--- a/src/ap/wmm.c
+++ b/src/ap/wmm.c
@@ -72,7 +72,8 @@ 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)
+	if (hapd->conf->wmm_uapsd &&
+	    (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_AP_UAPSD))
 		wmm->qos_info |= 0x80;
 
 	wmm->reserved = 0;
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 67c5631..54e2ef3 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -675,6 +675,8 @@ struct wpa_driver_capa {
 #define WPA_DRIVER_FLAGS_EAPOL_TX_STATUS		0x00010000
 /* Driver indicates TX status events for Deauth/Disassoc frames */
 #define WPA_DRIVER_FLAGS_DEAUTH_TX_STATUS		0x00020000
+/* Driver supports uapsd in ap mode */
+#define WPA_DRIVER_FLAGS_AP_UAPSD			0x00040000
 	unsigned int flags;
 
 	int max_scan_ssids;
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 233cdb2..b0eaac5 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -1638,6 +1638,7 @@ struct wiphy_info_data {
 	int auth_supported;
 	int connect_supported;
 	int offchan_tx_supported;
+	int ap_uapsd_supported;
 	int max_remain_on_chan;
 };
 
@@ -1694,6 +1695,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
 	if (tb[NL80211_ATTR_OFFCHANNEL_TX_OK])
 		info->offchan_tx_supported = 1;
 
+	if (tb[NL80211_ATTR_SUPPORT_AP_UAPSD])
+		info->ap_uapsd_supported = 1;
+
 	if (tb[NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION])
 		info->max_remain_on_chan =
 			nla_get_u32(tb[NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION]);
@@ -1771,6 +1775,8 @@ static int wpa_driver_nl80211_capa(struct wpa_driver_nl80211_data *drv)
 	drv->capa.flags |= WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE;
 	if (info.p2p_supported)
 		drv->capa.flags |= WPA_DRIVER_FLAGS_P2P_CAPABLE;
+	if (info.ap_uapsd_supported)
+		drv->capa.flags |= WPA_DRIVER_FLAGS_AP_UAPSD;
 	drv->capa.flags |= WPA_DRIVER_FLAGS_EAPOL_TX_STATUS;
 	drv->capa.flags |= WPA_DRIVER_FLAGS_DEAUTH_TX_STATUS;
 	drv->capa.max_remain_on_chan = info.max_remain_on_chan;
-- 
1.7.0.4



More information about the HostAP mailing list