diff options
author | Horatiu Vultur <horatiu.vultur@microchip.com> | 2022-03-04 12:08:58 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-03-04 13:03:09 +0000 |
commit | 70dfe25cd8666d1d1518d615283940108bb364e7 (patch) | |
tree | 683465fb29309ff21551302d7f9fa8ece814fd99 /drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c | |
parent | net: sparx5: Implement SIOCSHWTSTAMP and SIOCGHWTSTAMP (diff) | |
download | linux-dev-70dfe25cd8666d1d1518d615283940108bb364e7.tar.xz linux-dev-70dfe25cd8666d1d1518d615283940108bb364e7.zip |
net: sparx5: Update extraction/injection for timestamping
Update both the extraction and injection to do timestamping of the
frames. The extraction is always doing the timestamping while for
injection is doing the timestamping only if it is configured.
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c')
-rw-r--r-- | drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c b/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c index 5fd0b2eea021..af4d3e1f1a6d 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c @@ -74,6 +74,26 @@ void sparx5_set_port_ifh(void *ifh_hdr, u16 portno) ifh_encode_bitfield(ifh_hdr, 1, 67, 1); } +void sparx5_set_port_ifh_rew_op(void *ifh_hdr, u32 rew_op) +{ + ifh_encode_bitfield(ifh_hdr, rew_op, VSTAX + 32, 10); +} + +void sparx5_set_port_ifh_pdu_type(void *ifh_hdr, u32 pdu_type) +{ + ifh_encode_bitfield(ifh_hdr, pdu_type, 191, 4); +} + +void sparx5_set_port_ifh_pdu_w16_offset(void *ifh_hdr, u32 pdu_w16_offset) +{ + ifh_encode_bitfield(ifh_hdr, pdu_w16_offset, 195, 6); +} + +void sparx5_set_port_ifh_timestamp(void *ifh_hdr, u64 timestamp) +{ + ifh_encode_bitfield(ifh_hdr, timestamp, 232, 40); +} + static int sparx5_port_open(struct net_device *ndev) { struct sparx5_port *port = netdev_priv(ndev); |