diff options
Diffstat (limited to 'common/mock/usb_prl_mock.c')
-rw-r--r-- | common/mock/usb_prl_mock.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/common/mock/usb_prl_mock.c b/common/mock/usb_prl_mock.c index ae7874d4ac..d5f4781829 100644 --- a/common/mock/usb_prl_mock.c +++ b/common/mock/usb_prl_mock.c @@ -26,11 +26,11 @@ struct extended_msg tx_emsg[CONFIG_USB_PD_PORT_MAX_COUNT]; struct mock_prl_port_t { enum pd_ctrl_msg_type last_ctrl_msg; enum pd_data_msg_type last_data_msg; - enum tcpm_sop_type last_tx_type; + enum tcpci_msg_type last_tx_type; bool message_sent; bool message_received; enum pe_error error; - enum tcpm_sop_type error_tx_type; + enum tcpci_msg_type error_tx_type; }; struct mock_prl_port_t mock_prl_port[CONFIG_USB_PD_PORT_MAX_COUNT]; @@ -46,8 +46,8 @@ void mock_prl_reset(void) memset(mock_prl_port, 0, sizeof(mock_prl_port)); for (port = 0 ; port < CONFIG_USB_PD_PORT_MAX_COUNT ; ++port) { - mock_prl_port[port].last_tx_type = TCPC_TX_INVALID; - mock_prl_port[port].error_tx_type = TCPC_TX_INVALID; + mock_prl_port[port].last_tx_type = TCPCI_MSG_INVALID; + mock_prl_port[port].error_tx_type = TCPCI_MSG_INVALID; } } @@ -58,10 +58,10 @@ void prl_execute_hard_reset(int port) { mock_prl_port[port].last_ctrl_msg = 0; mock_prl_port[port].last_data_msg = 0; - mock_prl_port[port].last_tx_type = TCPC_TX_HARD_RESET; + mock_prl_port[port].last_tx_type = TCPCI_MSG_TX_HARD_RESET; } -enum pd_rev_type prl_get_rev(int port, enum tcpm_sop_type partner) +enum pd_rev_type prl_get_rev(int port, enum tcpci_msg_type partner) { return PD_REV30; } @@ -82,7 +82,7 @@ __overridable bool prl_is_busy(int port) void prl_reset_soft(int port) {} -void prl_send_ctrl_msg(int port, enum tcpm_sop_type type, +void prl_send_ctrl_msg(int port, enum tcpci_msg_type type, enum pd_ctrl_msg_type msg) { mock_prl_port[port].last_ctrl_msg = msg; @@ -90,7 +90,7 @@ void prl_send_ctrl_msg(int port, enum tcpm_sop_type type, mock_prl_port[port].last_tx_type = type; } -void prl_send_data_msg(int port, enum tcpm_sop_type type, +void prl_send_data_msg(int port, enum tcpci_msg_type type, enum pd_data_msg_type msg) { mock_prl_port[port].last_data_msg = msg; @@ -98,17 +98,17 @@ void prl_send_data_msg(int port, enum tcpm_sop_type type, mock_prl_port[port].last_tx_type = type; } -void prl_send_ext_data_msg(int port, enum tcpm_sop_type type, +void prl_send_ext_data_msg(int port, enum tcpci_msg_type type, enum pd_ext_msg_type msg) {} -void prl_set_rev(int port, enum tcpm_sop_type partner, +void prl_set_rev(int port, enum tcpci_msg_type partner, enum pd_rev_type rev) {} int mock_prl_wait_for_tx_msg(int port, - enum tcpm_sop_type tx_type, + enum tcpci_msg_type tx_type, enum pd_ctrl_msg_type ctrl_msg, enum pd_data_msg_type data_msg, int timeout) @@ -116,7 +116,7 @@ int mock_prl_wait_for_tx_msg(int port, uint64_t end_time = get_time().val + timeout; while (get_time().val < end_time) { - if (mock_prl_port[port].last_tx_type != TCPC_TX_INVALID) { + if (mock_prl_port[port].last_tx_type != TCPCI_MSG_INVALID) { TEST_EQ(mock_prl_port[port].last_tx_type, tx_type, "%d"); TEST_EQ(mock_prl_port[port].last_ctrl_msg, @@ -153,7 +153,7 @@ void mock_prl_clear_last_sent_msg(int port) { mock_prl_port[port].last_data_msg = 0; mock_prl_port[port].last_ctrl_msg = 0; - mock_prl_port[port].last_tx_type = TCPC_TX_INVALID; + mock_prl_port[port].last_tx_type = TCPCI_MSG_INVALID; } timestamp_t prl_get_tcpc_tx_success_ts(int port) @@ -171,7 +171,7 @@ void mock_prl_message_received(int port) } void mock_prl_report_error(int port, enum pe_error e, - enum tcpm_sop_type tx_type) + enum tcpci_msg_type tx_type) { mock_prl_port[port].error = e; mock_prl_port[port].error_tx_type = tx_type; @@ -189,12 +189,12 @@ void prl_run(int port, int evt, int en) pe_message_received(port); mock_prl_port[port].message_received = 0; } - if (mock_prl_port[port].error_tx_type != TCPC_TX_INVALID) { + if (mock_prl_port[port].error_tx_type != TCPCI_MSG_INVALID) { ccprints("pe_error %d", mock_prl_port[port].error); pe_report_error(port, mock_prl_port[port].error, mock_prl_port[port].error_tx_type); mock_prl_port[port].error = 0; - mock_prl_port[port].error_tx_type = TCPC_TX_INVALID; + mock_prl_port[port].error_tx_type = TCPCI_MSG_INVALID; } } |