Skip to contentSkip to conversation

Patch on man4/tty_ioctl.4 regarding TIOCMIWAIT & TIOCGICOUNT

PATCH Frédéric Maria 2 participants 2 messages Feb 9, 2009 – May 1, 2015 1 message not in the archive Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

Hello,

for a personal project I was interrested in using the wait for interrupt capability of serial ports.

After searching for documentation I found very few data about the tty ioctl
commands: TIOCMIWAIT and TIOCGICOUNT.
Moreover this was not documented in man4/tty_ioctl.4 file.

So here is a possible patch to add quick information on TIOCMIWAIT and TIOCGICOUNT commands.

This patch is against version 3.17 of the man pages.

Please do not hesitate to correct english terms as this is not my birth tongue.

Best regards
Fred

--- /home/fred/man-pages-3.17/man4/tty_ioctl.4 2009-01-19 05:14:02.000000000
+0100
+++ /home/fred/man-pages-3.17-new/man4/tty_ioctl.4 2009-02-09 10:20:43.363377700
+0100
@@ -349,18 +349,26 @@
.SS "Modem control"
.TP
.BI "TIOCMGET int *" argp
-get the status of modem bits.
+Get the status of modem bits.
.TP
.BI "TIOCMSET const int *" argp
-set the status of modem bits.
+Set the status of modem bits.
.TP
.BI "TIOCMBIC const int *" argp
-clear the indicated modem bits.
+Clear the indicated modem bits.
.TP
.BI "TIOCMBIS const int *" argp
-set the indicated modem bits.
+Set the indicated modem bits.
+.TP
+.BI "TIOCMIWAIT int " arg
+Wait for any of the 4 modem bits (DCD, RI, DSR, CTS) to change. +The mask is passed in arg for bits of interest (use |'ed +TIOCM_RNG/DSR/CD/CTS for masking).
+Caller should use
+.B TIOCGICOUNT
+to see which one it was.
.LP
-Bits used by these four ioctls:
+Bits used by these five ioctls:

.nf
TIOCM_LE DSR (data set ready/line enable)
@@ -375,6 +383,15 @@
TIOCM_RI see TIOCM_RNG
TIOCM_DSR DSR (data set ready)
.fi
+.TP
+.BI "TIOCGICOUNT struct serial_icounter_struct *" argp
+Get counter of input serial line interrupts (DCD, RI, DSR, CTS). +Write counters to the user passed
+.I argp
+serial_icounter_struct structure.
+.br
+NB: both 1->0 and 0->1 transitions are counted except for +RI where only 0->1 is counted.
.SS "Marking a line as local"
.TP
.BI "TIOCGSOFTCAR int *" argp

home/fred/man-pages-3.17-new/man4/tty_ioctl.4 renamed from home/fred/man-pages-3.17/man4/tty_ioctl.4 +22 -5
@@ -349,18 +349,26 @@
 .SS "Modem control"
 .TP
 .BI "TIOCMGET	int *" argp
-get the status of modem bits.
+Get the status of modem bits.
 .TP
 .BI "TIOCMSET	const int *" argp
-set the status of modem bits.
+Set the status of modem bits.
 .TP
 .BI "TIOCMBIC	const int *" argp
-clear the indicated modem bits.
+Clear the indicated modem bits.
 .TP
 .BI "TIOCMBIS	const int *" argp
-set the indicated modem bits.
+Set the indicated modem bits.
+.TP
+.BI "TIOCMIWAIT	int " arg
+Wait for any of the 4 modem bits (DCD, RI, DSR, CTS) to change.
+The mask is passed in arg for bits of interest (use |'ed
+TIOCM_RNG/DSR/CD/CTS for masking).
+Caller should use
+.B TIOCGICOUNT
+to see which one it was.
 .LP
-Bits used by these four ioctls:
+Bits used by these five ioctls:
 
 .nf
 TIOCM_LE        DSR (data set ready/line enable)
@@ -375,6 +383,15 @@
 TIOCM_RI         see TIOCM_RNG
 TIOCM_DSR       DSR (data set ready)
 .fi
+.TP
+.BI "TIOCGICOUNT	struct serial_icounter_struct *" argp
+Get counter of input serial line interrupts (DCD, RI, DSR, CTS).
+Write counters to the user passed
+.I argp
+serial_icounter_struct structure.
+.br
+NB: both 1->0 and 0->1 transitions are counted except for
+RI where only 0->1 is counted.
 .SS "Marking a line as local"
 .TP
 .BI "TIOCGSOFTCAR	int *" argp
#2 lore raw
In reply to a message not in the archive

Frédéric

Quoted 9 lines · Frédéric Maria

Hello,

for a personal project I was interrested in using the wait for interrupt capability of serial ports.

After searching for documentation I found very few data about the tty ioctl
commands: TIOCMIWAIT and TIOCGICOUNT.
Moreover this was not documented in man4/tty_ioctl.4 file.

Quoted 6 lines

So here is a possible patch to add quick information on TIOCMIWAIT and TIOCGICOUNT commands.

This patch is against version 3.17 of the man pages.

Please do not hesitate to correct english terms as this is not my birth tongue.

Long after the fact, I've applied this patch. Thanks for sending it.

Cheers,

Michael

Quoted 56 lines

--- /home/fred/man-pages-3.17/man4/tty_ioctl.4 2009-01-19 05:14:02.000000000
+0100
+++ /home/fred/man-pages-3.17-new/man4/tty_ioctl.4 2009-02-09 10:20:43.363377700
+0100

home/fred/man-pages-3.17-new/man4/tty_ioctl.4 renamed from home/fred/man-pages-3.17/man4/tty_ioctl.4 +22 -5
@@ -349,18 +349,26 @@
 .SS "Modem control"
 .TP
 .BI "TIOCMGET	int *" argp
-get the status of modem bits.
+Get the status of modem bits.
 .TP
 .BI "TIOCMSET	const int *" argp
-set the status of modem bits.
+Set the status of modem bits.
 .TP
 .BI "TIOCMBIC	const int *" argp
-clear the indicated modem bits.
+Clear the indicated modem bits.
 .TP
 .BI "TIOCMBIS	const int *" argp
-set the indicated modem bits.
+Set the indicated modem bits.
+.TP
+.BI "TIOCMIWAIT	int " arg
+Wait for any of the 4 modem bits (DCD, RI, DSR, CTS) to change.
+The mask is passed in arg for bits of interest (use |'ed
+TIOCM_RNG/DSR/CD/CTS for masking).
+Caller should use
+.B TIOCGICOUNT
+to see which one it was.
 .LP
-Bits used by these four ioctls:
+Bits used by these five ioctls:
 
 .nf
 TIOCM_LE        DSR (data set ready/line enable)
@@ -375,6 +383,15 @@
 TIOCM_RI         see TIOCM_RNG
 TIOCM_DSR       DSR (data set ready)
 .fi
+.TP
+.BI "TIOCGICOUNT	struct serial_icounter_struct *" argp
+Get counter of input serial line interrupts (DCD, RI, DSR, CTS).
+Write counters to the user passed
+.I argp
+serial_icounter_struct structure.
+.br
+NB: both 1->0 and 0->1 transitions are counted except for
+RI where only 0->1 is counted.
 .SS "Marking a line as local"
 .TP
 .BI "TIOCGSOFTCAR	int *" argp
Signature · 7 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html