Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6138e687 authored by Richard Cochran's avatar Richard Cochran Committed by David S. Miller
Browse files

ptp: Introduce strict checking of external time stamp options.



User space may request time stamps on rising edges, falling edges, or
both.  However, the particular mode may or may not be supported in the
hardware or in the driver.  This patch adds a "strict" flag that tells
drivers to ensure that the requested mode will be honored.

Signed-off-by: default avatarRichard Cochran <richardcochran@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 592025a0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -276,7 +276,8 @@ static int mv88e6352_ptp_enable_extts(struct mv88e6xxx_chip *chip,
	/* Reject requests with unsupported flags */
	if (rq->extts.flags & ~(PTP_ENABLE_FEATURE |
				PTP_RISING_EDGE |
				PTP_FALLING_EDGE))
				PTP_FALLING_EDGE |
				PTP_STRICT_FLAGS))
		return -EOPNOTSUPP;

	pin = ptp_find_pin(chip->ptp_clock, PTP_PF_EXTTS, rq->extts.index);
+2 −1
Original line number Diff line number Diff line
@@ -524,7 +524,8 @@ static int igb_ptp_feature_enable_i210(struct ptp_clock_info *ptp,
		/* Reject requests with unsupported flags */
		if (rq->extts.flags & ~(PTP_ENABLE_FEATURE |
					PTP_RISING_EDGE |
					PTP_FALLING_EDGE))
					PTP_FALLING_EDGE |
					PTP_STRICT_FLAGS))
			return -EOPNOTSUPP;

		if (on) {
+2 −1
Original line number Diff line number Diff line
@@ -239,7 +239,8 @@ static int mlx5_extts_configure(struct ptp_clock_info *ptp,
	/* Reject requests with unsupported flags */
	if (rq->extts.flags & ~(PTP_ENABLE_FEATURE |
				PTP_RISING_EDGE |
				PTP_FALLING_EDGE))
				PTP_FALLING_EDGE |
				PTP_STRICT_FLAGS))
		return -EOPNOTSUPP;

	if (rq->extts.index >= clock->ptp_info.n_pins)
+2 −1
Original line number Diff line number Diff line
@@ -185,7 +185,8 @@ static int ravb_ptp_extts(struct ptp_clock_info *ptp,
	/* Reject requests with unsupported flags */
	if (req->flags & ~(PTP_ENABLE_FEATURE |
			   PTP_RISING_EDGE |
			   PTP_FALLING_EDGE))
			   PTP_FALLING_EDGE |
			   PTP_STRICT_FLAGS))
		return -EOPNOTSUPP;

	if (req->index)
+2 −1
Original line number Diff line number Diff line
@@ -472,7 +472,8 @@ static int ptp_dp83640_enable(struct ptp_clock_info *ptp,
		/* Reject requests with unsupported flags */
		if (rq->extts.flags & ~(PTP_ENABLE_FEATURE |
					PTP_RISING_EDGE |
					PTP_FALLING_EDGE))
					PTP_FALLING_EDGE |
					PTP_STRICT_FLAGS))
			return -EOPNOTSUPP;
		index = rq->extts.index;
		if (index >= N_EXT_TS)
Loading