summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDenis Brockus <dbrockus@google.com>2021-01-07 13:36:08 -0700
committerCommit Bot <commit-bot@chromium.org>2021-01-08 00:20:00 +0000
commitcc65ccf26437c5a2380ab7dfda4d962b0407a314 (patch)
tree91c2c614f1d489f0b6fd8ec93d705615ef1b74ec /test
parenteac9f031be5ee7c8a1dccf524e140c218b0a883c (diff)
downloadchrome-ec-cc65ccf26437c5a2380ab7dfda4d962b0407a314.tar.gz
TCPMv2: Compliance Unit Test - cleanup mock_tcpci_tx_msg_id_reset
nit request to rename mock_tcpci_tx_msg_id_reset to be partner_tx_msg_id_reset BUG=none BRANCH=none TEST=make buildall Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I0bb2bf7937e9c6f858697a1ecd835337652cb29b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2615626 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/usb_tcpmv2_compliance.c2
-rw-r--r--test/usb_tcpmv2_compliance.h6
-rw-r--r--test/usb_tcpmv2_compliance_common.c20
3 files changed, 14 insertions, 14 deletions
diff --git a/test/usb_tcpmv2_compliance.c b/test/usb_tcpmv2_compliance.c
index d827e3da04..bd6b3303a5 100644
--- a/test/usb_tcpmv2_compliance.c
+++ b/test/usb_tcpmv2_compliance.c
@@ -14,10 +14,10 @@
void before_test(void)
{
partner_set_pd_rev(PD_REV30);
+ partner_tx_msg_id_reset(TCPC_TX_SOP_ALL);
mock_usb_mux_reset();
mock_tcpci_reset();
- mock_tcpci_tx_msg_id_reset(TCPC_TX_SOP_ALL);
/* Restart the PD task and let it settle */
task_set_event(TASK_ID_PD_C0, TASK_EVENT_RESET_DONE);
diff --git a/test/usb_tcpmv2_compliance.h b/test/usb_tcpmv2_compliance.h
index 4f33d88050..2468d857e9 100644
--- a/test/usb_tcpmv2_compliance.h
+++ b/test/usb_tcpmv2_compliance.h
@@ -40,9 +40,6 @@ bool vboot_allow_usb_pd(void);
int pd_check_vconn_swap(int port);
void board_reset_pd_mcu(void);
-#define TCPC_TX_SOP_ALL -1
-void mock_tcpci_tx_msg_id_reset(int sop);
-
int tcpci_startup(void);
void partner_set_data_role(enum pd_data_role data_role);
@@ -54,6 +51,9 @@ enum pd_power_role partner_get_power_role(void);
void partner_set_pd_rev(enum pd_rev_type pd_rev);
enum pd_rev_type partner_get_pd_rev(void);
+#define TCPC_TX_SOP_ALL -1
+void partner_tx_msg_id_reset(int sop);
+
void partner_send_msg(enum pd_msg_type sop,
uint16_t type,
uint16_t cnt,
diff --git a/test/usb_tcpmv2_compliance_common.c b/test/usb_tcpmv2_compliance_common.c
index 72b57ee50e..92efe5a616 100644
--- a/test/usb_tcpmv2_compliance_common.c
+++ b/test/usb_tcpmv2_compliance_common.c
@@ -82,16 +82,6 @@ int pd_check_vconn_swap(int port)
void board_reset_pd_mcu(void) {}
-static int partner_tx_id[6];
-void mock_tcpci_tx_msg_id_reset(int sop)
-{
- if (sop == TCPC_TX_SOP_ALL)
- for (sop = PD_MSG_SOP; sop <= PD_MSG_SOP_CBL_RST; ++sop)
- partner_tx_id[sop] = 0;
- else
- partner_tx_id[sop] = 0;
-}
-
/*****************************************************************************
* Partner utility functions
*/
@@ -125,6 +115,16 @@ enum pd_rev_type partner_get_pd_rev(void)
return partner_pd_rev;
}
+static int partner_tx_id[NUM_SOP_STAR_TYPES];
+void partner_tx_msg_id_reset(int sop)
+{
+ if (sop == TCPC_TX_SOP_ALL)
+ for (sop = 0; sop < NUM_SOP_STAR_TYPES; ++sop)
+ partner_tx_id[sop] = 0;
+ else
+ partner_tx_id[sop] = 0;
+}
+
void partner_send_msg(enum pd_msg_type sop,
uint16_t type,
uint16_t cnt,