summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2014-10-16 13:50:09 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-10-17 03:25:20 +0000
commit66d75af8776a54ed4905aacc197696a520c8e73b (patch)
tree92a0033b0c7fc388ef383155be2ecd11b747d67e
parent0a44f240358ae25e0f6d90e520882cdf10c3f231 (diff)
downloadchrome-ec-66d75af8776a54ed4905aacc197696a520c8e73b.tar.gz
pd: reset the message ID on connection
The message ID counter in our message needs to be reset to 0 on a new connection. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=samus BUG=none TEST=dump the sequence with the USB PD protocol analyzer. Change-Id: I1bddddf4075fba646b1e8c7886059c4a11e5fec9 Reviewed-on: https://chromium-review.googlesource.com/223759 Reviewed-by: Todd Broch <tbroch@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--common/usb_pd_protocol.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index 6c8c8d8ed8..60340767e2 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -1244,6 +1244,8 @@ void pd_task(void)
pd[port].polarity =
GET_POLARITY(cc1_volt, cc2_volt);
pd_select_polarity(port, pd[port].polarity);
+ /* reset message ID counter on connection */
+ pd[port].msg_id = 0;
/* Set to USB SS initially */
#ifdef CONFIG_USBC_SS_MUX
board_set_usb_mux(port, TYPEC_MUX_USB,
@@ -1391,6 +1393,8 @@ void pd_task(void)
cc2_volt);
pd_select_polarity(port,
pd[port].polarity);
+ /* reset message ID on connection */
+ pd[port].msg_id = 0;
set_state(port, PD_STATE_SNK_DISCOVERY);
timeout = 10*MSEC;
break;