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