summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2021-05-07 17:08:39 -0600
committerCommit Bot <commit-bot@chromium.org>2021-05-14 17:48:22 +0000
commitfd2da946d5ad37617cebeb40858460a298a637ae (patch)
tree31b3488c31d5b28b86c55893d7268ba68243b3e1
parent495dcefeba9ab01c5873686d4c33a973f3050e89 (diff)
downloadchrome-ec-fd2da946d5ad37617cebeb40858460a298a637ae.tar.gz
TCPMv2: Correct PD 3.0 reply when SVDM isn't supported
In PD 3.0, a DUT must reply with Not_Supported when a SVDM isn't supported. Note that PD 2.0 is still perfectly welcome to send a NAK reply for this case. BRANCH=None BUG=b:181194535 TEST=with follow-on CL, verify TD.PD.VNDI3.E3 VDM Identity passes Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ie3b554cca017494b86342df1e9149b4452c83852 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2881028 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
-rw-r--r--common/usbc/usb_pe_drp_sm.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c
index 1346f0fd9f..17fb9d95f0 100644
--- a/common/usbc/usb_pe_drp_sm.c
+++ b/common/usbc/usb_pe_drp_sm.c
@@ -5988,7 +5988,17 @@ static void pe_vdm_response_entry(int port)
vdo_len = 1;
}
} else {
- /* Received at VDM command which is not supported */
+ /*
+ * Received at VDM command which is not supported. PD 2.0 may
+ * NAK or ignore the message (see TD.PD.VNDI.E1. VDM Identity
+ * steps), but PD 3.0 must send Not_Supported (PD 3.0 Ver 2.0 +
+ * ECNs 2020-12-10 Table 6-64 Response to an incoming
+ * VDM or TD.PD.VNDI3.E3 VDM Identity steps)
+ */
+ if (prl_get_rev(port, TCPC_TX_SOP) == PD_REV30) {
+ set_state_pe(port, PE_SEND_NOT_SUPPORTED);
+ return;
+ }
tx_payload[0] |= VDO_CMDT(CMDT_RSP_NAK);
vdo_len = 1;
}