modem.7 (2010 09)

m
modem(7) modem(7)
NAME
modem - asynchronous serial modem line control
SYNOPSIS
#include <sys/modem.h>
DESCRIPTION
This section describes the two modes of modem line control and the three types of terminal port access. It
also discusses the effect of the bits of the termio structure that affect modem line control. The modem-
related
ioctl() system calls (see ioctl (2)) are discussed at the end of the manpage.
Definitions
There are several terms that are used within the following discussion which will be defined here for refer-
ence.
"Modem control lines" (CONTROL) are generally defined as those outgoing modem lines that are automat-
ically controlled by the driver.
"Modem status lines" (STATUS) are generally defined as those incoming modem lines that are automati-
cally monitored by the driver.
CONTROL and STATUS for a terminal file vary according to the modem line control mode of the file (see
the Modem Line Control Modes section below).
An open() (see open (2)) to a port is considered to be BLOCKED if it is waiting for another file on the
same port to be closed.
An
open() to a port is considered to be PENDING if it is waiting for the STATUS to be raised.
An
open() to a port is considered to be SUCCESSFUL if the open() system call has returned to the
calling process without error.
Open Flag Bits
Currently, the only
open() flag bits recognized by the driver are the O_NDELAY and O_NONBLOCK bits.
When either of these bits is set, an
open() call to the driver will never become blocked. If possible, the
open() will be returned immediately as SUCCESSFUL, and the driver will continue the process of
opening the tty file. If it is not possible, then the open() will be returned immediately with the
appropriate error code as described in the appropriate section.
Termio Bits
When set, the
CLOCAL bit in the termios or termio structure (see termio (7)) is used to remove the driver’s
automatic monitoring of the modem lines. However, the user’s ability to control the modem lines is deter-
mined only by the mode in effect and does not depend on the state of
CLOCAL. Normally, the driver will
monitor and require the STATUS to be raised. An
open() system call will raise the CONTROL and wait
for the STATUS before completing unless the CLOCAL bit is set. (If the
O_NDELAY or O_NONBLOCK bit
is set, the
open() will be returned immediately, but the driver will otherwise continue to monitor the
modem lines as normal based on the state of the CLOCAL bit.) Normally, loss of the STATUS will cause
the driver to break the modem connection and lower the CONTROL. However, if CLOCAL is set, any
changes in the STATUS will be ignored. A connection is required before any data may be read or written,
unless CLOCAL is set. Any timers that would normally be in effect (see the Modem Line Control Modes
and Modem Timers sections below) will be stopped while CLOCAL is set.
When the
CLOCAL bit is changed from clear to set, the driver will assume the existence of an active dev-
ice (such as a modem) on the port regardless of the STATUS. If any of the CONTROL are raised at that
point in time, they will continue in that state. The STATUS will no longer be actively monitored. When
the CLOCAL bit is changed from set to clear, the driver will resume actively monitoring the STATUS. If
all of the CONTROL and STATUS are raised at that point in time, the driver will continue the modem
connection. If any of the STATUS are not raised, the driver will act as though those signals were lost (as
described in the Modem Line Control Modes section below) and, if the device is a controlling terminal, a
hangup signal will be sent to the controlling process. If any of the CONTROL are not raised, the driver
will break the modem connection by lowering all the CONTROL.
The
HUPCL bit in the termios or termio structure determines the action of the driver regarding the CON-
TROL when the last close() system call (see close (2)) is issued to a terminal file. If the HUPCL bit is
set, the driver will lower the CONTROL at close() time and the modem connection will be broken. If
HUPCL is not set and a modem connection exists, it will continue to exist, even after the close() is
issued. The driver will not change the CONTROL.
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (6 pages)