wfa_dut: Ignore unsupported commands
Commands: sta_preset_testparameters, sta_set_11n, sta_set_wireless,
sta_send_addba are not possible to implement without changes in driver
and/or firmware.
BUG=b:167982753
TEST:python simple_console.py $COMMAND
Change-Id: I06f2edca8e757b8b5b5c0897283024e448cb18c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/Wi-FiTestSuite-Linux-DUT/+/2395675
Reviewed-by: Shuo-Peng Liao <deanliao@chromium.org>
Tested-by: Shuo-Peng Liao <deanliao@chromium.org>
diff --git a/lib/wfa_cmdtbl.c b/lib/wfa_cmdtbl.c
index 6f8c7e9..9503cbb 100644
--- a/lib/wfa_cmdtbl.c
+++ b/lib/wfa_cmdtbl.c
@@ -93,31 +93,27 @@
wfaStaReAssociate, /* WFA_STA_REASSOCIATE (34)*/
wfaStaSetPwrSave, /* WFA_STA_SET_PWRSAVE (35)*/
#ifdef WFA_STA_TB
- wfaStaSendNeigReq, /* WFA_STA_SEND_NEIGREQ (36)*/
- wfaStaPresetParams, /* WFA_STA_PRESET_PARAMETERS (37)*/
+ wfaStaSendNeigReq, /* WFA_STA_SEND_NEIGREQ (36)*/
#else
- wfaStaTestBedCmd, /* WFA_STA_SEND_NEIGREQ (36)*/
- wfaStaTestBedCmd, /* WFA_STA_PRESET_PARAMETERS (37)*/
+ wfaStaTestBedCmd, /* WFA_STA_SEND_NEIGREQ (36)*/
#endif
- wfaStaSetEapFAST, /* WFA_STA_SET_EAPFAST_TLV (38)*/
- wfaStaSetEapAKA, /* WFA_STA_SET_EAPAKA_TLV (49)*/
- wfaStaSetSystime, /* WFA_STA_SET_SYSTIME_TLV (40)*/
+ wfaStaPresetParams, /* WFA_STA_PRESET_PARAMETERS (37)*/
+ wfaStaSetEapFAST, /* WFA_STA_SET_EAPFAST_TLV (38)*/
+ wfaStaSetEapAKA, /* WFA_STA_SET_EAPAKA_TLV (49)*/
+ wfaStaSetSystime, /* WFA_STA_SET_SYSTIME_TLV (40)*/
+ wfaStaSet11n, /* WFA_STA_SET_11n_TLV (41)*/
+ wfaStaSetWireless, /* WFA_STA_SET_WIRELESS_TLV (42)*/
+ wfaStaSendADDBA, /* WFA_STA_SEND_ADDBA_TLV (43)*/
#ifdef WFA_STA_TB
- wfaStaSet11n, /* WFA_STA_SET_11n_TLV (41)*/
- wfaStaSetWireless, /* WFA_STA_SET_WIRELESS_TLV (42)*/
- wfaStaSendADDBA, /* WFA_STA_SEND_ADDBA_TLV (43)*/
- wfaStaSendCoExistMGMT, /* WFA_STA_SET_COEXIST_MGMT_TLV (44)*/
+ wfaStaSendCoExistMGMT, /* WFA_STA_SET_COEXIST_MGMT_TLV (44)*/
#else
- wfaStaTestBedCmd, /* WFA_STA_SET_11n_TLV (41)*/
- wfaStaTestBedCmd, /* WFA_STA_SET_WIRELESS_TLV (42)*/
- wfaStaTestBedCmd, /* WFA_STA_SEND_ADDBA_TLV (43)*/
- wfaStaTestBedCmd, /* WFA_STA_SET_COEXIST_MGMT_TLV (44)*/
+ wfaStaTestBedCmd, /* WFA_STA_SET_COEXIST_MGMT_TLV (44)*/
#endif
- wfaStaSetRIFS, /* WFA_STA_SET_RIFS_TEST_TLV (45)*/
+ wfaStaSetRIFS, /* WFA_STA_SET_RIFS_TEST_TLV (45)*/
#ifdef WFA_STA_TB
- wfaStaResetDefault, /* WFA_STA_RESET_DEFAULT_TLV (46)*/
+ wfaStaResetDefault, /* WFA_STA_RESET_DEFAULT_TLV (46)*/
#else
- wfaStaTestBedCmd, /* WFA_STA_RESET_DEFAULT_TLV (46)*/
+ wfaStaTestBedCmd, /* WFA_STA_RESET_DEFAULT_TLV (46)*/
#endif
wfaStaDisconnect, /* WFA_STA_DISCONNECT_TLV (47)*/
wfaStaDevSendFrame, /* WFA_STA_DEV_SEND_FRAME_TLV (48)*/
diff --git a/lib/wfa_cs.c b/lib/wfa_cs.c
index f44fce4..3287cc7 100644
--- a/lib/wfa_cs.c
+++ b/lib/wfa_cs.c
@@ -3263,9 +3263,8 @@
int wfaStaPresetParams(int len, BYTE* caCmdBuf, int* respLen, BYTE* respBuf) {
dutCmdResponse_t infoResp;
- DPRINT_INFO(WFA_OUT, "Inside wfaStaPresetParameters function ...\n");
+ DPRINT_INFO(WFA_WNG, "command sta_preset_testparameters will be ignored\n");
- // Implement the function and its sub commands
infoResp.status = STATUS_COMPLETE;
wfaEncodeTLV(WFA_STA_PRESET_PARAMETERS_RESP_TLV, 4, (BYTE*)&infoResp,
@@ -3278,6 +3277,8 @@
dutCmdResponse_t infoResp;
dutCmdResponse_t* v11nParamsResp = &infoResp;
+ DPRINT_INFO(WFA_WNG, "command sta_set_11n will be ignored\n");
+
#ifdef WFA_11N_SUPPORT_ONLY
caSta11n_t* v11nParams = (caSta11n_t*)caCmdBuf;
@@ -3494,6 +3495,31 @@
*respLen = WFA_TLV_HDR_LEN + 4;
return WFA_SUCCESS;
}
+
+int wfaStaSetWireless(int len, BYTE* caCmdBuf, int* respLen, BYTE* respBuf) {
+ dutCmdResponse_t* staWirelessResp = &gGenericResp;
+
+ DPRINT_INFO(WFA_WNG, "command sta_set_wireless will be ignored\n");
+
+ staWirelessResp->status = STATUS_COMPLETE;
+ wfaEncodeTLV(WFA_STA_SET_WIRELESS_RESP_TLV, 4, (BYTE*)staWirelessResp,
+ respBuf);
+ *respLen = WFA_TLV_HDR_LEN + 4;
+ return WFA_SUCCESS;
+}
+
+int wfaStaSendADDBA(int len, BYTE* caCmdBuf, int* respLen, BYTE* respBuf) {
+ dutCmdResponse_t* staSendADDBAResp = &gGenericResp;
+
+ DPRINT_INFO(WFA_WNG, "command sta_send_addba will be ignored\n");
+
+ staSendADDBAResp->status = STATUS_COMPLETE;
+ wfaEncodeTLV(WFA_STA_SET_SEND_ADDBA_RESP_TLV, 4, (BYTE*)staSendADDBAResp,
+ respBuf);
+ *respLen = WFA_TLV_HDR_LEN + 4;
+ return WFA_SUCCESS;
+}
+
#endif
/*
* wfaStaAddArpTableEntry():
diff --git a/lib/wfa_typestr.c b/lib/wfa_typestr.c
index 56fb57f..05f6503 100644
--- a/lib/wfa_typestr.c
+++ b/lib/wfa_typestr.c
@@ -175,19 +175,19 @@
{WFA_STA_REASSOCIATE_TLV, "sta_reassociate", xcCmdProcStaReAssociate},
{WFA_STA_DEV_SEND_FRAME_TLV, "dev_send_frame", xcCmdProcStaDevSendFrame},
{WFA_STA_SET_SECURITY_TLV, "sta_set_security", xcCmdProcStaSetSecurity},
-#ifdef WFA_STA_TB
{WFA_STA_PRESET_PARAMETERS_TLV, "sta_preset_testparameters",
xcCmdProcStaPresetTestParameters},
-#endif
{WFA_STA_SET_EAPFAST_TLV, "sta_set_eapfast", xcCmdProcStaSetEapFAST},
{WFA_STA_SET_EAPAKA_TLV, "sta_set_eapaka", xcCmdProcStaSetEapAKA},
{WFA_STA_SET_SYSTIME_TLV, "sta_set_systime", xcCmdProcStaSetSystime},
{WFA_STA_SET_PWRSAVE_TLV, "sta_set_pwrsave", xcCmdProcStaSetPwrSave},
#ifdef WFA_STA_TB
{WFA_STA_RESET_DEFAULT_TLV, "sta_reset_default", xcCmdProcStaResetDefault},
+#endif
{WFA_STA_SET_11N_TLV, "sta_set_11n", xcCmdProcStaSet11n},
{WFA_STA_SET_WIRELESS_TLV, "sta_set_wireless", xcCmdProcStaSetWireless},
{WFA_STA_SEND_ADDBA_TLV, "sta_send_addba", xcCmdProcStaSendADDBA},
+#ifdef WFA_STA_TB
{WFA_STA_SEND_COEXIST_MGMT_TLV, "sta_send_coexist_mgmt",
xcCmdProcStaSendCoExistMGMT},
#endif