Commit 0e71267b authored by Alessandro Rubini's avatar Alessandro Rubini Committed by Adam Wujek

general: don't enter faulty state if tx fails

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent d6aefd73
......@@ -136,5 +136,5 @@ int wr_calibration(struct pp_instance *ppi, unsigned char *pkt, int plen)
ppi->next_delay = wrp->wrStateTimeout;
return e;
return 0; /* ignore error */
}
......@@ -43,8 +43,6 @@ int wr_locked(struct pp_instance *ppi, unsigned char *pkt, int plen)
ppi->next_state = WRS_RESP_CALIB_REQ;
}
if (e != 0)
ppi->next_state = PPS_FAULTY;
ppi->next_delay = wrp->wrStateTimeout;
return e;
......
......@@ -43,8 +43,6 @@ int wr_m_lock(struct pp_instance *ppi, unsigned char *pkt, int plen)
ppi->next_state = WRS_CALIBRATION;
}
if (e != 0)
ppi->next_state = PPS_FAULTY;
ppi->next_delay = wrp->wrStateTimeout;
return e;
......
......@@ -49,8 +49,9 @@ int wr_present(struct pp_instance *ppi, unsigned char *pkt, int plen)
if (e == 0)
st_com_execute_slave(ppi);
else
ppi->next_state = PPS_FAULTY;
else {
/* nothing, just stay here again */
}
ppi->next_delay = WR_DSPOR(ppi)->wrStateTimeout;
......
......@@ -101,8 +101,7 @@ out:
ppi->next_state = PPS_LISTENING;
break;
case PP_SEND_ERROR:
goto out_fault;
/* fall through: a lost frame is not the end of the world */
case PP_SEND_NO_STAMP:
/* nothing, just keep the ball rolling */
e = 0;
......@@ -113,10 +112,5 @@ out:
ppi->next_delay = pp_next_delay_3(ppi,
PP_TO_ANN_SEND, PP_TO_SYNC_SEND, PP_TO_REQUEST);
return e;
out_fault:
ppi->next_state = PPS_FAULTY;
ppi->next_delay = 500; /* just a delay to releif the system */
return e;
}
......@@ -51,8 +51,9 @@ int pp_passive(struct pp_instance *ppi, unsigned char *pkt, int plen)
if (e == 0)
e = st_com_execute_slave(ppi);
if (e != 0)
ppi->next_state = PPS_FAULTY;
if (e != 0) {
/* ignore: a lost frame is not the end of the world */
}
ppi->next_delay = PP_DEFAULT_NEXT_DELAY_MS;
......
......@@ -87,7 +87,7 @@ int pp_slave(struct pp_instance *ppi, unsigned char *pkt, int plen)
goto out;
}
e = pp_lib_may_issue_request(ppi);
pp_lib_may_issue_request(ppi);
/*
* The management of messages is now table-driven
......@@ -100,8 +100,6 @@ int pp_slave(struct pp_instance *ppi, unsigned char *pkt, int plen)
pp_diag(ppi, frames, 1, "Ignored frame %i\n",
hdr->messageType);
}
if (e)
goto out;
/*
* This function, common to passive,listening etc,
......@@ -114,7 +112,7 @@ out:
case PP_SEND_OK: /* 0 */
break;
case PP_SEND_ERROR:
ppi->next_state = PPS_FAULTY;
/* ignore: a lost frame is not the end of the world */
break;
case PP_SEND_NO_STAMP:
/* nothing, just keep the ball rolling */
......
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