diff options
author | Jacob Keller <jacob.e.keller@intel.com> | 2012-05-03 22:56:12 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2012-05-10 02:12:03 -0400 |
commit | e3aac889c78ab87de40a90cbb5fc0ff56394f47c (patch) | |
tree | 10e6a336b59e16644152a76a08d56131f613b7c4 | |
parent | db76ad470e4577e4664af699d73ff7426791cde5 (diff) |
ixgbe: add support for get_ts_info
This patch adds support for the ethtool get_ts_info operation, which enables
access of available timestamp/timesync support for that device. It can query
which ptp clock device is associated with the particular port.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-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) |