diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2014-12-20 18:03:47 -0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-04-10 23:29:31 +0000 |
commit | 15391709fd964e23d91deaf3db832a9d83da1ea5 (patch) | |
tree | 16c9bbcc696f810c7fbe2fc96f0cae9b901ccf72 /board/twinkie/injector.h | |
parent | 686a23585e2bc8a357842bd30ea3cae0cc5648da (diff) | |
download | chrome-ec-15391709fd964e23d91deaf3db832a9d83da1ea5.tar.gz |
twinkie: add simple text tracing mechanism
When using the Twinkie dongle without a protocol decoder on the host,
add a simple text tracing mechanism, so the user can get the timestamped traces
of the packets on the wire (in a best effort fashion).
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=none
BUG=none
TEST=On Twinkie command-line, type "tw trace on"
then plug a DingDong to Samus through Twinkie and
see the PD message traces on the console.
Change-Id: I4fa35d6783cc6279c95209c86f37e6d717de7301
Reviewed-on: https://chromium-review.googlesource.com/237222
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Trybot-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/twinkie/injector.h')
-rw-r--r-- | board/twinkie/injector.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/board/twinkie/injector.h b/board/twinkie/injector.h index 0e360a2fdc..11c3c095f2 100644 --- a/board/twinkie/injector.h +++ b/board/twinkie/injector.h @@ -39,6 +39,8 @@ enum inj_cmd { INJ_CMD_GET = 0x5, /* Get parameter arg1 (INJ_GET_x) at index arg0 */ INJ_CMD_SET = 0x6, /* Set parameter arg1 (INJ_SET_x) with arg0 */ INJ_CMD_JUMP = 0x8, /* Jump to index (as arg0) */ + INJ_CMD_EXPCT = 0xC, /* Expect a packet with command arg2 */ + /* and timeout after arg0 ms */ INJ_CMD_NOP = 0xF, /* No-Operation */ }; @@ -49,6 +51,7 @@ enum inj_set { INJ_SET_TX_SPEED = 3, /* TX frequency is arg0 kHz */ INJ_SET_RX_THRESH = 4, /* RX voltage threshold is arg0 mV */ INJ_SET_POLARITY = 5, /* Polarity for other operations (INJ_POL_CC) */ + INJ_SET_TRACE = 6, /* Text packet trace on/raw/off */ }; enum inj_get { @@ -73,6 +76,12 @@ enum inj_pol { INJ_POL_AUTO = 0xffff, }; +enum trace_mode { + TRACE_MODE_OFF = 0, + TRACE_MODE_RAW = 1, + TRACE_MODE_ON = 2, +}; + /* Number of words in the FSM command/data buffer */ #define INJ_CMD_COUNT 128 |