summaryrefslogtreecommitdiff
path: root/include/usb_prl_sm.h
diff options
context:
space:
mode:
authorSam Hurst <shurst@google.com>2020-08-14 13:05:20 -0700
committerCommit Bot <commit-bot@chromium.org>2020-08-22 01:49:02 +0000
commitc2c19821c41f0e20de1cc0c3f6103d338f868198 (patch)
tree859ea9e3dc66ae683280c3b81d1b426237b8d61d /include/usb_prl_sm.h
parent213015c44bd470565091a5eb429a593e79dfc52f (diff)
downloadchrome-ec-c2c19821c41f0e20de1cc0c3f6103d338f868198.tar.gz
TCPMv2: Don't interrupt RX/TX Extended Chunked Msg sequence
Delay sending a new message during the reception or transmitting of Chunked messages. BRANCH=none BUG=b:161836223 TEST=make -j buildall manual: Transmitted an extended message and verified that the sequence was not interrupted by attempting to send a VDM message. Without patch Chunked message request that was interrupted. 20-08-14 10:46:13.473 C1: RECV 9a9f/1 [0]00008c00 20-08-14 10:46:13.494 C1: RECV 9c9f/1 [0]00009400 20-08-14 10:46:13.516 C1: RECV 9e9f/1 [0]00009c00 20-08-14 10:46:13.535 C1: RECV 909f/1 [0]0000a400 Try to send VDM. MSG_TYPE is corrupted, was 0x1f, now 0x0f 20-08-14 10:46:13.563 C1: RECV 928f/1 [0]0000ac00 20-08-14 10:46:13.591 C1: RECV 948f/1 [0]0000b400 20-08-14 10:46:13.618 C1: RECV 968f/1 [0]0000bc00 20-08-14 10:46:13.645 C1: RECV 988f/1 [0]0000c400 20-08-14 10:46:13.674 C1: RECV 9a8f/1 [0]0000cc00 With patch. Chunked message request was not interrupted. 20-08-14 10:50:56.052 C1: RECV 9a9f/1 [0]00008c00 20-08-14 10:50:56.075 C1: RECV 9c9f/1 [0]00009400 20-08-14 10:50:56.093 C1: RECV 9e9f/1 [0]00009c00 20-08-14 10:50:56.114 C1: RECV 909f/1 [0]0000a400 Try to send VDM. Message delayed 20-08-14 10:50:56.134 C1: RECV 929f/1 [0]0000ac00 20-08-14 10:50:56.155 C1: RECV 949f/1 [0]0000b400 20-08-14 10:50:56.175 C1: RECV 969f/1 [0]0000bc00 20-08-14 10:50:56.195 C1: RECV 989f/1 [0]0000c400 20-08-14 10:50:56.216 C1: RECV 9a9f/1 [0]0000cc00 20-08-14 10:50:56.242 C1: RECV 0c90/0 Try to send VDM. Signed-off-by: Sam Hurst <shurst@google.com>wq Change-Id: I5475792ee9f272fe4964e27839e55e3409a6a799 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2357414
Diffstat (limited to 'include/usb_prl_sm.h')
-rw-r--r--include/usb_prl_sm.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/usb_prl_sm.h b/include/usb_prl_sm.h
index 4f6f86e346..d5d133f250 100644
--- a/include/usb_prl_sm.h
+++ b/include/usb_prl_sm.h
@@ -22,6 +22,15 @@
int prl_is_running(int port);
/**
+ * Returns true if the Protocol Layer State Machine is in the
+ * process of transmitting or receiving chunked messages.
+ *
+ * @param port USB-C port number
+ * @return true if sending or receiving a chunked message, else false
+ */
+bool prl_is_busy(int port);
+
+/**
* Sets the debug level for the PRL layer
*
* @param level debug level