[LinuxPPS] RIPE NCC interface: needing help

Kiss Gabor (Bitman) kissg at ssg.ki.iif.hu
Sat May 22 17:29:17 CEST 2010


Finally I succeeded in compiling RIPENCC driver.
As far as I can see it uses the same LinuxPPS API as PPS driver does.

Unfortunately it can not start:

The very first time_pps_create() called by ripencc_start() fails.
Strace shows this:

write(1, "ripencc_start: success\n", 23) = 23
 | 00000  72 69 70 65 6e 63 63 5f  73 74 61 72 74 3a 20 73  ripencc_ start: s |
 | 00010  75 63 63 65 73 73 0a                              uccess.           |
ioctl(5, IOCTL_TISER_TIMEOUT, 0xbfede0ac) = -1 EINVAL (Invalid argument)
time(NULL)                              = 1274538801
send(3, "<27>May 22 16:33:21 ntpd[25177]:"..., 98, MSG_NOSIGNAL) = 98
write(1, "addto_syslog: refclock_ripencc: "..., 80) = 80
 | 00000  61 64 64 74 6f 5f 73 79  73 6c 6f 67 3a 20 72 65  addto_sy slog: re |
 | 00010  66 63 6c 6f 63 6b 5f 72  69 70 65 6e 63 63 3a 20  fclock_r ipencc:  |
 | 00020  74 69 6d 65 5f 70 70 73  5f 63 72 65 61 74 65 20  time_pps _create  |
 | 00030  66 61 69 6c 65 64 3a 20  4f 70 65 72 61 74 69 6f  failed:  Operatio |
 | 00040  6e 20 6e 6f 74 20 73 75  70 70 6f 72 74 65 64 0a  n not su pported. |

IOCTL_TISER_TIMEOUT constant is confusing a bit. This is because
it is defined similarly as PPS_GETPARAMS:

linux/ticable.h:
#define IOCTL_TISER_TIMEOUT   _IOW('p', 0xa1, int) /* set timeout */

linux/pps.h:
#define PPS_GETPARAMS           _IOR('p', 0xa1, struct pps_kparams *)

So the problem is in time_pps_create() inline function:

        /* First we check if current device is a valid PPS one by
         * doing a dummy PPS_GETPARAMS...
         */
        ret = ioctl(source, PPS_GETPARAMS, &dummy);
        if (ret) {
                errno = EOPNOTSUPP;
                return -1;
        }

The following relevant modules are loaded:

Module                  Size  Used by
pps_ldisc               1534  1 
pps_core                5449  1 pps_ldisc

Any hint will be appreciated.

Gabor



More information about the LinuxPPS mailing list