diff options
author | Andrew McRae <amcrae@google.com> | 2020-06-22 01:23:52 +1000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-06-24 07:15:59 +0000 |
commit | e6636517406afa7115825de36ac52b5498ca70c4 (patch) | |
tree | ca551b16e9a4b6ce14765b0e5d615e212611f38c /test | |
parent | 40d09f45d976574338455821a01faae79174a7c2 (diff) | |
download | chrome-ec-e6636517406afa7115825de36ac52b5498ca70c4.tar.gz |
TCPMv2: Refactor DP mode to use a state machine
Refactor the DP alt mode handling to use a state machine
to process the commands, ACKs and NAKs.
Also add states to handle detecting a NAK on a DP mode enter command,
and attempt to exit the mode and then retry.
When a partner enters alt mode (e.g a monitor with DP alt mode), and
the EC is reset or goes into recovery mode, the new negotiation will
fail because the command to enter alt mode when the partner is already
in that mode will fail with a NAK.
BUG=b:159073520
TEST=Tested on duffy with a type-C monitor.
BRANCH=none
Signed-off-by: Andrew McRae <amcrae@google.com>
Change-Id: I0b4506b17987ba71e51f019910db84b32a6da2c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2256620
Reviewed-by: Andrew McRae <amcrae@chromium.org>
Commit-Queue: Andrew McRae <amcrae@chromium.org>
Tested-by: Andrew McRae <amcrae@chromium.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/fake_usbc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/fake_usbc.c b/test/fake_usbc.c index 8ed2771f5e..7536fa5e97 100644 --- a/test/fake_usbc.c +++ b/test/fake_usbc.c @@ -244,10 +244,6 @@ void dp_vdm_acked(int port, int cmd) { } -void dp_reset_next_command(int port) -{ -} - void dpm_init(int port) { } @@ -257,6 +253,10 @@ void dpm_vdm_acked(int port, enum tcpm_transmit_type type, int vdo_count, { } +void dp_teardown(int port) +{ +} + void dpm_vdm_naked(int port, enum tcpm_transmit_type type, uint16_t svid, uint8_t vdm_cmd) { |