diff options
author | Denis Brockus <dbrockus@chromium.org> | 2019-10-14 14:06:05 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-10-16 08:42:19 +0000 |
commit | 7a4e700b6488a138d0c5c55aaa47e626d90a5299 (patch) | |
tree | 7df9a085eed09ffbcff37b4c8a09c71b5e9af0ca /test/fake_prl.c | |
parent | 2dd2eecaa743a65d8369c7799bbc1450b0d91d0e (diff) | |
download | chrome-ec-7a4e700b6488a138d0c5c55aaa47e626d90a5299.tar.gz |
pd: Add PE FRS unit test for new stack
BUG=none
BRANCH=none
TEST=make buildall -j
Change-Id: I55453ddf1d1da0fdee902a33e14357716fb12c4a
Signed-off-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1859826
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'test/fake_prl.c')
-rw-r--r-- | test/fake_prl.c | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/test/fake_prl.c b/test/fake_prl.c new file mode 100644 index 0000000000..abdc27763f --- /dev/null +++ b/test/fake_prl.c @@ -0,0 +1,60 @@ +/* Copyright 2019 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + * + * Fake Protocol Layer module. + */ +#include "common.h" +#include "usb_emsg.h" +#include "usb_prl_sm.h" + +struct extended_msg emsg[CONFIG_USB_PD_PORT_COUNT]; + +void prl_end_ams(int port) +{} + +void prl_execute_hard_reset(int port) +{} + +enum pd_rev_type prl_get_rev(int port) +{ + return PD_REV30; +} + +void prl_hard_reset_complete(int port) +{} + +int prl_is_running(int port) +{ + return 0; +} + +void prl_reset(int port) +{} + +static enum pd_ctrl_msg_type last_ctrl_msg[CONFIG_USB_PD_PORT_COUNT]; +void prl_send_ctrl_msg(int port, enum tcpm_transmit_type type, + enum pd_ctrl_msg_type msg) +{ + last_ctrl_msg[port] = msg; +} + +void prl_send_data_msg(int port, enum tcpm_transmit_type type, + enum pd_data_msg_type msg) +{} + +void prl_send_ext_data_msg(int port, enum tcpm_transmit_type type, + enum pd_ext_msg_type msg) +{} + +void prl_set_rev(int port, enum pd_rev_type rev) +{} + +void prl_start_ams(int port) +{} + + +enum pd_ctrl_msg_type fake_prl_get_last_sent_ctrl_msg(int port) +{ + return last_ctrl_msg[port]; +} |