diff options
author | Abe Levkoy <alevkoy@chromium.org> | 2021-08-27 15:21:39 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-08-31 18:18:20 +0000 |
commit | 003ec08f8c67845ae8481d3fb4124555213b04c4 (patch) | |
tree | 3502c59532731d0003532657b1a2993e8ca9ad81 /common/usbc/usb_prl_sm.c | |
parent | 5fa669005c3779b7310bf6bfe43f741a3d8ae871 (diff) | |
download | chrome-ec-003ec08f8c67845ae8481d3fb4124555213b04c4.tar.gz |
TCPM: Rename enum tcpm_sop_type and its constants
As a followup to CL:3104290, give the TCPCI TRANSMIT and
RX_BUF_FRAME_TYPE types more consistent names. Most of them can be used
for receiving, not just transmitting. Fix lint errors thus revealed.
BUG=b:155476419
TEST=make buildall
BRANCH=none
Signed-off-by: Abe Levkoy <alevkoy@chromium.org>
Change-Id: I399ec479eacc18622fc4d3f55f8bdabf4560fcff
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3125995
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'common/usbc/usb_prl_sm.c')
-rw-r--r-- | common/usbc/usb_prl_sm.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/common/usbc/usb_prl_sm.c b/common/usbc/usb_prl_sm.c index 0fcc9ba663..a58a579775 100644 --- a/common/usbc/usb_prl_sm.c +++ b/common/usbc/usb_prl_sm.c @@ -312,7 +312,7 @@ static struct tx_chunked { /* Message Reception State Machine Object */ static struct protocol_layer_rx { /* received message type */ - enum tcpm_sop_type sop; + enum tcpci_msg_type sop; /* message ids for all valid port partners */ int msg_id[NUM_SOP_STAR_TYPES]; } prl_rx[CONFIG_USB_PD_PORT_MAX_COUNT]; @@ -324,7 +324,7 @@ static struct protocol_layer_tx { /* state machine flags */ uint32_t flags; /* last message type we transmitted */ - enum tcpm_sop_type last_xmit_type; + enum tcpci_msg_type last_xmit_type; /* message id counters for all 6 port partners */ uint32_t msg_id_counter[NUM_SOP_STAR_TYPES]; /* transmit status */ @@ -344,7 +344,7 @@ static struct pd_message { /* message status flags */ uint32_t flags; /* SOP* */ - enum tcpm_sop_type xmit_type; + enum tcpci_msg_type xmit_type; /* type of message */ uint8_t msg_type; /* PD revision */ @@ -566,7 +566,7 @@ static void prl_init(int port) prl_tx[port].flags = 0; if (IS_ENABLED(CONFIG_USB_PD_REV30)) typec_select_src_collision_rp(port, SINK_TX_OK); - prl_tx[port].last_xmit_type = TCPC_TX_SOP; + prl_tx[port].last_xmit_type = TCPCI_MSG_SOP; prl_tx[port].xmit_status = TCPC_TX_UNSET; if (IS_ENABLED(CONFIG_USB_PD_REV30)) { @@ -627,7 +627,7 @@ void prl_hard_reset_complete(int port) } void prl_send_ctrl_msg(int port, - enum tcpm_sop_type type, + enum tcpci_msg_type type, enum pd_ctrl_msg_type msg) { pdmsg[port].xmit_type = type; @@ -647,7 +647,7 @@ void prl_send_ctrl_msg(int port, } void prl_send_data_msg(int port, - enum tcpm_sop_type type, + enum tcpci_msg_type type, enum pd_data_msg_type msg) { pdmsg[port].xmit_type = type; @@ -667,7 +667,7 @@ void prl_send_data_msg(int port, #ifdef CONFIG_USB_PD_EXTENDED_MESSAGES void prl_send_ext_data_msg(int port, - enum tcpm_sop_type type, + enum tcpci_msg_type type, enum pd_ext_msg_type msg) { pdmsg[port].xmit_type = type; @@ -686,11 +686,11 @@ void prl_set_default_pd_revision(int port) * partner doesn't support this revision, the Protocol Engine will * lower this value to the revision supported by the partner. */ - pdmsg[port].rev[TCPC_TX_SOP] = PD_REVISION; - pdmsg[port].rev[TCPC_TX_SOP_PRIME] = PD_REVISION; - pdmsg[port].rev[TCPC_TX_SOP_PRIME_PRIME] = PD_REVISION; - pdmsg[port].rev[TCPC_TX_SOP_DEBUG_PRIME] = PD_REVISION; - pdmsg[port].rev[TCPC_TX_SOP_DEBUG_PRIME_PRIME] = PD_REVISION; + pdmsg[port].rev[TCPCI_MSG_SOP] = PD_REVISION; + pdmsg[port].rev[TCPCI_MSG_SOP_PRIME] = PD_REVISION; + pdmsg[port].rev[TCPCI_MSG_SOP_PRIME_PRIME] = PD_REVISION; + pdmsg[port].rev[TCPCI_MSG_SOP_DEBUG_PRIME] = PD_REVISION; + pdmsg[port].rev[TCPCI_MSG_SOP_DEBUG_PRIME_PRIME] = PD_REVISION; } void prl_reset_soft(int port) @@ -772,7 +772,7 @@ void prl_run(int port, int evt, int en) } } -void prl_set_rev(int port, enum tcpm_sop_type type, +void prl_set_rev(int port, enum tcpci_msg_type type, enum pd_rev_type rev) { /* We only store revisions for SOP* types. */ @@ -781,7 +781,7 @@ void prl_set_rev(int port, enum tcpm_sop_type type, pdmsg[port].rev[type] = rev; } -enum pd_rev_type prl_get_rev(int port, enum tcpm_sop_type type) +enum pd_rev_type prl_get_rev(int port, enum tcpci_msg_type type) { /* We only store revisions for SOP* types. */ ASSERT(type < NUM_SOP_STAR_TYPES); @@ -838,7 +838,7 @@ static __maybe_unused int pdmsg_xmit_type_is_rev30(const int port) static bool is_sop_rev30(const int port) { return IS_ENABLED(CONFIG_USB_PD_REV30) && - prl_get_rev(port, TCPC_TX_SOP) == PD_REV30; + prl_get_rev(port, TCPCI_MSG_SOP) == PD_REV30; } /* Common Protocol Layer Message Transmission */ @@ -1053,7 +1053,7 @@ static void prl_tx_layer_reset_for_transmit_run(const int port) static uint32_t get_sop_star_header(const int port) { - const int is_sop_packet = pdmsg[port].xmit_type == TCPC_TX_SOP; + const int is_sop_packet = pdmsg[port].xmit_type == TCPCI_MSG_SOP; int ext; #ifdef CONFIG_USB_PD_EXTENDED_MESSAGES @@ -1280,7 +1280,7 @@ void prl_hr_send_msg_to_phy(const int port) /* Header is not used for hard reset */ const uint32_t header = 0; - pdmsg[port].xmit_type = TCPC_TX_HARD_RESET; + pdmsg[port].xmit_type = TCPCI_MSG_TX_HARD_RESET; /* * These flags could be set if this function is called before the @@ -2191,7 +2191,7 @@ static void prl_rx_wait_for_phy_message(const int port, int evt) */ if (!IS_ENABLED(CONFIG_USB_CTVPD) && !IS_ENABLED(CONFIG_USB_VPD) && - PD_HEADER_GET_SOP(header) != TCPC_TX_SOP && + PD_HEADER_GET_SOP(header) != TCPCI_MSG_SOP && PD_HEADER_PROLE(header) == PD_PLUG_FROM_DFP_UFP) return; |