[Linuxptp-devel] [PATCH v5] Strip Parallel Redundancy Protocol (PRP) trailer

2022-08-08 Thread Magnus Armholt
Strip the IEC62439-3 PRP trailer if it is present to support PTP over PRP. The implementation is very pedantic about trailing bytes and will indicate bad message if the PRP trailer bytes are present when parsing the PTP message. The PRP trailer is normally removed by the PRP implementation and inv

[Linuxptp-devel] [PATCH v1] ts2phc: Print NMEA sentence used as ToD source in loglevel 6

2022-08-08 Thread Maciek Machnikowski
Print the G*RMC NMEA sentence that was correctly parsed and used as the ToD source in the default loglevel when the nmea source was used. This prevents printing all NMEA sentences available only in loglevel 7, and gives enough visibility on the state of GNSS receiver. Signed-off-by: Maciek Machni

Re: [Linuxptp-devel] [PATCH v5 07/13] ts2phc: instantiate a full clock structure for every PPS source of the PHC kind

2022-08-08 Thread Richard Cochran
On Fri, Aug 05, 2022 at 07:56:38PM +0300, Vladimir Oltean wrote: > > Need to keep this include in order to make sure declaration and > > definition of ts2phc_phc_pps_source_create() are consistent. > > ts2phc.h includes ts2phc_phc_pps_source.h. Still it is best practice NOT to rely on transitive

Re: [Linuxptp-devel] [PATCH v4] Strip PRP trailer

2022-08-08 Thread Richard Cochran
On Mon, Aug 08, 2022 at 01:11:36PM +0200, Erez wrote: > On Mon, 8 Aug 2022 at 12:36, Miroslav Lichvar wrote: > > would be nice to convert them all avoid confusion. Yes, but not here with new code. > The question is not if other code uses it, but what is better. > Though the function name suggest

Re: [Linuxptp-devel] [PATCH v5 08/13] ts2phc: instantiate a pmc agent

2022-08-08 Thread Richard Cochran
On Fri, Aug 05, 2022 at 07:56:11PM +0300, Vladimir Oltean wrote: > Can't I just delete "case PS_INITIALIZING:" ... "case PS_GRAND_MASTER:" > since I have to put "default:" anyway (we may get arbitrary input over > the management messages)? sure > I'm also wondering if PS_PRE_MASTER and PS_UNCAL

Re: [Linuxptp-devel] [PATCH v4] Strip PRP trailer

2022-08-08 Thread Erez
On Mon, 8 Aug 2022 at 12:36, Miroslav Lichvar wrote: > On Mon, Aug 08, 2022 at 12:20:30PM +0200, Erez wrote: > > On Mon, 8 Aug 2022 at 11:56, Magnus Armholt > > wrote: > > > +static int has_prp_trailer(unsigned char *ptr, int cnt, int eth_hlen) > > > > > > > A POSIX function usually uses 0 as su

Re: [Linuxptp-devel] [PATCH v4] Strip PRP trailer

2022-08-08 Thread Miroslav Lichvar
On Mon, Aug 08, 2022 at 12:20:30PM +0200, Erez wrote: > On Mon, 8 Aug 2022 at 11:56, Magnus Armholt > wrote: > > +static int has_prp_trailer(unsigned char *ptr, int cnt, int eth_hlen) > > > > A POSIX function usually uses 0 as success and negative on failure. > In order to avoid confusion, it is

Re: [Linuxptp-devel] [PATCH v4] Strip PRP trailer

2022-08-08 Thread Erez
On Mon, 8 Aug 2022 at 11:56, Magnus Armholt wrote: > Strip the IEC62439-3 PRP trailer if it is present > to support PTP over PRP. > The implementation is very pedantic about > trailing bytes and will indicate bad message if the > PRP trailer bytes are present when parsing the PTP message. > > Per

[Linuxptp-devel] [PATCH v4] Strip PRP trailer

2022-08-08 Thread Magnus Armholt
Strip the IEC62439-3 PRP trailer if it is present to support PTP over PRP. The implementation is very pedantic about trailing bytes and will indicate bad message if the PRP trailer bytes are present when parsing the PTP message. Signed-off-by: Magnus Armholt --- raw.c | 67 ++