modem.7 (2010 09)

m
modem(7) modem(7)
Terminal Port Access Types
There are three types of modem access: call-in connections, call-out connections, and direct (no modem
control) 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.
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. Nei-
ther 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 the Terminal Port Access Interlock section 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 considered 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
Terminal 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 pres-
ence 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 the Modem Timers section
below) is started. If the STATUS become raised before the time period has elapsed, a connection is esta-
blished 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
characters, and any characters received by the driver will be discarded. (However, on some implementa-
tions data transmission cannot be stopped. See the DEPENDENCIES section.) 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 open()s will be allowed until after both DSR and CTS have been lowered by the modem, and the
hangup timer (see the Modem Timers section 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 the Terminal Port Access
Interlock section 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 the Modem Ioctls section below). This is to provide strict adherence with the CCITT recom-
mendations.
2 Hewlett-Packard Company 2 HP-UX 11i Version 3: September 2010