DRIVER_WCN: Configure FT Over DS enable/disable only when required
Skip sending FT Over DS enable/disable command to WCN driver if current
FT over DS state is matching the CAPI command request.
This is to avoid failure with legacy WCN drivers which doesn't support
FT over DS and when the tests are sending only FT Over DS disable
commands during the whole test.
With this change FT over DS disable commands will be ignored until the
enable command comes since by default FT over DS getting disabled in
sta_reset_default.
This fixes the commit 7aa4860a6e5a ("STA: Add support for FT over DS
with DRIVER_WCN"), before this commit FT Over DS disable/enable
commands were getting ignored for DRIVER_WCN.
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
diff --git a/sta.c b/sta.c
index bb1f570..6c20b85 100644
--- a/sta.c
+++ b/sta.c
@@ -5966,22 +5966,28 @@
val = get_param(cmd, "FT_DS");
if (val) {
+ int sta_ft_ds;
+
if (strcasecmp(val, "Enable") == 0) {
- dut->sta_ft_ds = 1;
+ sta_ft_ds = 1;
} else if (strcasecmp(val, "Disable") == 0) {
- dut->sta_ft_ds = 0;
+ sta_ft_ds = 0;
} else {
send_resp(dut, conn, SIGMA_ERROR,
"errorCode,Unsupported value for FT_DS");
return STATUS_SENT_ERROR;
}
- if (get_driver_type(dut) == DRIVER_WCN &&
+
+ if (dut->sta_ft_ds != sta_ft_ds &&
+ get_driver_type(dut) == DRIVER_WCN &&
sta_config_params(dut, intf, STA_SET_FT_DS,
- dut->sta_ft_ds) != 0) {
+ sta_ft_ds) != 0) {
send_resp(dut, conn, SIGMA_ERROR,
"errorCode,Failed to enable/disable FT_DS");
return STATUS_SENT_ERROR;
}
+
+ dut->sta_ft_ds = sta_ft_ds;
}
val = get_param(cmd, "Program");