Commit c034de96 authored by Adam Wujek's avatar Adam Wujek

[FEATURE: #54] proto-ext-whiterabbit: fix behavior of ptp_fallback

Signed-off-by: 's avatarAdam Wujek <dev_public@wujek.eu>
parent 8825ac3a
......@@ -361,8 +361,7 @@ void pdstate_disable_extension(struct pp_instance * ppi)
{
ppi->pdstate=PP_PDSTATE_FAILURE;
if ( ppi->extState==PP_EXSTATE_ACTIVE) {
if ( ppi->ptp_fallback )
ppi->extState=ppi->ptp_fallback ? PP_EXSTATE_PTP : PP_EXSTATE_DISABLE;
ppi->extState = PP_EXSTATE_PTP;
pp_servo_init(ppi); // Reinitialize the servo
if ( is_ext_hook_available(ppi,extension_state_changed) )
ppi->ext_hooks->extension_state_changed(ppi);
......
......@@ -29,9 +29,22 @@ void wr_handshake_fail(struct pp_instance *ppi)
{
struct wr_dsport *wrp = WR_DSPOR(ppi);
wrp->next_state = WRS_IDLE;
/* Don't use PTP without WR, try WR one more time */
if (!ppi->ptp_fallback) {
wrh_servo_t *s = WRH_SRV(ppi);
if (s)
s->doRestart = TRUE;
pp_diag(ppi, ext, 1, "Handshake failure: PTP fallback disabled."
" Try WR again as %s\n",
wrp->wrMode == WR_MASTER ? "master" : "slave");
return;
}
pp_diag(ppi, ext, 1, "Handshake failure: now non-wr %s\n",
wrp->wrMode == WR_MASTER ? "master" : "slave");
wrp->next_state=WRS_IDLE;
wr_reset_process(ppi,WR_ROLE_NONE);
wr_servo_reset(ppi);
pdstate_disable_extension(ppi);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment