raw: Open mc_trigger_fd on PRP master device to enable host RX
For PRP, without a socket bound to the prp0 master device,
dev_mc_sync_multiple() never runs on host interface.
When sockets are bound to slave interfaces, dev_mc_sync_multiple() only
runs on slave interfaces not on master.
PTP frames are forwarded between ring ports but not delivered to the
host.
Add an mc_trigger_fd field to struct raw. In raw_open(), when operating
in PRP mode (main_device set, hsr_port = 0), open a packet socket on the
prp0 master device before the slave sockets. This causes the kernel to
call dev_mc_sync_multiple() on the host, syncing the PTP multicast
addresses so that incoming PTP frames are delivered to the host port.
The socket is stored in mc_trigger_fd (not in FD_EVENT_HSR) so that TX
timestamps continue to be retrieved from the eth1/eth2 sockets where
transmission actually occurs.
Also move the *ret_device = main_device assignment outside the RED_HSR
guard so that raw_open() correctly tracks the main device for PRP too.
Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
1 file changed