netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH net 3/6] pch_gbe: Validate hwtstamp_config completely before applying it
Date: Thu, 14 Nov 2013 08:21:37 +0100	[thread overview]
Message-ID: <20131114072011.GA4908@netboy> (raw)
In-Reply-To: <1384389770.29151.9.camel@bwh-desktop.uk.level5networks.com>

On Thu, Nov 14, 2013 at 12:42:50AM +0000, Ben Hutchings wrote:
> --- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
> +++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
> @@ -245,16 +245,8 @@ static int hwtstamp_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
>  	/* Get ieee1588's dev information */
>  	pdev = adapter->ptp_pdev;
>  
> -	switch (cfg.tx_type) {
> -	case HWTSTAMP_TX_OFF:
> -		adapter->hwts_tx_en = 0;
> -		break;
> -	case HWTSTAMP_TX_ON:
> -		adapter->hwts_tx_en = 1;
> -		break;
> -	default:
> +	if (cfg.tx_type != HWTSTAMP_TX_OFF && cfg.tx_type != HWTSTAMP_TX_ON)
>  		return -ERANGE;
> -	}
>  
>  	switch (cfg.rx_filter) {
>  	case HWTSTAMP_FILTER_NONE:
> @@ -284,6 +276,8 @@ static int hwtstamp_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
>  		return -ERANGE;
>  	}
>  
> +	adapter->hwts_tx_en = cfg.tx_type == HWTSTAMP_TX_ON;
> +

But now there is no way to turn transmit time stamping off?

>  	/* Clear out any old time stamps. */
>  	pch_ch_event_write(pdev, TX_SNAPSHOT_LOCKED | RX_SNAPSHOT_LOCKED);

Thanks,
Richard

  reply	other threads:[~2013-11-14  7:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-14  0:39 [PATCH net 0/6] net_tstamp: Validate hwtstamp_config completely before applying it Ben Hutchings
2013-11-14  0:40 ` [PATCH net 1/6] tg3: " Ben Hutchings
2013-11-14  0:55   ` Nithin Nayak Sujir
2013-11-14  0:41 ` [PATCH net 2/6] e1000e: " Ben Hutchings
2013-11-14 16:36   ` [E1000-devel] " Jeff Kirsher
2013-11-14  0:42 ` [PATCH net 3/6] pch_gbe: " Ben Hutchings
2013-11-14  7:21   ` Richard Cochran [this message]
2013-11-14  7:27     ` Richard Cochran
2013-11-14  8:17     ` David Miller
2013-11-14  0:43 ` [PATCH net 4/6] stmmac: " Ben Hutchings
2013-11-19  5:26   ` Giuseppe CAVALLARO
2013-11-19  5:55     ` Rayagond K
2013-11-14  0:47 ` [PATCH net 5/6] ti_cpsw: " Ben Hutchings
2013-11-14 12:49   ` Mugunthan V N
2013-11-14  0:48 ` [PATCH net 6/6] ixp4xx_eth: " Ben Hutchings
2013-11-14  6:53 ` [PATCH net 0/6] net_tstamp: " David Miller
2013-11-14 13:26 ` Richard Cochran
2013-11-14 21:23 ` 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=20131114072011.GA4908@netboy \
    --to=richardcochran@gmail.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.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 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).