diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index a32cd5c6a..c05175822 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -9809,6 +9809,8 @@ static int wpas_ctrl_iface_send_twt_setup(struct wpa_supplicant *wpa_s, int flow_id = 0; bool protection = false; u8 twt_channel = 0; + u8 control = BIT(4); /* Control field (IEEE P802.11ax/D8.0 Figure + * 9-687): B4 = TWT Information Frame Disabled */ const char *tok_s; tok_s = os_strstr(cmd, " dialog="); @@ -9863,9 +9865,14 @@ static int wpas_ctrl_iface_send_twt_setup(struct wpa_supplicant *wpa_s, if (tok_s) twt_channel = atoi(tok_s + os_strlen(" twt_channel=")); + tok_s = os_strstr(cmd, " control="); + if (tok_s) + control = atoi(tok_s + os_strlen(" control=")); + return wpas_twt_send_setup(wpa_s, dtok, exponent, mantissa, min_twt, setup_cmd, twt, requestor, trigger, implicit, - flow_type, flow_id, protection, twt_channel); + flow_type, flow_id, protection, twt_channel, + control); } diff --git a/wpa_supplicant/twt.c b/wpa_supplicant/twt.c index d77cea227..8ec2c85ac 100644 --- a/wpa_supplicant/twt.c +++ b/wpa_supplicant/twt.c @@ -30,7 +30,7 @@ int wpas_twt_send_setup(struct wpa_supplicant *wpa_s, u8 dtok, int exponent, int mantissa, u8 min_twt, int setup_cmd, u64 twt, bool requestor, bool trigger, bool implicit, bool flow_type, u8 flow_id, bool protection, - u8 twt_channel) + u8 twt_channel, u8 control) { struct wpabuf *buf; u16 req_type = 0; @@ -62,8 +62,7 @@ int wpas_twt_send_setup(struct wpa_supplicant *wpa_s, u8 dtok, int exponent, wpabuf_put_u8(buf, WLAN_EID_TWT); wpabuf_put_u8(buf, 15); /* len */ - wpabuf_put_u8(buf, BIT(4)); /* Control field: - * B4 = TWT Information Frame Disabled */ + wpabuf_put_u8(buf, control); if (requestor) req_type |= BIT(0); /* This STA is a TWT Requesting STA */ diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c index ae10f08a4..95608971f 100644 --- a/wpa_supplicant/wpa_cli.c +++ b/wpa_supplicant/wpa_cli.c @@ -3821,7 +3821,7 @@ static const struct wpa_cli_cmd wpa_cli_commands[] = { }, { "twt_setup", wpa_cli_cmd_twt_setup, NULL, cli_cmd_flag_none, - "[dialog=] [exponent=] [mantissa=] [min_twt=] [setup_cmd=] [twt=] [requestor=0|1] [trigger=0|1] [implicit=0|1] [flow_type=0|1] [flow_id=<3-bit-id>] [protection=0|1] [twt_channel=] = Send TWT Setup frame" + "[dialog=] [exponent=] [mantissa=] [min_twt=] [setup_cmd=] [twt=] [requestor=0|1] [trigger=0|1] [implicit=0|1] [flow_type=0|1] [flow_id=<3-bit-id>] [protection=0|1] [twt_channel=] [control=] = Send TWT Setup frame" }, { "twt_teardown", wpa_cli_cmd_twt_teardown, NULL, cli_cmd_flag_none, diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h index 8705b55b9..68d78c11f 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -1519,7 +1519,7 @@ int wpas_twt_send_setup(struct wpa_supplicant *wpa_s, u8 dtok, int exponent, int mantissa, u8 min_twt, int setup_cmd, u64 twt, bool requestor, bool trigger, bool implicit, bool flow_type, u8 flow_id, bool protection, - u8 twt_channel); + u8 twt_channel, u8 control); int wpas_twt_send_teardown(struct wpa_supplicant *wpa_s, u8 flags); void wpas_rrm_reset(struct wpa_supplicant *wpa_s);