Allow U-APSD parameters to be configured with SET command

This can be used in non-P2P case to set U-APSD parameters for a
station mode association.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2012-02-16 16:28:31 +02:00 committed by Jouni Malinen
parent 84c78f9570
commit aa074a6485

View File

@ -203,6 +203,42 @@ static int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s,
ret = -1; ret = -1;
else if (disabled) else if (disabled)
wpa_supplicant_set_state(wpa_s, WPA_INACTIVE); wpa_supplicant_set_state(wpa_s, WPA_INACTIVE);
} else if (os_strcasecmp(cmd, "uapsd") == 0) {
if (os_strcmp(value, "disable") == 0)
wpa_s->set_sta_uapsd = 0;
else {
int be, bk, vi, vo;
char *pos;
/* format: BE,BK,VI,VO;max SP Length */
be = atoi(value);
pos = os_strchr(value, ',');
if (pos == NULL)
return -1;
pos++;
bk = atoi(pos);
pos = os_strchr(pos, ',');
if (pos == NULL)
return -1;
pos++;
vi = atoi(pos);
pos = os_strchr(pos, ',');
if (pos == NULL)
return -1;
pos++;
vo = atoi(pos);
/* ignore max SP Length for now */
wpa_s->set_sta_uapsd = 1;
wpa_s->sta_uapsd = 0;
if (be)
wpa_s->sta_uapsd |= BIT(0);
if (bk)
wpa_s->sta_uapsd |= BIT(1);
if (vi)
wpa_s->sta_uapsd |= BIT(2);
if (vo)
wpa_s->sta_uapsd |= BIT(3);
}
} else { } else {
value[-1] = '='; value[-1] = '=';
ret = wpa_config_process_global(wpa_s->conf, cmd, -1); ret = wpa_config_process_global(wpa_s->conf, cmd, -1);