From fd2da946d5ad37617cebeb40858460a298a637ae Mon Sep 17 00:00:00 2001 From: Diana Z Date: Fri, 7 May 2021 17:08:39 -0600 Subject: 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 Change-Id: Ie3b554cca017494b86342df1e9149b4452c83852 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2881028 Reviewed-by: Abe Levkoy --- common/usbc/usb_pe_drp_sm.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.1