summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAyushee <ayushee.shah@intel.com>2020-01-28 14:53:21 -0800
committerCommit Bot <commit-bot@chromium.org>2020-01-31 01:49:49 +0000
commitd181c052e5c90f78fa2dde64c82690962de39fb5 (patch)
tree7e0e25e5436467eeefb85bec3fca7cae3c1d32db /include
parent71aadcd324ddfcdde2168247d7ef2d19b69db36e (diff)
downloadchrome-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 'include')
-rw-r--r--include/usb_pd.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/usb_pd.h b/include/usb_pd.h
index eaff1212c9..8ce6335b7d 100644
--- a/include/usb_pd.h
+++ b/include/usb_pd.h
@@ -529,6 +529,8 @@ enum pd_rev_type {
/* Cable structure for storing cable attributes */
struct pd_cable {
+ /* Last received cable message id counter*/
+ uint8_t last_cable_msg_id;
uint8_t is_identified;
/* Type of cable */
enum idh_ptype type;
@@ -1683,6 +1685,26 @@ uint32_t *pd_get_mode_vdo(int port, uint16_t svid_idx);
struct svdm_amode_data *pd_get_amode_data(int port, uint16_t svid);
/**
+ * Returns 0 if previous cable messageId count is different from received
+ * messageId count.
+ *
+ * @param port USB-C port number
+ * @param msg_id Received cable msg_id
+ * @return 0 if Received MessageId count is different from the
+ * previous one.
+ * 1 Otherwise
+ */
+int cable_consume_repeat_message(int port, uint8_t msg_id);
+
+/**
+ * Returns status of CABLE_FLAGS_SOP_PRIME_ENABLE flag
+ *
+ * @param port USB-C port number
+ * @return Status of CABLE_FLAGS_SOP_PRIME_ENABLE flag
+ */
+bool is_transmit_msg_sop_prime(int port);
+
+/**
* Returns the status of cable flag - CABLE_FLAGS_SOP_PRIME_ENABLE
*
* @param port USB-C port number