mlx5: 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: Richard Cochran <richardcochran@gmail.com> Reviewed-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
5a450eb388
commit
ca12cf5ac9
1 changed files with 6 additions and 0 deletions
|
|
@ -243,6 +243,12 @@ static int mlx5_extts_configure(struct ptp_clock_info *ptp,
|
|||
PTP_STRICT_FLAGS))
|
||||
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;
|
||||
|
||||
if (rq->extts.index >= clock->ptp_info.n_pins)
|
||||
return -EINVAL;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue