On Mon, 28 Sep 2026 14:39:37 +0200 Sebastian Andrzej Siewior wrote:
Sending PTP packets (ETH_P_1588) via the HSR stack is pointless in its
current shape because the requested PTP timestamp is not routed to the
sender. It also needs to be distinguished on which port the message
should be sent and whether or not a HSR header should be attached.
To pass this information, a custom header (struct hsr_inline_header) is
introduced. This header is expected and mandatory if the ether type is
ETH_P_1588. To avoid any wrong usage, there is a magic field to ensure
it really is the header.
The inline header is just prepended containing the port and header
parameter. After the header, a regular packet follows. It is ensured that
the inline header and the following ethernet or HSR header is linear
and can be accessed.
The two retrieved parameters are passed to hsr_forward_skb() and will be
used later.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
breaks build (admittedly in a weird way, some header check thing?):
In file included from <built-in>:1:
./usr/include/linux/hsr_ptp.h:10:2: error: unknown type name 'uint8_t'
10 | uint8_t tx_port;
| ^
./usr/include/linux/hsr_ptp.h:11:2: error: unknown type name 'uint8_t'
11 | uint8_t hsr_hdr;
| ^
./usr/include/linux/hsr_ptp.h:12:2: error: unknown type name 'uint8_t'
12 | uint8_t __pad0[4];
| ^
./usr/include/linux/hsr_ptp.h:13:2: error: unknown type name '__be32'
13 | __be32 magic;
| ^
./usr/include/linux/hsr_ptp.h:14:2: error: unknown type name 'uint8_t'
14 | uint8_t __pad1[2];
| ^
./usr/include/linux/hsr_ptp.h:15:2: error: unknown type name '__be16'
15 | __be16 eth_type;
| ^
--
pw-bot: cr