ptp.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /****************************************************************************
  3. * Driver for Solarflare network controllers and boards
  4. * Copyright 2005-2006 Fen Systems Ltd.
  5. * Copyright 2006-2013 Solarflare Communications Inc.
  6. * Copyright 2019-2020 Xilinx Inc.
  7. */
  8. #ifndef EFX_PTP_H
  9. #define EFX_PTP_H
  10. #include <linux/net_tstamp.h>
  11. #include "net_driver.h"
  12. struct ethtool_ts_info;
  13. void efx_siena_ptp_defer_probe_with_channel(struct efx_nic *efx);
  14. struct efx_channel *efx_siena_ptp_channel(struct efx_nic *efx);
  15. int efx_siena_ptp_set_ts_config(struct efx_nic *efx, struct ifreq *ifr);
  16. int efx_siena_ptp_get_ts_config(struct efx_nic *efx, struct ifreq *ifr);
  17. void efx_siena_ptp_get_ts_info(struct efx_nic *efx,
  18. struct ethtool_ts_info *ts_info);
  19. bool efx_siena_ptp_is_ptp_tx(struct efx_nic *efx, struct sk_buff *skb);
  20. int efx_siena_ptp_get_mode(struct efx_nic *efx);
  21. int efx_siena_ptp_change_mode(struct efx_nic *efx, bool enable_wanted,
  22. unsigned int new_mode);
  23. int efx_siena_ptp_tx(struct efx_nic *efx, struct sk_buff *skb);
  24. void efx_siena_ptp_event(struct efx_nic *efx, efx_qword_t *ev);
  25. size_t efx_siena_ptp_describe_stats(struct efx_nic *efx, u8 *strings);
  26. size_t efx_siena_ptp_update_stats(struct efx_nic *efx, u64 *stats);
  27. void efx_siena_time_sync_event(struct efx_channel *channel, efx_qword_t *ev);
  28. void __efx_siena_rx_skb_attach_timestamp(struct efx_channel *channel,
  29. struct sk_buff *skb);
  30. static inline void efx_rx_skb_attach_timestamp(struct efx_channel *channel,
  31. struct sk_buff *skb)
  32. {
  33. if (channel->sync_events_state == SYNC_EVENTS_VALID)
  34. __efx_siena_rx_skb_attach_timestamp(channel, skb);
  35. }
  36. void efx_siena_ptp_start_datapath(struct efx_nic *efx);
  37. void efx_siena_ptp_stop_datapath(struct efx_nic *efx);
  38. bool efx_siena_ptp_use_mac_tx_timestamps(struct efx_nic *efx);
  39. ktime_t efx_siena_ptp_nic_to_kernel_time(struct efx_tx_queue *tx_queue);
  40. #endif /* EFX_PTP_H */