Commit 8e3dfe52 authored by Sven Meier's avatar Sven Meier Committed by Adam Wujek

audit porting: ported the patches of the audit chapter 3.3

Most of them were already ported, added a check before returning next delay if
a timeout for a (p)delay request has to be taken into account
parent a8683138
......@@ -58,7 +58,13 @@ out:
if (e != 0)
ppi->next_state = PPS_FAULTY;
ppi->next_delay = pp_next_delay_1(ppi, PP_TO_ANN_RECEIPT);
if (CONFIG_HAS_P2P && ppi->mech == PP_P2P_MECH) {
ppi->next_delay = pp_next_delay_2(ppi,
PP_TO_ANN_RECEIPT, PP_TO_REQUEST);
} else {
ppi->next_delay = pp_next_delay_1(ppi,
PP_TO_ANN_RECEIPT);
}
return e;
}
......@@ -69,8 +69,6 @@ int pp_master(struct pp_instance *ppi, void *buf, int len)
/* when the clock is using peer-delay, the master must send it too */
if (CONFIG_HAS_P2P && ppi->mech == PP_P2P_MECH)
pp_lib_may_issue_request(ppi);
else /* please check commit '6d7bf7e3' about below, I'm not sure */
pp_timeout_set(ppi, PP_TO_REQUEST);
/*
* An extension can do special treatment of this message type,
......@@ -119,12 +117,23 @@ out:
}
if (pre) {
ppi->next_delay = pp_next_delay_2(ppi,
PP_TO_QUALIFICATION, PP_TO_REQUEST);
if (CONFIG_HAS_P2P && ppi->mech == PP_P2P_MECH) {
ppi->next_delay = pp_next_delay_2(ppi,
PP_TO_QUALIFICATION, PP_TO_REQUEST);
} else {
ppi->next_delay = pp_next_delay_1(ppi,
PP_TO_QUALIFICATION);
}
} else {
ppi->next_delay = pp_next_delay_3(ppi,
PP_TO_ANN_SEND, PP_TO_SYNC_SEND, PP_TO_REQUEST);
if (CONFIG_HAS_P2P && ppi->mech == PP_P2P_MECH) {
ppi->next_delay = pp_next_delay_3(ppi,
PP_TO_ANN_SEND, PP_TO_SYNC_SEND, PP_TO_REQUEST);
} else {
ppi->next_delay = pp_next_delay_2(ppi,
PP_TO_ANN_SEND, PP_TO_SYNC_SEND);
}
}
return e;
}
......@@ -80,7 +80,13 @@ int pp_passive(struct pp_instance *ppi, void *buf, int len)
if (e != 0)
ppi->next_state = PPS_FAULTY;
ppi->next_delay = pp_next_delay_1(ppi, PP_TO_ANN_RECEIPT);
if (CONFIG_HAS_P2P && ppi->mech == PP_P2P_MECH) {
ppi->next_delay = pp_next_delay_2(ppi,
PP_TO_ANN_RECEIPT, PP_TO_REQUEST);
} else {
ppi->next_delay = pp_next_delay_1(ppi,
PP_TO_ANN_RECEIPT);
}
return e;
}
......@@ -265,7 +265,7 @@ out:
}
ppi->next_delay = pp_next_delay_2(ppi,
PP_TO_ANN_RECEIPT, PP_TO_REQUEST);
PP_TO_ANN_RECEIPT, PP_TO_REQUEST);
return e;
}
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