Commit de67b147 authored by Alessandro Rubini's avatar Alessandro Rubini

general: rename a timeout (no effect)

We use the same timeout for delay_req and pdelay_req, so let's call
it "request" alone.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent ac6b3d07
......@@ -52,7 +52,7 @@
/* We use an array of timeouts, with these indexes */
enum pp_timeouts {
PP_TO_DELAYREQ = 0,
PP_TO_REQUEST = 0,
PP_TO_SYNC,
PP_TO_ANN_RECEIPT,
PP_TO_ANN_INTERVAL,
......
......@@ -28,7 +28,8 @@ int pp_pclock(struct pp_instance *ppi, unsigned char *pkt, int plen)
ppi->flags &= ~PPI_FLAGS_WAITING;
pp_timeout_restart_annrec(ppi);
pp_timeout_rand(ppi, PP_TO_DELAYREQ,
pp_timeout_rand(ppi, PP_TO_REQUEST,
DSPOR(ppi)->logMinDelayReqInterval);
}
......@@ -111,13 +112,13 @@ out:
if (e == 0)
e = st_com_execute_slave(ppi);
if (pp_timeout_z(ppi, PP_TO_DELAYREQ)) {
if (pp_timeout_z(ppi, PP_TO_REQUEST)) {
e = msg_issue_request(ppi);
ppi->t3 = ppi->last_snt_time;
/* Restart the timeout for next time */
pp_timeout_rand(ppi, PP_TO_DELAYREQ,
pp_timeout_rand(ppi, PP_TO_REQUEST,
DSPOR(ppi)->logMinDelayReqInterval);
}
......@@ -133,19 +134,15 @@ out:
break;
}
/* Leaving this state */
if (ppi->next_state != ppi->state) {
pp_timeout_clr(ppi, PP_TO_ANN_RECEIPT);
pp_timeout_clr(ppi, PP_TO_DELAYREQ);
pp_timeout_clr(ppi, PP_TO_REQUEST);
pp_servo_init(ppi);
}
d1 = d2 = pp_ms_to_timeout(ppi, PP_TO_ANN_RECEIPT);
if (ppi->timeouts[PP_TO_DELAYREQ])
d2 = pp_ms_to_timeout(ppi, PP_TO_DELAYREQ);
if (ppi->timeouts[PP_TO_REQUEST])
d2 = pp_ms_to_timeout(ppi, PP_TO_REQUEST);
ppi->next_delay = d1 < d2 ? d1 : d2;
return 0;
return e;
}
......@@ -29,7 +29,7 @@ int pp_slave(struct pp_instance *ppi, unsigned char *pkt, int plen)
pp_timeout_restart_annrec(ppi);
pp_timeout_rand(ppi, PP_TO_DELAYREQ,
pp_timeout_rand(ppi, PP_TO_REQUEST,
DSPOR(ppi)->logMinDelayReqInterval);
}
......@@ -104,13 +104,13 @@ out:
if (e == 0)
e = st_com_execute_slave(ppi);
if (pp_timeout_z(ppi, PP_TO_DELAYREQ)) {
if (pp_timeout_z(ppi, PP_TO_REQUEST)) {
e = msg_issue_request(ppi);
ppi->t3 = ppi->last_snt_time;
/* Restart the timeout for next time */
pp_timeout_rand(ppi, PP_TO_DELAYREQ,
pp_timeout_rand(ppi, PP_TO_REQUEST,
DSPOR(ppi)->logMinDelayReqInterval);
}
......@@ -128,13 +128,13 @@ out:
if (ppi->next_state != ppi->state) {
pp_timeout_clr(ppi, PP_TO_ANN_RECEIPT);
pp_timeout_clr(ppi, PP_TO_DELAYREQ);
pp_timeout_clr(ppi, PP_TO_REQUEST);
pp_servo_init(ppi);
}
d1 = d2 = pp_ms_to_timeout(ppi, PP_TO_ANN_RECEIPT);
if (ppi->timeouts[PP_TO_DELAYREQ])
d2 = pp_ms_to_timeout(ppi, PP_TO_DELAYREQ);
if (ppi->timeouts[PP_TO_REQUEST])
d2 = pp_ms_to_timeout(ppi, PP_TO_REQUEST);
ppi->next_delay = d1 < d2 ? d1 : d2;
return e;
}
......@@ -9,7 +9,7 @@
#define N(n) [n] = #n
static char *timeout_names[__PP_TO_ARRAY_SIZE] __attribute__((used)) = {
N(PP_TO_DELAYREQ),
N(PP_TO_REQUEST),
N(PP_TO_SYNC),
N(PP_TO_ANN_RECEIPT),
N(PP_TO_ANN_INTERVAL),
......
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