/* Calculate the first base_time in the future that satisfies this *relationship: * *future_base_time=base_time+Nxcycle_time>=now,or * *now-base_time *N>=--------------- *cycle_time * *BecauseNisaninteger,theceilingvalueoftheabove"a/b"ratio *isinfactpreciselythefloorvalueof"(a+b-1)/b",whichis *easiertocalculateonlyhavingintegerdivisiontools.
*/ staticinline s64 future_base_time(s64 base_time, s64 cycle_time, s64 now)
{
s64 a, b, n;
if (base_time >= now) return base_time;
a = now - base_time;
b = cycle_time;
n = div_s64(a + b - 1, b);
return base_time + n * cycle_time;
}
/* This is not a preprocessor macro because the "ns" argument may or may not be *s64atcallerside.Thisensuresitisproperlytype-castbeforediv_s64.
*/ staticinline s64 ns_to_sja1105_delta(s64 ns)
{ return div_s64(ns, 200);
}
struct sja1105_ptp_data { struct timer_list extts_timer; /* Used only on SJA1105 to reconstruct partial timestamps */ struct sk_buff_head skb_rxtstamp_queue; /* Used on SJA1110 where meta frames are generated only for *2-stepTXtimestamps
*/ struct sk_buff_head skb_txtstamp_queue; struct ptp_clock_info caps; struct ptp_clock *clock; struct sja1105_ptp_cmd cmd; /* Serializes all operations on the PTP hardware clock */ struct mutex lock; bool extts_enabled;
u64 ptpsyncts;
};
int sja1105_ptp_clock_register(struct dsa_switch *ds);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.