[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z4KfZwcyraeFUtNr@hoboy.vegasvil.org>
Date: Sat, 11 Jan 2025 08:42:15 -0800
From: Richard Cochran <richardcochran@...il.com>
To: Jiawen Wu <jiawenwu@...stnetic.com>
Cc: andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, linux@...linux.org.uk,
horms@...nel.org, jacob.e.keller@...el.com, netdev@...r.kernel.org,
vadim.fedorenko@...ux.dev, mengyuanlou@...-swift.com
Subject: Re: [PATCH net-next v3 4/4] net: ngbe: Add support for 1PPS and TOD
On Fri, Jan 10, 2025 at 11:17:16AM +0800, Jiawen Wu wrote:
> +static int wx_ptp_feature_enable(struct ptp_clock_info *ptp,
> + struct ptp_clock_request *rq, int on)
> +{
> + struct wx *wx = container_of(ptp, struct wx, ptp_caps);
> +
> + /**
> + * When PPS is enabled, unmask the interrupt for the ClockOut
> + * feature, so that the interrupt handler can send the PPS
> + * event when the clock SDP triggers. Clear mask when PPS is
> + * disabled
> + */
> + if (rq->type != PTP_CLK_REQ_PEROUT || !wx->ptp_setup_sdp)
> + return -EOPNOTSUPP;
> +
> + /* Reject requests with unsupported flags */
> + if (rq->perout.flags & ~PTP_PEROUT_PHASE)
> + return -EOPNOTSUPP;
> +
> + if (rq->perout.index != 0) {
> + wx_err(wx, "Perout index must be 0\n");
> + return -EINVAL;
> + }
Why do you need this test?
Framework in drivers/ptp/ptp_chardev.c does:
299 if (req.perout.index >= ops->n_per_out) {
300 err = -EINVAL;
301 break;
302 }
Thanks,
Richard
Powered by blists - more mailing lists