diff options
author | Ayushee <ayushee.shah@intel.com> | 2020-01-28 14:53:21 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-01-31 01:49:49 +0000 |
commit | d181c052e5c90f78fa2dde64c82690962de39fb5 (patch) | |
tree | 7e0e25e5436467eeefb85bec3fca7cae3c1d32db /common/usb_pd_protocol.c | |
parent | 71aadcd324ddfcdde2168247d7ef2d19b69db36e (diff) | |
download | chrome-ec-d181c052e5c90f78fa2dde64c82690962de39fb5.tar.gz |
usb_pd TCPMv1: Maintain independent MessageID for SOP Prime
This patchset enables storage of MessageId counter received from the
cable plug.
Since SOP*(Cable) communication and SOP(Port Partner) have separate
MessageID counters, it is necessary to store separate messageIDs to
avoid the the incoming packets from getting dropped.
BUG=b:148481858
BRANCH=None
TEST=Tested on Volteer, able to maintain separate MessageId count for
SOP and SOP' communication.
Change-Id: Iac2dc616f99a9e19914588e59441df8b09068afa
Signed-off-by: Ayushee <ayushee.shah@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2026650
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'common/usb_pd_protocol.c')
-rw-r--r-- | common/usb_pd_protocol.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 6e29bf06b8..18a6afdfbb 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -700,6 +700,14 @@ static int consume_repeat_message(int port, uint16_t msg_header) if (PD_HEADER_TYPE(msg_header) == PD_CTRL_SOFT_RESET && PD_HEADER_CNT(msg_header) == 0) { return 0; + /* TODO: Check for incoming SOP'' messages */ + } else if (is_transmit_msg_sop_prime(port)) { + /* + * From USB PD version 1.3 section 6.7.1, the port which + * communicates using SOP* Packets Shall maintain copy + * of the last MessageID for each type of SOP* it uses. + */ + return cable_consume_repeat_message(port, msg_id); } else if (pd[port].last_msg_id != msg_id) { pd[port].last_msg_id = msg_id; } else if (pd[port].last_msg_id == msg_id) { |