netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Jacob Keller <jacob.e.keller@intel.com>,
	netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 09/12] ixgbe: add support for get_ts_info
Date: Wed,  9 May 2012 23:46:50 -0700	[thread overview]
Message-ID: <1336632413-19135-10-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1336632413-19135-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Jacob Keller <jacob.e.keller@intel.com>

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>
---
 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 082446d..3178f1e 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)
 	return ret;
 }
 
+static int ixgbe_get_ts_info(struct net_device *dev,
+			     struct ethtool_ts_info *info)
+{
+	struct ixgbe_adapter *adapter = netdev_priv(dev);
+
+	switch (adapter->hw.mac.type) {
+#ifdef CONFIG_IXGBE_PTP
+	case ixgbe_mac_X540:
+	case ixgbe_mac_82599EB:
+		info->so_timestamping =
+			SOF_TIMESTAMPING_TX_HARDWARE |
+			SOF_TIMESTAMPING_RX_HARDWARE |
+			SOF_TIMESTAMPING_RAW_HARDWARE;
+
+		if (adapter->ptp_clock)
+			info->phc_index = ptp_clock_index(adapter->ptp_clock);
+		else
+			info->phc_index = -1;
+
+		info->tx_types =
+			(1 << HWTSTAMP_TX_OFF) |
+			(1 << HWTSTAMP_TX_ON);
+
+		info->rx_filters =
+			(1 << HWTSTAMP_FILTER_NONE) |
+			(1 << HWTSTAMP_FILTER_PTP_V1_L4_SYNC) |
+			(1 << HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ) |
+			(1 << HWTSTAMP_FILTER_PTP_V2_SYNC) |
+			(1 << HWTSTAMP_FILTER_PTP_V2_DELAY_REQ) |
+			(1 << HWTSTAMP_FILTER_PTP_V2_EVENT) |
+			(1 << HWTSTAMP_FILTER_SOME);
+		break;
+#endif /* CONFIG_IXGBE_PTP */
+	default:
+		return ethtool_op_get_ts_info(dev, info);
+		break;
+	}
+	return 0;
+}
+
 static const struct ethtool_ops ixgbe_ethtool_ops = {
 	.get_settings           = ixgbe_get_settings,
 	.set_settings           = ixgbe_set_settings,
@@ -2724,6 +2764,7 @@ static const struct ethtool_ops ixgbe_ethtool_ops = {
 	.set_coalesce           = ixgbe_set_coalesce,
 	.get_rxnfc		= ixgbe_get_rxnfc,
 	.set_rxnfc		= ixgbe_set_rxnfc,
+	.get_ts_info		= ixgbe_get_ts_info,
 };
 
 void ixgbe_set_ethtool_ops(struct net_device *netdev)
-- 
1.7.7.6

  parent reply	other threads:[~2012-05-10  6:47 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-10  6:46 [net-next 00/12][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2012-05-10  6:46 ` [net-next 01/12] igb: output register's information related to RX/TX queue[4-15] Jeff Kirsher
2012-05-10  6:46 ` [net-next 02/12] ixgbe: Exit on error case in VF message processing Jeff Kirsher
2012-05-10  6:46 ` [net-next 03/12] ixgbe: Clean up priority based flow control Jeff Kirsher
2012-05-10  6:46 ` [net-next 04/12] ixgbe: Set Drop_EN bit when multiple Rx queues are present w/o " Jeff Kirsher
2012-05-10  6:46 ` [net-next 05/12] ixgbe: Fix bogus error message Jeff Kirsher
2012-05-10  6:46 ` [net-next 06/12] ixgbe: Hardware Timestamping + PTP Hardware Clock (PHC) Jeff Kirsher
2012-05-10 14:11   ` Richard Cochran
2012-05-10 21:53     ` Keller, Jacob E
2012-05-11  5:15       ` Richard Cochran
2012-05-11 18:05         ` Keller, Jacob E
2012-05-11 19:23         ` Keller, Jacob E
2012-05-12  5:34           ` Richard Cochran
2012-05-14 17:28             ` Jacob Keller
2012-05-14 22:42             ` Jacob Keller
2012-05-15  5:32               ` Richard Cochran
2012-05-11 19:34         ` Keller, Jacob E
2012-05-12  5:24           ` Richard Cochran
2012-05-10  6:46 ` [net-next 07/12] ixgbe: Enable timesync clock-out feature for PPS support on X540 Jeff Kirsher
2012-05-10 14:17   ` Richard Cochran
2012-05-10 21:54     ` Keller, Jacob E
2012-05-11  5:36       ` Richard Cochran
2012-05-11 18:09         ` Keller, Jacob E
2012-05-10 22:08     ` Keller, Jacob E
2012-05-11  5:40       ` Richard Cochran
2012-05-11 18:10         ` Keller, Jacob E
2012-05-10  6:46 ` [net-next 08/12] ixgbe: correct disable_rx_buff timeout Jeff Kirsher
2012-05-10  6:46 ` Jeff Kirsher [this message]
2012-05-10  6:46 ` [net-next 10/12] ixgbe: support software timestamping Jeff Kirsher
2012-05-10  6:46 ` [net-next 11/12] ixgbe: cleanup the hwmon function calls Jeff Kirsher
2012-05-10  6:46 ` [net-next 12/12] ixgbe: update version number Jeff Kirsher
2012-05-11  3:18 ` [net-next 00/12][pull request] Intel Wired LAN Driver Updates David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1336632413-19135-10-git-send-email-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=jacob.e.keller@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=sassmann@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).