|
@@ -2549,6 +2549,15 @@ struct wpa_config * wpa_config_alloc_empty(const char *ctrl_interface,
|
|
|
const char *driver_param)
|
|
|
{
|
|
|
struct wpa_config *config;
|
|
|
+ const int aCWmin = 4, aCWmax = 10;
|
|
|
+ const struct hostapd_wmm_ac_params ac_bk =
|
|
|
+ { aCWmin, aCWmax, 7, 0, 0 };
|
|
|
+ const struct hostapd_wmm_ac_params ac_be =
|
|
|
+ { aCWmin, aCWmax, 3, 0, 0 };
|
|
|
+ const struct hostapd_wmm_ac_params ac_vi = /* video traffic */
|
|
|
+ { 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 };
|
|
|
|
|
|
config = os_zalloc(sizeof(*config));
|
|
|
if (config == NULL)
|
|
@@ -2564,6 +2573,10 @@ struct wpa_config * wpa_config_alloc_empty(const char *ctrl_interface,
|
|
|
config->bss_expiration_scan_count = DEFAULT_BSS_EXPIRATION_SCAN_COUNT;
|
|
|
config->max_num_sta = DEFAULT_MAX_NUM_STA;
|
|
|
config->access_network_type = DEFAULT_ACCESS_NETWORK_TYPE;
|
|
|
+ config->wmm_ac_params[0] = ac_be;
|
|
|
+ config->wmm_ac_params[1] = ac_bk;
|
|
|
+ config->wmm_ac_params[2] = ac_vi;
|
|
|
+ config->wmm_ac_params[3] = ac_vo;
|
|
|
|
|
|
if (ctrl_interface)
|
|
|
config->ctrl_interface = os_strdup(ctrl_interface);
|
|
@@ -3021,6 +3034,25 @@ int wpa_config_process_global(struct wpa_config *config, char *pos, int line)
|
|
|
break;
|
|
|
}
|
|
|
if (i == NUM_GLOBAL_FIELDS) {
|
|
|
+#ifdef CONFIG_AP
|
|
|
+ if (os_strncmp(pos, "wmm_ac_", 7) == 0) {
|
|
|
+ char *tmp = os_strchr(pos, '=');
|
|
|
+ if (tmp == NULL) {
|
|
|
+ if (line < 0)
|
|
|
+ return -1;
|
|
|
+ wpa_printf(MSG_ERROR, "Line %d: invalid line "
|
|
|
+ "'%s'", line, pos);
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ *tmp++ = '\0';
|
|
|
+ if (hostapd_config_wmm_ac(config->wmm_ac_params, pos,
|
|
|
+ tmp)) {
|
|
|
+ wpa_printf(MSG_ERROR, "Line %d: invalid WMM "
|
|
|
+ "AC item", line);
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+#endif
|
|
|
if (line < 0)
|
|
|
return -1;
|
|
|
wpa_printf(MSG_ERROR, "Line %d: unknown global field '%s'.",
|