All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Frank Li <Frank.Li@freescale.com>
Cc: lznuaa@gmail.com, shawn.guo@linaro.org, richardcochran@gmail.com,
	davem@davemloft.net, linux-arm-kernel@lists.infradead.or,
	netdev@vger.kernel.org
Subject: Re: [PATCH 1/1] net: fec: report correct hardware stamping info to ethtool
Date: Sun, 6 Jan 2013 12:33:50 +0100	[thread overview]
Message-ID: <20130106113350.GE1906@pengutronix.de> (raw)
In-Reply-To: <1357436318-12425-1-git-send-email-Frank.Li@freescale.com>

On Sun, Jan 06, 2013 at 09:38:38AM +0800, Frank Li wrote:
> Report correct hardware stamping capibilty by ethtool interface.

s/capibilty/capability/

> The v1.0 ptp4l check it.
> 
> Signed-off-by: Frank Li <Frank.Li@freescale.com>
> ---
>  drivers/net/ethernet/freescale/fec.c |   28 +++++++++++++++++++++++++++-
>  1 files changed, 27 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
> index a379319..c713db5 100644
> --- a/drivers/net/ethernet/freescale/fec.c
> +++ b/drivers/net/ethernet/freescale/fec.c
> @@ -1173,12 +1173,38 @@ static void fec_enet_get_drvinfo(struct net_device *ndev,
>  	strcpy(info->bus_info, dev_name(&ndev->dev));
>  }
>  
> +static int fec_enet_get_ts_info(struct net_device *ndev,
> +				struct ethtool_ts_info *info)
> +{
> +	struct fec_enet_private *fep = netdev_priv(ndev);
> +	int ret;
> +	ret = ethtool_op_get_ts_info(ndev, info);
> +
> +	if (fep->bufdesc_ex) {
> +
> +		info->so_timestamping |= SOF_TIMESTAMPING_TX_HARDWARE |
> +					 SOF_TIMESTAMPING_RX_HARDWARE |
> +					 SOF_TIMESTAMPING_RAW_HARDWARE;
> +		if (fep->ptp_clock)
> +			info->phc_index = ptp_clock_index(fep->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_ALL);

		return 0;
	} else {
		return ethtool_op_get_ts_info(ndev, info);
	}

?

Otherwise you call ethtool_op_get_ts_info() and don't use the result
with fep->bufdesc_ex, still you return the return value of
ethtool_op_get_ts_info().

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

      parent reply	other threads:[~2013-01-06 11:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-06  1:38 [PATCH 1/1] net: fec: report correct hardware stamping info to ethtool Frank Li
2013-01-06  8:09 ` Richard Cochran
2013-01-06  8:15 ` Richard Cochran
2013-01-06  8:20 ` Richard Cochran
2013-01-06  8:23   ` Frank Li
2013-01-06  8:23     ` Frank Li
2013-01-06 11:33 ` Sascha Hauer [this message]

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=20130106113350.GE1906@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=Frank.Li@freescale.com \
    --cc=davem@davemloft.net \
    --cc=linux-arm-kernel@lists.infradead.or \
    --cc=lznuaa@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=shawn.guo@linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.