I am running an embedded linux kernel on hardware that can be configured as DTE/DCE. In the tty/serial drivers in a file called tty_io.c there is a function tty_tiocmset() which takes a bit pattern from the tty_ioctl for setting/clearing specific modem control signals. Interestingly, the tty_tiocmset() function masks all other modem signals besides TIOCM_DTR|TIOCM_RTS|TIOCM_OUT1|TIOCM_OUT2|TIOCM_LOOP (this mask is shown in the code below). However, if you look at the documentation it appears that all modem signals should be able to be set/cleared http://www.kernel.org/doc/man-pages/online/pages/man4/tty_ioctl.4.html scroll down to "Modem Control".
Does anybody simply know why this mask is present without other signals such as RI, CD, CTS, DSR? Also is there another way to use the unmodified driver to control the other modem signals?
Linux was originally hosted on the x86 PC platform, which used 8250-type UARTs. The modem signal names OUT1 & OUT2 are not EIA/RS-232 names but do appear in the Western Digital 8250 data sheet! Those 5 bits listed for tty_tiocmset()
match (by name & function) the 5 bits available in the 8250 Modem Control Register. Any additional control lines would have to be implemented by logic external to the 8250.
Does anybody simply know why this mask is present without other signals such as RI, CD, CTS, DSR?
Those four that you mention are input signals to a DTE port, and PCs are normally configured (or assume/default) to be DTE.
Input signals would not appear in an output control register.
Maybe this is a bug when Linux is embedded in a device for a DCE port?
These input signals do appear in the Modem Status Register.
Also is there another way to use the unmodified driver to control the other modem signals?
You could remap OUT1
and OUT2
to whatever additional DTE signal(s) you need to output.
If you need to setup the port for DCE, then you may have to remap all four control lines.
For a DCE port (i.e. modem) there are typically only 4 output control lines: DCD, CTS, DSR, and RI. And there are exactly 4 output control bits (besides loopback) in the 8250 MCR!