 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;

 	}
 
 	/*
@@ -967,6 +997,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_record = pps->capth->ffcounter_record;
+#endif
 	bt = pps->capth->th_offset;
 	bintime_addx(&bt, pps->capth->th_scale * tcount);
 	bintime_add(&bt, &boottimebin);
@@ -979,6 +1012,11 @@ pps_event(struct pps_state *pps, int eve
 	*pcount = pps->capcount;
 	(*pseq)++;
 	*tsp = ts;
+#ifdef FFCLOCK
+	(*ffclock_pseq)++;
+	*ffclock_tsp = ts;
+	*ffcounter = (ffcounter_record + tcount);
+#endif
 
 	if (foff) {
 		timespecadd(tsp, osp);
Index: sys/sys/timepps.h
===================================================================
--- sys.orig/sys/timepps.h	2010-12-22 19:03:01.000000000 +1100
+++ sys/sys/timepps.h	2010-12-22 20:26:46.000000000 +1100
@@ -6,6 +6,12 @@
  * this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
  * ----------------------------------------------------------------------------

 	case PPS_IOC_KCBIND:
 #ifdef PPS_SYNC
 		kapi = (struct pps_kcbind_args *)data;
@@ -917,6 +931,9 @@ pps_capture(struct pps_state *pps)
 	th = timehands;
 	pps->capgen = th->th_generation;
 	pps->capth = th;
+#ifdef FFCLOCK
+	pps->capffth = fftimehands;
+#endif
 	pps->capcount = th->th_counter->tc_get_timecount(th->th_counter);
 	if (pps->capgen != th->th_generation)
 		pps->capgen = 0;
@@ -930,6 +947,12 @@ pps_event(struct pps_state *pps, int eve
 	u_int tcount, *pcount;
 	int foff, fhard;
 	pps_seq_t *pseq;
