 Modification to the PPS-API to support ffcounter timestamps
 
 ---
- kern/kern_tc.c |   38 +++++++++++++++++++++++++++++++++
- sys/timepps.h  |   64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 102 insertions(+)
+ kern/kern_tc.c |   41 +++++++++++++++++++++++++++++++++++
+ sys/timepps.h  |   65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 106 insertions(+)
 
 Index: sys/kern/kern_tc.c
 ===================================================================
---- sys.orig/kern/kern_tc.c	2010-12-22 20:25:11.000000000 +1100
-+++ sys/kern/kern_tc.c	2010-12-22 20:26:46.000000000 +1100
+--- sys.orig/kern/kern_tc.c	2010-12-23 00:13:53.000000000 +1100
++++ sys/kern/kern_tc.c	2010-12-23 00:21:48.000000000 +1100
 @@ -845,6 +845,9 @@ pps_ioctl(u_long cmd, caddr_t data, stru
  {
  	pps_params_t *app;

 	} else {
 		tsp = &pps->ppsinfo.clear_timestamp;
 		osp = &pps->ppsparam.clear_offset;
@@ -951,6 +976,11 @@ pps_event(struct pps_state *pps, int eve
 		fhard = pps->kcmode & PPS_CAPTURECLEAR;
 		pcount = &pps->ppscount[1];
 		pseq = &pps->ppsinfo.clear_sequence;

 	}
 
 	/*
@@ -967,6 +1000,9 @@ pps_event(struct pps_state *pps, int eve
 	/* Convert the count to a timespec. */
 	tcount = pps->capcount - pps->capth->th_offset_count;
 	tcount &= pps->capth->th_counter->tc_counter_mask;
+#ifdef FFCLOCK
+	ffcounter_mark = pps->capffth->ffcounter_mark;
+#endif
 	bt = pps->capth->th_offset;
 	bintime_addx(&bt, pps->capth->th_scale * tcount);
 	bintime_add(&bt, &boottimebin);
@@ -979,6 +1015,11 @@ pps_event(struct pps_state *pps, int eve
 	*pcount = pps->capcount;
 	(*pseq)++;
 	*tsp = ts;
+#ifdef FFCLOCK
+	(*ffclock_pseq)++;
+	*ffclock_tsp = ts;
+	*ffcounter = (ffcounter_mark + tcount);
+#endif
 
 	if (foff) {
 		timespecadd(tsp, osp);
Index: sys/sys/timepps.h
===================================================================
--- sys.orig/sys/timepps.h	2010-12-22 20:48:42.000000000 +1100
+++ sys/sys/timepps.h	2010-12-23 00:21:54.000000000 +1100
@@ -6,6 +6,12 @@
  * this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
  * ----------------------------------------------------------------------------
