Allow TX queue parameters to be configured for wpa_supplicant AP/P2P GO
Allow user to configure the TX queue parameters through the wpa_supplicant configuration file similarly to the way these can be set in hostapd. Parse the tx_queue_* parameters in the wpa_supplicant configuration file and update the TX queue configuration to the AP/P2P GO interface in the function wpa_supplicant_create_ap(). Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
parent
c7cb42d531
commit
790026c3da
3 changed files with 41 additions and 0 deletions
|
@ -858,6 +858,9 @@ int wpa_supplicant_create_ap(struct wpa_supplicant *wpa_s,
|
||||||
wpa_s->conf->wmm_ac_params,
|
wpa_s->conf->wmm_ac_params,
|
||||||
sizeof(wpa_s->conf->wmm_ac_params));
|
sizeof(wpa_s->conf->wmm_ac_params));
|
||||||
|
|
||||||
|
os_memcpy(wpa_s->ap_iface->conf->tx_queue, wpa_s->conf->tx_queue,
|
||||||
|
sizeof(wpa_s->conf->tx_queue));
|
||||||
|
|
||||||
if (params.uapsd > 0) {
|
if (params.uapsd > 0) {
|
||||||
conf->bss[0]->wmm_enabled = 1;
|
conf->bss[0]->wmm_enabled = 1;
|
||||||
conf->bss[0]->wmm_uapsd = 1;
|
conf->bss[0]->wmm_uapsd = 1;
|
||||||
|
|
|
@ -4255,6 +4255,8 @@ int wpa_config_remove_blob(struct wpa_config *config, const char *name)
|
||||||
struct wpa_config * wpa_config_alloc_empty(const char *ctrl_interface,
|
struct wpa_config * wpa_config_alloc_empty(const char *ctrl_interface,
|
||||||
const char *driver_param)
|
const char *driver_param)
|
||||||
{
|
{
|
||||||
|
#define ecw2cw(ecw) ((1 << (ecw)) - 1)
|
||||||
|
|
||||||
struct wpa_config *config;
|
struct wpa_config *config;
|
||||||
const int aCWmin = 4, aCWmax = 10;
|
const int aCWmin = 4, aCWmax = 10;
|
||||||
const struct hostapd_wmm_ac_params ac_bk =
|
const struct hostapd_wmm_ac_params ac_bk =
|
||||||
|
@ -4265,6 +4267,17 @@ struct wpa_config * wpa_config_alloc_empty(const char *ctrl_interface,
|
||||||
{ aCWmin - 1, aCWmin, 2, 3000 / 32, 0 };
|
{ aCWmin - 1, aCWmin, 2, 3000 / 32, 0 };
|
||||||
const struct hostapd_wmm_ac_params ac_vo = /* voice traffic */
|
const struct hostapd_wmm_ac_params ac_vo = /* voice traffic */
|
||||||
{ aCWmin - 2, aCWmin - 1, 2, 1500 / 32, 0 };
|
{ aCWmin - 2, aCWmin - 1, 2, 1500 / 32, 0 };
|
||||||
|
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
|
||||||
|
|
||||||
config = os_zalloc(sizeof(*config));
|
config = os_zalloc(sizeof(*config));
|
||||||
if (config == NULL)
|
if (config == NULL)
|
||||||
|
@ -4294,6 +4307,10 @@ struct wpa_config * wpa_config_alloc_empty(const char *ctrl_interface,
|
||||||
config->wmm_ac_params[1] = ac_bk;
|
config->wmm_ac_params[1] = ac_bk;
|
||||||
config->wmm_ac_params[2] = ac_vi;
|
config->wmm_ac_params[2] = ac_vi;
|
||||||
config->wmm_ac_params[3] = ac_vo;
|
config->wmm_ac_params[3] = ac_vo;
|
||||||
|
config->tx_queue[0] = txq_vo;
|
||||||
|
config->tx_queue[1] = txq_vi;
|
||||||
|
config->tx_queue[2] = txq_be;
|
||||||
|
config->tx_queue[3] = txq_bk;
|
||||||
config->p2p_search_delay = DEFAULT_P2P_SEARCH_DELAY;
|
config->p2p_search_delay = DEFAULT_P2P_SEARCH_DELAY;
|
||||||
config->rand_addr_lifetime = DEFAULT_RAND_ADDR_LIFETIME;
|
config->rand_addr_lifetime = DEFAULT_RAND_ADDR_LIFETIME;
|
||||||
config->key_mgmt_offload = DEFAULT_KEY_MGMT_OFFLOAD;
|
config->key_mgmt_offload = DEFAULT_KEY_MGMT_OFFLOAD;
|
||||||
|
@ -5165,6 +5182,26 @@ int wpa_config_process_global(struct wpa_config *config, char *pos, int line)
|
||||||
}
|
}
|
||||||
if (i == NUM_GLOBAL_FIELDS) {
|
if (i == NUM_GLOBAL_FIELDS) {
|
||||||
#ifdef CONFIG_AP
|
#ifdef CONFIG_AP
|
||||||
|
if (os_strncmp(pos, "tx_queue_", 9) == 0) {
|
||||||
|
char *tmp = os_strchr(pos, '=');
|
||||||
|
|
||||||
|
if (!tmp) {
|
||||||
|
if (line < 0)
|
||||||
|
wpa_printf(MSG_ERROR,
|
||||||
|
"Line %d: invalid line %s",
|
||||||
|
line, pos);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
*tmp++ = '\0';
|
||||||
|
if (hostapd_config_tx_queue(config->tx_queue, pos,
|
||||||
|
tmp)) {
|
||||||
|
wpa_printf(MSG_ERROR,
|
||||||
|
"Line %d: invalid TX queue item",
|
||||||
|
line);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (os_strncmp(pos, "wmm_ac_", 7) == 0) {
|
if (os_strncmp(pos, "wmm_ac_", 7) == 0) {
|
||||||
char *tmp = os_strchr(pos, '=');
|
char *tmp = os_strchr(pos, '=');
|
||||||
if (tmp == NULL) {
|
if (tmp == NULL) {
|
||||||
|
|
|
@ -1058,6 +1058,7 @@ struct wpa_config {
|
||||||
int p2p_go_max_inactivity;
|
int p2p_go_max_inactivity;
|
||||||
|
|
||||||
struct hostapd_wmm_ac_params wmm_ac_params[4];
|
struct hostapd_wmm_ac_params wmm_ac_params[4];
|
||||||
|
struct hostapd_tx_queue_params tx_queue[4];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* auto_interworking - Whether to use network selection automatically
|
* auto_interworking - Whether to use network selection automatically
|
||||||
|
|
Loading…
Reference in a new issue