[LinuxPPS] New code

Rodolfo Giometti giometti at enneenne.com
Mon Mar 5 00:38:02 CET 2007


On Sat, Mar 03, 2007 at 01:35:22PM -0800, gnu not unix wrote:
> 
> Not very much, but a little anyways. I'm still waiting
> for the long pll convergence to settle. That is not a
> fault of the linuxpps patch, but rather due to the
> other changes in the kernel, around 2.6.17 or so.

Ok.

I'm just waiting for a feedback from you since I have no hardware to
test serial code and I don't want to send buggy code to the LKML!  :)

> One suggestion, the setserial patch should probably
> also display the hardpps as a flag, if so set, when
> invoked without directives. Similar to, when setting
> the low_latency, it will display it thus:
> 
> root at wraith.wraith.sf.ca.us[15] ./setserial /dev/gps0
> /dev/gps0, UART: 16550A, Port: 0x03f8, IRQ: 4, Flags: low_latency

This should be enought:

diff -u setserial.c.old setserial.c
--- setserial.c.old	2007-02-17 08:47:45.000000000 +0100
+++ setserial.c	2007-03-05 00:32:20.000000000 +0100
@@ -127,6 +127,7 @@
 	CMD_FLAG,	"hup_notify",	ASYNC_HUP_NOTIFY, ASYNC_HUP_NOTIFY, 0, FLAG_CAN_INVERT,
 	CMD_FLAG,	"skip_test",	ASYNC_SKIP_TEST,ASYNC_SKIP_TEST,2, FLAG_CAN_INVERT,
 	CMD_FLAG,	"auto_irq",	ASYNC_AUTO_IRQ,	ASYNC_AUTO_IRQ,	2, FLAG_CAN_INVERT,
+	CMD_FLAG,	"hardpps",	ASYNC_HARDPPS_CD, ASYNC_HARDPPS_CD, 0, FLAG_CAN_INVERT,
 	CMD_FLAG,	"split_termios", ASYNC_SPLIT_TERMIOS, ASYNC_SPLIT_TERMIOS, 2, FLAG_CAN_INVERT,
 	CMD_FLAG,	"session_lockout", ASYNC_SESSION_LOCKOUT, ASYNC_SESSION_LOCKOUT, 2, FLAG_CAN_INVERT,
 	CMD_FLAG,	"pgrp_lockout", ASYNC_PGRP_LOCKOUT, ASYNC_PGRP_LOCKOUT, 2, FLAG_CAN_INVERT,
@@ -725,6 +726,7 @@
 	fprintf(stderr, "\t^ fourport\tconfigure the port as an AST Fourport\n");
 	fprintf(stderr, "\t  autoconfig\tautomatically configure the serial port\n");
 	fprintf(stderr, "\t^ auto_irq\ttry to determine irq during autoconfiguration\n");
+	fprintf(stderr, "\t^ hardpps\tmanage PPS signal when CD changes status\n");
 	fprintf(stderr, "\t^ skip_test\tskip UART test during autoconfiguration\n");
 	fprintf(stderr, "\n");
 	fprintf(stderr, "\t^ sak\t\tset the break key as the Secure Attention Key\n");

Also this patch should allow normal user to enable/disable the hardpps
flags (as for low_latency):

diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index e1a20fe..690daa5 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -272,7 +272,8 @@ struct uart_port {
 #define UPF_IOREMAP            ((__force upf_t) (1 << 31))
 
 #define UPF_CHANGE_MASK                ((__force upf_t) (0x17fff))
-#define UPF_USR_MASK           ((__force upf_t) (UPF_SPD_MASK|UPF_LOW_LATENCY))
+#define UPF_USR_MASK           ((__force upf_t) (UPF_SPD_MASK|UPF_LOW_LATENCY\
+                                                       |UPF_HARDPPS_CD))
 
        unsigned int            mctrl;                  /* current modem ctrl se
        unsigned int            timeout;                /* character-based timeo

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti at enneenne.com
Linux Device Driver                             giometti at gnudd.com
Embedded Systems                     		giometti at linux.it
UNIX programming                     phone:     +39 349 2432127



More information about the LinuxPPS mailing list