netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] ptp: Allow selecting trigger/event index in testptp
@ 2014-02-04  7:46 Stefan Sørensen
  2014-02-04  8:01 ` Richard Cochran
  2014-02-05  4:27 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Stefan Sørensen @ 2014-02-04  7:46 UTC (permalink / raw)
  To: richardcochran, netdev; +Cc: Stefan Sørensen

Currently the trigger/event is hardcoded to 0, this patch adds
a new command line argument -i to select an arbitrary trigger/
event.

Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
---
Changes from v2:
* Keep options sorted all places - don't submit patches before cup of 
  coffee :-)

Changes from v1:
 * Keep options sorted

 Documentation/ptp/testptp.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/Documentation/ptp/testptp.c b/Documentation/ptp/testptp.c
index a74d0a8..4aba043 100644
--- a/Documentation/ptp/testptp.c
+++ b/Documentation/ptp/testptp.c
@@ -117,6 +117,7 @@ static void usage(char *progname)
 		" -f val     adjust the ptp clock frequency by 'val' ppb\n"
 		" -g         get the ptp clock time\n"
 		" -h         prints this message\n"
+		" -i val     index for event/trigger\n"
 		" -k val     measure the time offset between system and phc clock\n"
 		"            for 'val' times (Maximum 25)\n"
 		" -p val     enable output with a period of 'val' nanoseconds\n"
@@ -154,6 +155,7 @@ int main(int argc, char *argv[])
 	int capabilities = 0;
 	int extts = 0;
 	int gettime = 0;
+	int index = 0;
 	int oneshot = 0;
 	int pct_offset = 0;
 	int n_samples = 0;
@@ -167,7 +169,7 @@ int main(int argc, char *argv[])
 
 	progname = strrchr(argv[0], '/');
 	progname = progname ? 1+progname : argv[0];
-	while (EOF != (c = getopt(argc, argv, "a:A:cd:e:f:ghk:p:P:sSt:v"))) {
+	while (EOF != (c = getopt(argc, argv, "a:A:cd:e:f:ghi:k:p:P:sSt:v"))) {
 		switch (c) {
 		case 'a':
 			oneshot = atoi(optarg);
@@ -190,6 +192,9 @@ int main(int argc, char *argv[])
 		case 'g':
 			gettime = 1;
 			break;
+		case 'i':
+			index = atoi(optarg);
+			break;
 		case 'k':
 			pct_offset = 1;
 			n_samples = atoi(optarg);
@@ -301,7 +306,7 @@ int main(int argc, char *argv[])
 
 	if (extts) {
 		memset(&extts_request, 0, sizeof(extts_request));
-		extts_request.index = 0;
+		extts_request.index = index;
 		extts_request.flags = PTP_ENABLE_FEATURE;
 		if (ioctl(fd, PTP_EXTTS_REQUEST, &extts_request)) {
 			perror("PTP_EXTTS_REQUEST");
@@ -375,7 +380,7 @@ int main(int argc, char *argv[])
 			return -1;
 		}
 		memset(&perout_request, 0, sizeof(perout_request));
-		perout_request.index = 0;
+		perout_request.index = index;
 		perout_request.start.sec = ts.tv_sec + 2;
 		perout_request.start.nsec = 0;
 		perout_request.period.sec = 0;
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] ptp: Allow selecting trigger/event index in testptp
  2014-02-04  7:46 [PATCH v3] ptp: Allow selecting trigger/event index in testptp Stefan Sørensen
@ 2014-02-04  8:01 ` Richard Cochran
  2014-02-05  4:27 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Cochran @ 2014-02-04  8:01 UTC (permalink / raw)
  To: Stefan Sørensen; +Cc: netdev

On Tue, Feb 04, 2014 at 08:46:36AM +0100, Stefan Sørensen wrote:
> Currently the trigger/event is hardcoded to 0, this patch adds
> a new command line argument -i to select an arbitrary trigger/
> event.
> 
> Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
> ---
> Changes from v2:
> * Keep options sorted all places - don't submit patches before cup of 
>   coffee :-)
> 
> Changes from v1:
>  * Keep options sorted

Thanks for reworking this.

Acked-by: Richard Cochran <richardcochran@gmail.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] ptp: Allow selecting trigger/event index in testptp
  2014-02-04  7:46 [PATCH v3] ptp: Allow selecting trigger/event index in testptp Stefan Sørensen
  2014-02-04  8:01 ` Richard Cochran
@ 2014-02-05  4:27 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-02-05  4:27 UTC (permalink / raw)
  To: stefan.sorensen; +Cc: richardcochran, netdev

From: Stefan Sørensen <stefan.sorensen@spectralink.com>
Date: Tue,  4 Feb 2014 08:46:36 +0100

> Currently the trigger/event is hardcoded to 0, this patch adds
> a new command line argument -i to select an arbitrary trigger/
> event.
> 
> Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-05  4:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-04  7:46 [PATCH v3] ptp: Allow selecting trigger/event index in testptp Stefan Sørensen
2014-02-04  8:01 ` Richard Cochran
2014-02-05  4:27 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).