ctrl_iface: Add wmm_ac_addts and wmm_ac_delts commands

wmm_ac_addts command will add (or update) a traffic stream and
wmm_ac_delts command will delete an existing traffic stream.

Signed-off-by: Moshe Benji <moshe.benji@intel.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
This commit is contained in:
Moshe Benji 2014-10-22 08:03:59 -04:00 committed by Jouni Malinen
parent 1b640fd27c
commit eb2f2088aa

View File

@ -650,6 +650,56 @@ static int ctrl_iface_get_capability_tdls(
#endif /* CONFIG_TDLS */
static int wmm_ac_ctrl_addts(struct wpa_supplicant *wpa_s, char *cmd)
{
char *token, *context = NULL;
struct wmm_ac_ts_setup_params params = {
.tsid = 0xff,
.direction = 0xff,
};
while ((token = str_token(cmd, " ", &context))) {
if (sscanf(token, "tsid=%i", &params.tsid) == 1 ||
sscanf(token, "up=%i", &params.user_priority) == 1 ||
sscanf(token, "nominal_msdu_size=%i",
&params.nominal_msdu_size) == 1 ||
sscanf(token, "mean_data_rate=%i",
&params.mean_data_rate) == 1 ||
sscanf(token, "min_phy_rate=%i",
&params.minimum_phy_rate) == 1 ||
sscanf(token, "sba=%i",
&params.surplus_bandwidth_allowance) == 1)
continue;
if (os_strcasecmp(token, "downlink") == 0) {
params.direction = WMM_TSPEC_DIRECTION_DOWNLINK;
} else if (os_strcasecmp(token, "uplink") == 0) {
params.direction = WMM_TSPEC_DIRECTION_UPLINK;
} else if (os_strcasecmp(token, "bidi") == 0) {
params.direction = WMM_TSPEC_DIRECTION_BI_DIRECTIONAL;
} else if (os_strcasecmp(token, "fixed_nominal_msdu") == 0) {
params.fixed_nominal_msdu = 1;
} else {
wpa_printf(MSG_DEBUG,
"CTRL: Invalid WMM_AC_ADDTS parameter: '%s'",
token);
return -1;
}
}
return wpas_wmm_ac_addts(wpa_s, &params);
}
static int wmm_ac_ctrl_delts(struct wpa_supplicant *wpa_s, char *cmd)
{
u8 tsid = atoi(cmd);
return wpas_wmm_ac_delts(wpa_s, tsid);
}
#ifdef CONFIG_IEEE80211R
static int wpa_supplicant_ctrl_iface_ft_ds(
struct wpa_supplicant *wpa_s, char *addr)
@ -7304,6 +7354,12 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
if (wpa_supplicant_ctrl_iface_tdls_teardown(wpa_s, buf + 14))
reply_len = -1;
#endif /* CONFIG_TDLS */
} else if (os_strncmp(buf, "WMM_AC_ADDTS ", 13) == 0) {
if (wmm_ac_ctrl_addts(wpa_s, buf + 13))
reply_len = -1;
} else if (os_strncmp(buf, "WMM_AC_DELTS ", 13) == 0) {
if (wmm_ac_ctrl_delts(wpa_s, buf + 13))
reply_len = -1;
} else if (os_strncmp(buf, "SIGNAL_POLL", 11) == 0) {
reply_len = wpa_supplicant_signal_poll(wpa_s, reply,
reply_size);