summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-02-27 12:27:09 +0000
committerphk <phk@FreeBSD.org>2003-02-27 12:27:09 +0000
commit432a37230075a04900fbea9fa6a39a38db05bb9a (patch)
tree81bf6216ef6f72d8af1cf5354de65c8bd4008691 /sys/dev
parent3ba9ae570741ac66a9e84c2b0b88cb347b31b6cf (diff)
downloadFreeBSD-src-432a37230075a04900fbea9fa6a39a38db05bb9a.zip
FreeBSD-src-432a37230075a04900fbea9fa6a39a38db05bb9a.tar.gz
Make flags bit 0x10000 mean that PPS timestamping should use the
CTS instead of the DCD pin.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/sio/sio.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index 8d7f95a..41fcd92 100644
--- a/sys/dev/sio/sio.c
+++ b/sys/dev/sio/sio.c
@@ -113,6 +113,7 @@
#define COM_DEBUGGER(flags) ((flags) & 0x80)
#define COM_LOSESOUTINTS(flags) ((flags) & 0x08)
#define COM_NOFIFO(flags) ((flags) & 0x02)
+#define COM_PPSCTS(flags) ((flags) & 0x10000)
#define COM_ST16650A(flags) ((flags) & 0x20000)
#define COM_C_NOPROBE (0x40000)
#define COM_NOPROBE(flags) ((flags) & COM_C_NOPROBE)
@@ -252,6 +253,7 @@ struct com_s {
struct timeval timestamp;
struct timeval dcd_timestamp;
struct pps_state pps;
+ int pps_bit;
u_long bytes_in; /* statistics */
u_long bytes_out;
@@ -1106,6 +1108,11 @@ determined_type: ;
com->devs[rid]->si_drv1 = com;
com->flags = flags;
com->pps.ppscap = PPS_CAPTUREASSERT | PPS_CAPTURECLEAR;
+
+ if (COM_PPSCTS(flags))
+ com->pps_bit = MSR_CTS;
+ else
+ com->pps_bit = MSR_DCD;
pps_init(&com->pps);
rid = 0;
@@ -1732,9 +1739,11 @@ siointr1(com)
while (!com->gone) {
if (com->pps.ppsparam.mode & PPS_CAPTUREBOTH) {
modem_status = inb(com->modem_status_port);
- if ((modem_status ^ com->last_modem_status) & MSR_DCD) {
+ if ((modem_status ^ com->last_modem_status) &
+ com->pps_bit) {
pps_capture(&com->pps);
- pps_event(&com->pps, (modem_status & MSR_DCD) ?
+ pps_event(&com->pps,
+ (modem_status & com->ppsbit) ?
PPS_CAPTUREASSERT : PPS_CAPTURECLEAR);
}
}
OpenPOWER on IntegriCloud