Commit 9289252b authored by Richard Cochran's avatar Richard Cochran Committed by David S. Miller

dp83640: Reject requests to enable time stamping on both edges.

This driver enables rising edge or falling edge, but not both, and so
this patch validates that the request contains only one of the two
edges.
Signed-off-by: default avatarRichard Cochran <richardcochran@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c019b4be
...@@ -475,6 +475,13 @@ static int ptp_dp83640_enable(struct ptp_clock_info *ptp, ...@@ -475,6 +475,13 @@ static int ptp_dp83640_enable(struct ptp_clock_info *ptp,
PTP_FALLING_EDGE | PTP_FALLING_EDGE |
PTP_STRICT_FLAGS)) PTP_STRICT_FLAGS))
return -EOPNOTSUPP; return -EOPNOTSUPP;
/* Reject requests to enable time stamping on both edges. */
if ((rq->extts.flags & PTP_STRICT_FLAGS) &&
(rq->extts.flags & PTP_ENABLE_FEATURE) &&
(rq->extts.flags & PTP_EXTTS_EDGES) == PTP_EXTTS_EDGES)
return -EOPNOTSUPP;
index = rq->extts.index; index = rq->extts.index;
if (index >= N_EXT_TS) if (index >= N_EXT_TS)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment