HP-UX Reference (11i v1 05/09) - 7 Device (Special) Files, 9 General Information, Index (vol 10)

m
modem(7) modem(7)
The call-in type of access is used when the connection is expected to be established by an incoming call.
This is the type that would be used by getty(1M) to accept logins over a modem. When an open is issued to
such a file, the driver may wait for an incoming call and will then raise the
CONTROL based on the current
mode (see below) of the port. When the port is closed, the driver may or may not lower the
CONTROL
depending on the HUPCL bit.
The call-out type of access is used when the connection is expected to be established by an outgoing call.
This would be used by programs such as uucp(1). When an open is issued to such a file, the driver will
immediately raise the
CONTROL and wait for a connection based on the mode currently in effect. When the
port is closed, the driver may or may not lower the
CONTROL depending on the HUPCL bit.
The direct type of access is used when no driver modem control is desired. This could then be used for
directly connected terminals that use a three-wire connection, or to talk to a modem before a connection
has been established. The second case allows a program to give dialing instructions to the modem. Neither
the
CLOCAL nor the HUPCL bits have any effect on a port accessed through a direct file. (However, both
bits may be inherited by other types of files; see Terminal port access interlock below.) An open to a direct
file does not affect the
CONTROL and does not depend on any particular state of the STATUS
to succeed.
When the file is closed, the driver will not affect the state of the
CONTROL. If a modem connection has been
established, it will continue to exist. Setting the speed of a direct file to B0 (see termio(7) ) will be con-
sidered an impossible speed change and will be ignored. It will not affect the
CONTROL.
Modem line control modes
There are two modes of modem line control: CCITT mode and simple mode. A given port may have only
one of these two modes in effect at any given point in time. An attempt to open a port with a mode other
than the one in effect (from a
PENDING or SUCCESSFUL open on a different file) will cause the open to be
returned with an ENXIO error. The modem access type of a terminal file is determined by the file’s major
and/or minor device numbers.
CCITT mode is used for connections to switched line modems. The
CONTROL for CCITT mode are Data Ter-
minal Ready
(DTR) and Request to Send (RTS). The STATUS are Data Set Ready
(DSR), Data Carrier Detect
(DCD), and Clear to Send (CTS). Additionally, the Ring Indicator
(RI) signal indicates the presence of an
incoming call. When a connection is begun (an incoming call for a call-in file or an open issued to a call-out
file), the
CONTROL are raised and a connection timer (see Modem timers below) is started. If the
STATUS
become raised before the time period has elapsed, a connection is established and the open request is
returned successfully. If the time period expires, the
CONTROL are lowered and the connection is aborted.
For a call-in file, the driver will wait for another incoming call; for a call-out file, the open will be returned
with an EIO error. Once a connection is established, loss of either
DSR or CTS will cause the
CONTROL to be
lowered and, if the device is a controlling terminal, a hangup signal will be sent to the controlling process.
If
DCD is lost, a timer is started. If DCD resumes before the time period has expired, the connection will be
maintained. However, no data transfer will occur during this time. The driver will stop transmitting char-
acters, and any characters received by the driver will be discarded. (However, on some implementations
data transmission cannot be stopped. See DEPENDENCIES.) If DCD is not restored within the allotted
time, the connection will be broken as described above for DSR and CTS.
If the modem connection is to be broken when the close system call is issued (i.e. HUPCL
is set), then the
CONTROL will be lowered and the close will be returned as successful. However, no further opens will be
allowed until after both
DSR and CTS have been lowered by the modem, and the hangup timer (see Modem
timers below) has expired. The action taken in response to an open during this time will be the same as if
the port were still open. (See Terminal port access interlock below.)
When a port is in CCITT mode, the driver has complete control of the modem lines and the user is not
allowed to change the setting of the CONTROL or affect which STATUS are actively monitored by the driver
(see Modem ioctls below). This is to provide strict adherence with the CCITT recommendations.
Simple mode is used for connections to devices which require only a simple method of modem line control.
This can include devices such as black boxes, data switches, or for system-to-system connections. It can
also be used with modems which cannot operate under the CCITT recommendations. The CONTROL for
simple mode consists of only
DTR. The STATUS consists of only DCD. When an open is issued, the CONTROL
is raised but no connection timer is started. When the STATUS becomes raised, a connection is established
and the open request is returned as SUCCESSFUL. Once a connection is established, loss of the STATUS will
cause the CONTROL to be lowered and, if the device is a controlling terminal, a hangup signal will be sent to
the controlling process.
When a port is in simple mode, the driver will normally control the modem lines. However, the user is
allowed to change the setting of the CONTROL (see Modem ioctls below).
HP-UX 11i Version 1: September 2005 2 Hewlett-Packard Company Section 771