linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: Richard Cochran <richardcochran@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Rodolfo Giometti <giometti@linux.it>,
	Arnd Bergmann <arnd@arndb.de>,
	Peter Zijlstra <peterz@infradead.org>,
	linux-api@vger.kernel.org, devicetree-discuss@lists.ozlabs.org,
	linux-kernel@vger.kernel.org,
	Russell King <linux@arm.linux.org.uk>,
	Paul Mackerras <paulus@samba.org>,
	John Stultz <john.stultz@linaro.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	netdev@vger.kernel.org, Mike Frysinger <vapier@gentoo.org>,
	Christoph Lameter <cl@linux.com>,
	linuxppc-dev@lists.ozlabs.org, David Miller <davem@davemloft.net>,
	linux-arm-kernel@lists.infradead.org,
	Krzysztof Halasa <khc@pm.waw.pl>
Subject: Re: [PATCH V14 4/4] ptp: Added a clock driver for the National Semiconductor PHYTER.
Date: Mon, 18 Apr 2011 21:57:25 +0100	[thread overview]
Message-ID: <1303160245.2857.60.camel@bwh-desktop> (raw)
In-Reply-To: <1728ffb5735c2a04876a69ad55427c4e7b5a1bd7.1303107532.git.richard.cochran@omicron.at>

On Mon, 2011-04-18 at 08:30 +0200, Richard Cochran wrote:
> This patch adds support for the PTP clock found on the DP83640.
> The basic clock operations and one external time stamp have
> been implemented.
[...]
> --- /dev/null
> +++ b/drivers/net/phy/dp83640.c
[...]
> +static int match(struct sk_buff *skb, unsigned int type, struct rxts *rxts)
> +{
> +	u16 *seqid;

Should be __be16 *, and similarly for the casts.

> +	u8 *msgtype, *data = skb_mac_header(skb);
> +
> +	/* check sequenceID, messageType, 12 bit hash of offset 20-29 */
> +	/* We assume that the IPv4 header has no options. */

Does the hardware definitely not timestamp received packets with IP
options?

> +	switch (type) {
> +	case PTP_CLASS_V1_IPV4:
> +		msgtype = data + 42 + 32;
> +		seqid = (u16 *)(data + 42 + 30);
> +		break;
> +	case PTP_CLASS_V1_IPV6:
> +		msgtype = data + 62 + 32;
> +		seqid = (u16 *)(data + 62 + 30);
> +		break;
> +	case PTP_CLASS_V2_IPV4:
> +		msgtype = data + 42 + 0;
> +		seqid = (u16 *)(data + 42 + 30);
> +		break;
> +	case PTP_CLASS_V2_IPV6:
> +		msgtype = data + 62 + 0;
> +		seqid = (u16 *)(data + 62 + 30);
> +		break;
> +	case PTP_CLASS_V2_L2:
> +		msgtype = data + 14 + 0;
> +		seqid = (u16 *)(data + 14 + 30);
> +		break;
> +	case PTP_CLASS_V2_VLAN:
> +		msgtype = data + 18 + 0;
> +		seqid = (u16 *)(data + 18 + 30);
> +		break;
[...]

Would be better without the magic numbers.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

  reply	other threads:[~2011-04-18 20:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-18  6:27 [PATCH V14 0/4] ptp: IEEE 1588 hardware clock support Richard Cochran
2011-04-18  6:28 ` [PATCH V14 1/4] ptp: Added a brand new class driver for ptp clocks Richard Cochran
2011-04-18  6:54   ` Arnd Bergmann
2011-04-18  6:29 ` [PATCH V14 2/4] ptp: Added a clock that uses the eTSEC found on the MPC85xx Richard Cochran
2011-04-18  6:29 ` [PATCH V14 3/4] ptp: Added a clock driver for the IXP46x Richard Cochran
2011-04-18  6:56   ` Arnd Bergmann
2011-04-18  8:06     ` Richard Cochran
2011-04-18  8:16       ` Richard Cochran
2011-04-18  8:21       ` Arnd Bergmann
2011-04-18  8:26         ` Arnd Bergmann
2011-04-18 20:53   ` Ben Hutchings
2011-04-18  6:30 ` [PATCH V14 4/4] ptp: Added a clock driver for the National Semiconductor PHYTER Richard Cochran
2011-04-18 20:57   ` Ben Hutchings [this message]
2011-04-22  9:21     ` Richard Cochran

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=1303160245.2857.60.camel@bwh-desktop \
    --to=bhutchings@solarflare.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arnd@arndb.de \
    --cc=cl@linux.com \
    --cc=davem@davemloft.net \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=giometti@linux.it \
    --cc=john.stultz@linaro.org \
    --cc=khc@pm.waw.pl \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=netdev@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=richardcochran@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=vapier@gentoo.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).