Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1526283

Re: [RFC PATCH v2 1/2] macb: Add 1588 support in Cadence GEM.

From Richard Cochran <richardcochran@gmail.com>
Newsgroups linux.kernel
Subject Re: [RFC PATCH v2 1/2] macb: Add 1588 support in Cadence GEM.
Date 2016-11-20 20:40 +0100
Message-ID <sFG81-7Hn-7@gated-at.bofh.it> (permalink)
References <sESkV-8jW-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Nov 18, 2016 at 03:21:51PM +0100, Andrei Pistirica wrote:
> +#ifdef CONFIG_MACB_USE_HWSTAMP
> +void macb_ptp_init(struct net_device *ndev);
> +#else
> +void macb_ptp_init(struct net_device *ndev) { }

static inline ^^^

> +#endif


> +void macb_ptp_init(struct net_device *ndev)
> +{
> +	struct macb *bp = netdev_priv(ndev);
> +	struct timespec64 now;
> +	u32 rem = 0;
> +
> +	if (!(bp->caps | MACB_CAPS_GEM_HAS_PTP)){
> +		netdev_vdbg(bp->dev, "Platform does not support PTP!\n");
> +		return;
> +	}

You would have needed '&' and not '|' here.

Also, using a flag limits the code to your platform.  This works for
you, but it is short sighted.  The other MACB PTP blocks have
different register layouts, and this patch does not lay the ground
work for the others.

The driver needs to be designed to support the other platforms.

Thanks,
Richard

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC PATCH v2 1/2] macb: Add 1588 support in Cadence GEM. Andrei Pistirica <andrei.pistirica@microchip.com> - 2016-11-18 15:30 +0100
  Re: [RFC PATCH v2 1/2] macb: Add 1588 support in Cadence GEM. Richard Cochran <richardcochran@gmail.com> - 2016-11-20 20:40 +0100
    Re: [RFC PATCH v2 1/2] macb: Add 1588 support in Cadence GEM. Andrei Pistirica <andrei.pistirica@microchip.com> - 2016-11-23 14:50 +0100
  Re: [RFC PATCH v2 1/2] macb: Add 1588 support in Cadence GEM. Richard Cochran <richardcochran@gmail.com> - 2016-11-20 20:40 +0100
    Re: [RFC PATCH v2 1/2] macb: Add 1588 support in Cadence GEM. Andrei Pistirica <andrei.pistirica@microchip.com> - 2016-11-23 14:40 +0100
      Re: [RFC PATCH v2 1/2] macb: Add 1588 support in Cadence GEM. Richard Cochran <richardcochran@gmail.com> - 2016-11-23 22:10 +0100
        RE: [RFC PATCH v2 1/2] macb: Add 1588 support in Cadence GEM. <Andrei.Pistirica@microchip.com> - 2016-11-24 10:50 +0100

csiph-web