Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /****************************************************************************
0003  * Driver for Solarflare network controllers and boards
0004  * Copyright 2005-2006 Fen Systems Ltd.
0005  * Copyright 2006-2013 Solarflare Communications Inc.
0006  * Copyright 2019-2020 Xilinx Inc.
0007  */
0008 
0009 #ifndef EFX_PTP_H
0010 #define EFX_PTP_H
0011 
0012 #include <linux/net_tstamp.h>
0013 #include "net_driver.h"
0014 
0015 struct ethtool_ts_info;
0016 int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel);
0017 void efx_ptp_defer_probe_with_channel(struct efx_nic *efx);
0018 struct efx_channel *efx_ptp_channel(struct efx_nic *efx);
0019 void efx_ptp_update_channel(struct efx_nic *efx, struct efx_channel *channel);
0020 void efx_ptp_remove(struct efx_nic *efx);
0021 int efx_ptp_set_ts_config(struct efx_nic *efx, struct ifreq *ifr);
0022 int efx_ptp_get_ts_config(struct efx_nic *efx, struct ifreq *ifr);
0023 void efx_ptp_get_ts_info(struct efx_nic *efx, struct ethtool_ts_info *ts_info);
0024 bool efx_ptp_is_ptp_tx(struct efx_nic *efx, struct sk_buff *skb);
0025 int efx_ptp_get_mode(struct efx_nic *efx);
0026 int efx_ptp_change_mode(struct efx_nic *efx, bool enable_wanted,
0027             unsigned int new_mode);
0028 int efx_ptp_tx(struct efx_nic *efx, struct sk_buff *skb);
0029 void efx_ptp_event(struct efx_nic *efx, efx_qword_t *ev);
0030 size_t efx_ptp_describe_stats(struct efx_nic *efx, u8 *strings);
0031 size_t efx_ptp_update_stats(struct efx_nic *efx, u64 *stats);
0032 void efx_time_sync_event(struct efx_channel *channel, efx_qword_t *ev);
0033 void __efx_rx_skb_attach_timestamp(struct efx_channel *channel,
0034                    struct sk_buff *skb);
0035 static inline void efx_rx_skb_attach_timestamp(struct efx_channel *channel,
0036                            struct sk_buff *skb)
0037 {
0038     if (channel->sync_events_state == SYNC_EVENTS_VALID)
0039         __efx_rx_skb_attach_timestamp(channel, skb);
0040 }
0041 void efx_ptp_start_datapath(struct efx_nic *efx);
0042 void efx_ptp_stop_datapath(struct efx_nic *efx);
0043 bool efx_ptp_use_mac_tx_timestamps(struct efx_nic *efx);
0044 ktime_t efx_ptp_nic_to_kernel_time(struct efx_tx_queue *tx_queue);
0045 
0046 #endif /* EFX_PTP_H */