aboutsummaryrefslogtreecommitdiffstats
path: root/src/ap/ap_config.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-02-01 14:34:12 +0200
committerJouni Malinen <j@w1.fi>2011-02-01 14:34:12 +0200
commitd2da22494884b8aacf5897bb6a1813278d46b6bc (patch)
tree648732f28a6f1f16bdefc74e259e4679d00ec782 /src/ap/ap_config.c
parent09c395b4bb7af8d8565f07c2ac7d67427f9540ad (diff)
downloadexternal_wpa_supplicant_8_ti-d2da22494884b8aacf5897bb6a1813278d46b6bc.zip
external_wpa_supplicant_8_ti-d2da22494884b8aacf5897bb6a1813278d46b6bc.tar.gz
external_wpa_supplicant_8_ti-d2da22494884b8aacf5897bb6a1813278d46b6bc.tar.bz2
AP: Enable WMM with default parameters by default for HT
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.
Diffstat (limited to 'src/ap/ap_config.c')
-rw-r--r--src/ap/ap_config.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
index 702cb76..a403624 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
@@ -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;