HP-UX Reference (11i v1 00/12) - 5 Miscellaneous Topics, 7 Device (Special) Files, 9 General Information, Index (vol 9)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man7/!!!intro.7
________________________________________________________________
___ ___
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(2) system calls are discussed at the end of the document.
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
automatically controlled by the driver. ‘‘Modem status lines’’ (STATUS) are generally defined as those
incoming modem lines that are automatically monitored by the driver. CONTROL and STATUS for a termi-
nal file vary according to the modem line control mode of the file (see Modem line control modes below). An
open(2) to a port will be 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 is 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 Modem line control modes and Modem timers 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 device
(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 CON-
TROL
andSTATUS 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 Modem line
control modes below) and, if the device is a controlling terminal, a hangup signal will be sent to the control-
ling 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 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.
Terminal port access types
There are three types of modem access: call-in connections, call-out connections, and direct (no modem con-
trol) connections. A given port may be accessed through all three types of connection by accessing different
files. The modem access type of a terminal file is determined by the file’s major and/or minor device
numbers.
Section 766 1 HP-UX Release 11i: December 2000
___
___