diff options
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c index 082446d44fa8..3178f1ec3711 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | |||
@@ -2696,6 +2696,46 @@ static int ixgbe_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd) | |||
2696 | return ret; | 2696 | return ret; |
2697 | } | 2697 | } |
2698 | 2698 | ||
2699 | static int ixgbe_get_ts_info(struct net_device *dev, | ||
2700 | struct ethtool_ts_info *info) | ||
2701 | { | ||
2702 | struct ixgbe_adapter *adapter = netdev_priv(dev); | ||
2703 | |||
2704 | switch (adapter->hw.mac.type) { | ||
2705 | #ifdef CONFIG_IXGBE_PTP | ||
2706 | case ixgbe_mac_X540: | ||
2707 | case ixgbe_mac_82599EB: | ||
2708 | info->so_timestamping = | ||
2709 | SOF_TIMESTAMPING_TX_HARDWARE | | ||
2710 | SOF_TIMESTAMPING_RX_HARDWARE | | ||
2711 | SOF_TIMESTAMPING_RAW_HARDWARE; | ||
2712 | |||
2713 | if (adapter->ptp_clock) | ||
2714 | info->phc_index = ptp_clock_index(adapter->ptp_clock); | ||
2715 | else | ||
2716 | info->phc_index = -1; | ||
2717 | |||
2718 | info->tx_types = | ||
2719 | (1 << HWTSTAMP_TX_OFF) | | ||
2720 | (1 << HWTSTAMP_TX_ON); | ||
2721 | |||
2722 | info->rx_filters = | ||
2723 | (1 << HWTSTAMP_FILTER_NONE) | | ||
2724 | (1 << HWTSTAMP_FILTER_PTP_V1_L4_SYNC) | | ||
2725 | (1 << HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ) | | ||
2726 | (1 << HWTSTAMP_FILTER_PTP_V2_SYNC) | | ||
2727 | (1 << HWTSTAMP_FILTER_PTP_V2_DELAY_REQ) | | ||
2728 | (1 << HWTSTAMP_FILTER_PTP_V2_EVENT) | | ||
2729 | (1 << HWTSTAMP_FILTER_SOME); | ||
2730 | break; | ||
2731 | #endif /* CONFIG_IXGBE_PTP */ | ||
2732 | default: | ||
2733 | return ethtool_op_get_ts_info(dev, info); | ||
2734 | break; | ||
2735 | } | ||
2736 | return 0; | ||
2737 | } | ||
2738 | |||
2699 | static const struct ethtool_ops ixgbe_ethtool_ops = { | 2739 | static const struct ethtool_ops ixgbe_ethtool_ops = { |
2700 | .get_settings = ixgbe_get_settings, | 2740 | .get_settings = ixgbe_get_settings, |
2701 | .set_settings = ixgbe_set_settings, | 2741 | .set_settings = ixgbe_set_settings, |
@@ -2724,6 +2764,7 @@ static const struct ethtool_ops ixgbe_ethtool_ops = { | |||
2724 | .set_coalesce = ixgbe_set_coalesce, | 2764 | .set_coalesce = ixgbe_set_coalesce, |
2725 | .get_rxnfc = ixgbe_get_rxnfc, | 2765 | .get_rxnfc = ixgbe_get_rxnfc, |
2726 | .set_rxnfc = ixgbe_set_rxnfc, | 2766 | .set_rxnfc = ixgbe_set_rxnfc, |
2767 | .get_ts_info = ixgbe_get_ts_info, | ||
2727 | }; | 2768 | }; |
2728 | 2769 | ||
2729 | void ixgbe_set_ethtool_ops(struct net_device *netdev) | 2770 | void ixgbe_set_ethtool_ops(struct net_device *netdev) |