mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-10 17:41:54 +00:00
pd: Bugfix for pending VDM in disconnected state.
Commit f993fe3c refactored pd_vdm_send_state_machine to allow well timed
PD disconnects to be acceptable. This violates specification as VDMs certainly
shouldn't proceed without an explicit contract and mode entry.
CL reverts the logic to make 'ready' VDM in shadow of disconnect an error.
Signed-off-by: Todd Broch <tbroch@chromium.org>
BRANCH=samus
BUG=chrome-os-partner:33947
TEST=manual, compiles when disconnect occurs 'ready' VDM transistions to
vdm_state VDM_STATE_ERR_BUSY instead of staying 'ready'
Change-Id: Ic8e96506df365a72053713a806356c4afcfde26d
Reviewed-on: https://chromium-review.googlesource.com/238292
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
5ef45ad19e
commit
c0933f00b1
@@ -1404,21 +1404,19 @@ static void pd_vdm_send_state_machine(int port, int incoming_packet)
|
||||
|
||||
switch (pd[port].vdm_state) {
|
||||
case VDM_STATE_READY:
|
||||
/*
|
||||
* if there's traffic or we're not in PDO ready state don't send
|
||||
* a VDM */
|
||||
if (incoming_packet || pdo_busy(port))
|
||||
break;
|
||||
|
||||
/*
|
||||
* Only transmit VDM if connected. Should follow busy logic
|
||||
* (above) as custom VDMs can leave port in disconnected state
|
||||
*/
|
||||
/* Only transmit VDM if connected. */
|
||||
if (!pd_is_connected(port)) {
|
||||
pd[port].vdm_state = VDM_STATE_ERR_BUSY;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* if there's traffic or we're not in PDO ready state don't send
|
||||
* a VDM.
|
||||
*/
|
||||
if (incoming_packet || pdo_busy(port))
|
||||
break;
|
||||
|
||||
/* Prepare and send VDM */
|
||||
header = PD_HEADER(PD_DATA_VENDOR_DEF, pd[port].power_role,
|
||||
pd[port].data_role, pd[port].msg_id,
|
||||
|
||||
Reference in New Issue
Block a user