summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbe Levkoy <alevkoy@chromium.org>2020-06-09 10:59:34 -0600
committerCommit Bot <commit-bot@chromium.org>2020-06-11 19:45:07 +0000
commitddb0e17c669db437ba4042b15c70d23e62632557 (patch)
treecf428116f4b48c9018e01878048660fe22cac564
parentc56c8be5389cab4d8974e58260b38533a2ec8d33 (diff)
downloadchrome-ec-ddb0e17c669db437ba4042b15c70d23e62632557.tar.gz
TCPMv2 PE: Remove partner_type field
It is redundant with tx_type and essentially unused at this point. BUG=b:158572770 TEST=make buildall BRANCH=none Change-Id: I1818acd93dacf14b657003209256010d5477c76f Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2238536 Reviewed-by: Diana Z <dzigterman@chromium.org>
-rw-r--r--common/usbc/usb_pe_drp_sm.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c
index d4fd14abdd..b34074986e 100644
--- a/common/usbc/usb_pe_drp_sm.c
+++ b/common/usbc/usb_pe_drp_sm.c
@@ -386,11 +386,6 @@ extern enum usb_pe_state PE_PRS_FRS_SHARE_NOT_SUPPORTED;
void pe_set_frs_enable(int port, int enable);
#endif /* CONFIG_USB_PD_REV30 */
-enum port_partner {
- PORT,
- CABLE,
-};
-
/*
* This enum is used to implement a state machine consisting of at most
* 3 states, inside a Policy Engine State.
@@ -458,7 +453,6 @@ static struct policy_engine {
/* VDM - used to send information to shared VDM Request state */
/* TODO(b/150611251): Remove when all VDMs use shared parent */
- enum port_partner partner_type;
uint32_t vdm_cnt;
uint32_t vdm_data[VDO_HDR_SIZE + VDO_MAX_SIZE];
@@ -1027,8 +1021,6 @@ void pe_message_sent(int port)
void pd_send_vdm(int port, uint32_t vid, int cmd, const uint32_t *data,
int count)
{
- pe[port].partner_type = PORT;
-
/* Copy VDM Header */
pe[port].vdm_data[0] = VDO(vid, ((vid & USB_SID_PD) == USB_SID_PD) ?
1 : (PD_VDO_CMD(cmd) <= CMD_ATTENTION),
@@ -4168,7 +4160,8 @@ static void pe_vdm_send_request_run(int port)
*/
if (get_time().val > pe[port].vdm_response_timer) {
CPRINTF("VDM %s Response Timeout\n",
- pe[port].partner_type ? "Cable" : "Port");
+ pe[port].tx_type == TCPC_TX_SOP ?
+ "Port" : "Cable");
/*
* Flag timeout so child state can mark appropriate discovery
* item as failed.
@@ -4206,6 +4199,9 @@ static void pe_vdm_identity_request_cbl_entry(int port)
send_data_msg(port, TCPC_TX_SOP_PRIME, PD_DATA_VENDOR_DEF);
+ /* PE_VDM_SEND_REQUEST (the parent state) uses this field. */
+ pe[port].tx_type = TCPC_TX_SOP_PRIME;
+
pe[port].discover_identity_counter++;
}
@@ -4370,6 +4366,9 @@ static void pe_init_port_vdm_identity_request_entry(int port)
tx_emsg[port].len = sizeof(uint32_t);
send_data_msg(port, TCPC_TX_SOP, PD_DATA_VENDOR_DEF);
+
+ /* PE_VDM_SEND_REQUEST (the parent state) uses this field. */
+ pe[port].tx_type = TCPC_TX_SOP;
}
static void pe_init_port_vdm_identity_request_run(int port)