]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP: Consider U-APSD driver support
authorEliad Peller <eliad@wizery.com>
Sat, 17 Dec 2011 09:45:53 +0000 (11:45 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 17 Dec 2011 09:45:53 +0000 (11:45 +0200)
Check whether the driver advertises support for U-APSD
in AP mode, and evaluate wmm_uapsd only in this case.

Signed-off-by: Eliad Peller <eliad@wizery.com>
src/ap/wmm.c
src/drivers/driver.h
src/drivers/driver_nl80211.c

index d6d8a10489f511f5bef9ae84ad7a41b3eb597162..1d05c4ff1c3ff2213b6f30d05eb4edad274d544b 100644 (file)
@@ -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;
index 76c4e8c8e846140b754c292caa52ca7f12830a38..98d82e6811aa242f7fd42a9f96935c90015665ec 100644 (file)
@@ -774,6 +774,8 @@ struct wpa_driver_capa {
 #define WPA_DRIVER_FLAGS_TDLS_EXTERNAL_SETUP           0x00100000
 /* Driver indicates support for Probe Response offloading in AP mode */
 #define WPA_DRIVER_FLAGS_PROBE_RESP_OFFLOAD            0x00200000
+/* Driver supports U-APSD in AP mode */
+#define WPA_DRIVER_FLAGS_AP_UAPSD                      0x00400000
        unsigned int flags;
 
        int max_scan_ssids;
index 0a68c5fff15c6e05d07e67b99cfa587e9d9dd1e1..e87b702e2403f45469e1318a8b90c37f14e41217 100644 (file)
@@ -2434,6 +2434,9 @@ broken_combination:
        /* default to 5000 since early versions of mac80211 don't set it */
        capa->max_remain_on_chan = 5000;
 
+       if (tb[NL80211_ATTR_SUPPORT_AP_UAPSD])
+               capa->flags |= WPA_DRIVER_FLAGS_AP_UAPSD;
+
        if (tb[NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION])
                capa->max_remain_on_chan =
                        nla_get_u32(tb[NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION]);