linux/drivers/net/dsa/microchip
Arun Ramadoss c2977c61f3 net: dsa: microchip: ptp: add 4 bytes in tail tag when ptp enabled
When the PTP is enabled in hardware bit 6 of PTP_MSG_CONF1 register, the
transmit frame needs additional 4 bytes before the tail tag. It is
needed for all the transmission packets irrespective of PTP packets or
not.
The 4-byte timestamp field is 0 for frames other than Pdelay_Resp. For
the one-step Pdelay_Resp, the switch needs the receive timestamp of the
Pdelay_Req message so that it can put the turnaround time in the
correction field.
Since PTP has to be enabled for both Transmission and reception
timestamping, driver needs to track of the tx and rx setting of the all
the user ports in the switch.
Two flags hw_tx_en and hw_rx_en are added in ksz_port to track the
timestampping setting of each port. When any one of ports has tx or rx
timestampping enabled, bit 6 of PTP_MSG_CONF1 is set and it is indicated
to tag_ksz.c through tagger bytes. This flag adds 4 additional bytes to
the tail tag.  When tx and rx timestamping of all the ports are disabled,
then 4 bytes are not added.

Tested using hwstamp -i <interface>

Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com> # mostly api
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-01-13 08:40:40 +00:00
..
Kconfig net: dsa: microchip: ptp: add the posix clock support 2023-01-13 08:40:40 +00:00
ksz8.h net: dsa: microchip: ksz8: add MTU configuration support 2022-12-07 11:57:58 +01:00
ksz8795.c net: dsa: microchip: ksz8: move all DSA configurations to one location 2022-12-07 11:57:58 +01:00
ksz8795_reg.h net: dsa: microchip: ksz8: add MTU configuration support 2022-12-07 11:57:58 +01:00
ksz8863_smi.c net: dsa: microchip: add dev_err_probe in probe functions 2022-11-09 13:06:01 +00:00
ksz9477.c net: dsa: microchip: enable MTU normalization for KSZ8795 and KSZ9477 compatible switches 2022-12-07 11:57:58 +01:00
ksz9477.h net: dsa: microchip: move max mtu to one location 2022-12-07 11:57:58 +01:00
ksz9477_i2c.c net: dsa: microchip: ksz9477: Convert to i2c's .probe_new() 2022-11-23 12:50:06 -08:00
ksz9477_reg.h net: dsa: microchip: move max mtu to one location 2022-12-07 11:57:58 +01:00
ksz_common.c net: dsa: microchip: ptp: Initial hardware time stamping support 2023-01-13 08:40:40 +00:00
ksz_common.h net: dsa: microchip: ptp: add 4 bytes in tail tag when ptp enabled 2023-01-13 08:40:40 +00:00
ksz_ptp.c net: dsa: microchip: ptp: add 4 bytes in tail tag when ptp enabled 2023-01-13 08:40:40 +00:00
ksz_ptp.h net: dsa: microchip: ptp: Initial hardware time stamping support 2023-01-13 08:40:40 +00:00
ksz_ptp_reg.h net: dsa: microchip: ptp: add the posix clock support 2023-01-13 08:40:40 +00:00
ksz_spi.c net: dsa: microchip: add dev_err_probe in probe functions 2022-11-09 13:06:01 +00:00
lan937x.h net: dsa: microchip: add the support for set_ageing_time 2022-09-16 21:51:47 +01:00
lan937x_main.c net: dsa: microchip: add error checking for ksz_pwrite 2022-11-09 13:06:01 +00:00
lan937x_reg.h net: dsa: microchip: add the support for set_ageing_time 2022-09-16 21:51:47 +01:00
Makefile net: dsa: microchip: ptp: add the posix clock support 2023-01-13 08:40:40 +00:00