]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP: Enable WMM with default parameters by default for HT
authorJohannes Berg <johannes.berg@intel.com>
Tue, 1 Feb 2011 12:34:12 +0000 (14:34 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 1 Feb 2011 12:34:12 +0000 (14:34 +0200)
If WMM is not disabled explicitly (wmm_enabled=0 in hostapd.conf),
enable WMM automatically whenever HT (ieee80211n) is enabled. Use
the default WMM parameters for AP TX queues and the EDCA parameters
advertised for stations in WMM IE if no overriding values are
included in the configuration.

hostapd/config_file.c
hostapd/hostapd.conf
src/ap/ap_config.c
src/ap/ap_config.h
src/ap/hostapd.c

index 6d340d71458060cec3b35bc04be7f97248fd5e38..03382d470cda3edcd3d0ca5f83c94f539c0c038b 100644 (file)
@@ -778,7 +778,7 @@ static int hostapd_config_tx_queue(struct hostapd_config *conf, char *name,
        }
 
        if (num >= NUM_TX_QUEUES) {
-               /* for backwards compatibility, do not tricker failure */
+               /* for backwards compatibility, do not trigger failure */
                wpa_printf(MSG_INFO, "DEPRECATED: '%s' not used", name);
                return 0;
        }
@@ -813,8 +813,6 @@ static int hostapd_config_tx_queue(struct hostapd_config *conf, char *name,
                return -1;
        }
 
-       queue->configured = 1;
-
        return 0;
 }
 
index 3a79a944a785527532e8957835ffa436a667ace5..2def335601b15b604b9a279a8dcdeac483134cdf 100644 (file)
@@ -198,7 +198,6 @@ auth_algs=3
 ignore_broadcast_ssid=0
 
 # TX queue parameters (EDCF / bursting)
-# default for all these fields: not set, use hardware defaults
 # tx_queue_<queue name>_<param>
 # queues: data0, data1, data2, data3, after_beacon, beacon
 #              (data0 is the highest priority queue)
index 702cb765bb549077dfd0f37eaa8f4a2d205fa3b8..a4036243117b85e9846f8c602003e533c5b113e0 100644 (file)
@@ -86,14 +86,18 @@ void hostapd_config_defaults_bss(struct hostapd_bss_config *bss)
        bss->pac_key_lifetime = 7 * 24 * 60 * 60;
        bss->pac_key_refresh_time = 1 * 24 * 60 * 60;
 #endif /* EAP_SERVER_FAST */
+
+       /* Set to -1 as defaults depends on HT in setup */
+       bss->wmm_enabled = -1;
 }
 
 
 struct hostapd_config * hostapd_config_defaults(void)
 {
+#define ecw2cw(ecw) ((1 << (ecw)) - 1)
+
        struct hostapd_config *conf;
        struct hostapd_bss_config *bss;
-       int i;
        const int aCWmin = 4, aCWmax = 10;
        const struct hostapd_wmm_ac_params ac_bk =
                { aCWmin, aCWmax, 7, 0, 0 }; /* background traffic */
@@ -103,6 +107,17 @@ struct hostapd_config * hostapd_config_defaults(void)
                { aCWmin - 1, aCWmin, 2, 3000 / 32, 1 };
        const struct hostapd_wmm_ac_params ac_vo = /* voice traffic */
                { aCWmin - 2, aCWmin - 1, 2, 1500 / 32, 1 };
+       const struct hostapd_tx_queue_params txq_bk =
+               { 7, ecw2cw(aCWmin), ecw2cw(aCWmax), 0 };
+       const struct hostapd_tx_queue_params txq_be =
+               { 3, ecw2cw(aCWmin), 4 * (ecw2cw(aCWmin) + 1) - 1, 0};
+       const struct hostapd_tx_queue_params txq_vi =
+               { 1, (ecw2cw(aCWmin) + 1) / 2 - 1, ecw2cw(aCWmin), 30};
+       const struct hostapd_tx_queue_params txq_vo =
+               { 1, (ecw2cw(aCWmin) + 1) / 4 - 1,
+                 (ecw2cw(aCWmin) + 1) / 2 - 1, 15};
+
+#undef ecw2cw
 
        conf = os_zalloc(sizeof(*conf));
        bss = os_zalloc(sizeof(*bss));
@@ -131,14 +146,16 @@ struct hostapd_config * hostapd_config_defaults(void)
        conf->fragm_threshold = -1; /* user driver default: 2346 */
        conf->send_probe_response = 1;
 
-       for (i = 0; i < NUM_TX_QUEUES; i++)
-               conf->tx_queue[i].aifs = -1; /* use hw default */
-
        conf->wmm_ac_params[0] = ac_be;
        conf->wmm_ac_params[1] = ac_bk;
        conf->wmm_ac_params[2] = ac_vi;
        conf->wmm_ac_params[3] = ac_vo;
 
+       conf->tx_queue[0] = txq_vo;
+       conf->tx_queue[1] = txq_vi;
+       conf->tx_queue[2] = txq_be;
+       conf->tx_queue[3] = txq_bk;
+
        conf->ht_capab = HT_CAP_INFO_SMPS_DISABLED;
 
        return conf;
index 86ddc3a78ded13325ded539bd16cf16da3577397..ff7e8cf222df14ae98908134d536ac7f521d9dfc 100644 (file)
@@ -130,7 +130,6 @@ struct hostapd_tx_queue_params {
        int cwmin;
        int cwmax;
        int burst; /* maximum burst time in 0.1 ms, i.e., 10 = 1 ms */
-       int configured;
 };
 
 struct hostapd_wmm_ac_params {
index 16d7c45122cc9f9a2a896ac27297b522919e8381..3f2888a34749cdff52aafe77533765a0c6a45afd 100644 (file)
@@ -511,6 +511,9 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
                }
        }
 
+       if (conf->wmm_enabled < 0)
+               conf->wmm_enabled = hapd->iconf->ieee80211n;
+
        hostapd_flush_old_stations(hapd);
        hostapd_set_privacy(hapd, 0);
 
@@ -636,9 +639,6 @@ static void hostapd_tx_queue_params(struct hostapd_iface *iface)
        for (i = 0; i < NUM_TX_QUEUES; i++) {
                p = &iface->conf->tx_queue[i];
 
-               if (!p->configured)
-                       continue;
-
                if (hostapd_set_tx_queue_params(hapd, i, p->aifs, p->cwmin,
                                                p->cwmax, p->burst)) {
                        wpa_printf(MSG_DEBUG, "Failed to set TX queue "