diff options
author | Diana Z <dzigterman@chromium.org> | 2020-06-11 13:37:36 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-06-25 23:57:54 +0000 |
commit | 2f651922b48ed2ed4a592ca2f61b82d7df7f0006 (patch) | |
tree | fff962a20c981472661782e3cbf48ec2f84698f1 /include | |
parent | 07fc2cff6d8575ca89e563fca741a0ea454fff9d (diff) | |
download | chrome-ec-2f651922b48ed2ed4a592ca2f61b82d7df7f0006.tar.gz |
TCPMv2: Report message discard to the PE
This commit creates a reporting function for the PRL to let the PE know
when messages have been discarded.
States will have to handle message discard internally since the response
depends on the portion of the AMS sequence they're in. For some states
which begin AMSes, a new shared parent has been added which runs the
sender response timer and checks discard for the child.
More states (and discard mid-AMS) are expected to be added in future
CLs.
The new parent state saves an average of 124 bytes of flash space.
BRANCH=None
BUG=b:158248741,b:157228506
TEST=on waddledoo, Dell dock no longer soft resets during power role
swap
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I61b3e96e1d14634dcd5edda4e133968ace769b21
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2241577
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/mock/usb_pe_sm_mock.h | 1 | ||||
-rw-r--r-- | include/usb_pe_sm.h | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/include/mock/usb_pe_sm_mock.h b/include/mock/usb_pe_sm_mock.h index b678df9d7b..720ec7d219 100644 --- a/include/mock/usb_pe_sm_mock.h +++ b/include/mock/usb_pe_sm_mock.h @@ -19,6 +19,7 @@ struct mock_pe_port_t { int mock_pe_got_hard_reset; int mock_pe_message_received; int mock_got_soft_reset; + int mock_pe_message_discarded; }; extern struct mock_pe_port_t mock_pe_port[CONFIG_USB_PD_PORT_MAX_COUNT]; diff --git a/include/usb_pe_sm.h b/include/usb_pe_sm.h index 8089fddb55..949df6d516 100644 --- a/include/usb_pe_sm.h +++ b/include/usb_pe_sm.h @@ -78,6 +78,13 @@ void pe_message_sent(int port); void pe_report_error(int port, enum pe_error e, enum tcpm_transmit_type type); /** + * Informs the Policy Engine of a discard. + * + * @param port USB-C port number + */ +void pe_report_discard(int port); + +/** * Called by the Protocol Layer to informs the Policy Engine * that a message has been received. * |