mirror-linux/drivers/net/ethernet/mscc
Vladimir Oltean 45d0fcb5bc net: mscc: ocelot: don't keep PTP configuration of all ports in single structure
In a future change, the driver will need to determine whether PTP RX
timestamping is enabled on a port (including whether traps were set up
on that port in particular) and that is currently not possible.

The driver supports different RX filters (L2, L4) and kinds of TX
timestamping (one-step, two-step) on its ports, but it saves all
configuration in a single struct hwtstamp_config that is global to the
switch. So, the latest timestamping configuration on one port
(including a request to disable timestamping) affects what gets reported
for all ports, even though the configuration itself is still individual
to each port.

The port timestamping configurations are only coupled because of the
common structure, so replace the hwtstamp_config with a mask of trapped
protocols saved per port. We also have the ptp_cmd to distinguish
between one-step and two-step PTP timestamping, so with those 2 bits of
information we can fully reconstruct a descriptive struct
hwtstamp_config for each port, during the SIOCGHWTSTAMP ioctl.

Fixes: 4e3b0468e6 ("net: mscc: PTP Hardware Clock (PHC) support")
Fixes: 96ca08c058 ("net: mscc: ocelot: set up traps for PTP packets")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2023-06-29 12:40:27 +02:00
..
Kconfig net: dsa: ocelot: add PTP dependency for NET_DSA_MSCC_OCELOT_EXT 2023-02-10 19:35:58 -08:00
Makefile net: mscc: ocelot: add MAC Merge layer support for VSC9959 2023-01-23 12:44:18 +00:00
ocelot.c net: mscc: ocelot: don't keep PTP configuration of all ports in single structure 2023-06-29 12:40:27 +02:00
ocelot.h net: mscc: ocelot: remove incompatible prototypes 2023-04-18 21:13:23 -07:00
ocelot_devlink.c net: mscc: ocelot: expose ocelot wm functions 2023-01-30 21:07:20 -08:00
ocelot_fdma.c
ocelot_fdma.h
ocelot_flower.c flow_offload: Reject matching on layer 2 miss 2023-05-30 23:37:00 -07:00
ocelot_io.c net: mscc: ocelot: refactor enum ocelot_reg decoding to helper 2023-04-13 21:56:06 -07:00
ocelot_mm.c net: mscc: ocelot: add support for preemptible traffic classes 2023-04-17 19:01:19 -07:00
ocelot_mrp.c
ocelot_net.c net: mscc: ocelot: expose serdes configuration function 2023-03-20 09:08:48 +00:00
ocelot_police.c
ocelot_police.h
ocelot_ptp.c net: mscc: ocelot: don't keep PTP configuration of all ports in single structure 2023-06-29 12:40:27 +02:00
ocelot_qs.h
ocelot_rew.h
ocelot_stats.c net: mscc: ocelot: fix ineffective WARN_ON() in ocelot_stats.c 2023-04-13 21:56:06 -07:00
ocelot_vcap.c
ocelot_vcap.h
ocelot_vsc7514.c net: mscc: ocelot: expose ocelot_pll5_init routine 2023-03-20 09:08:48 +00:00
vsc7514_regs.c net: mscc: ocelot: fix stat counter register values 2023-05-10 12:11:18 +01:00