HP-UX Reference (11i v2 07/12) - 7 Device (Special) Files, 9 General Information, Index (vol 10)

m
modem(7) modem(7)
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 the Modem Ioctls section below).
Terminal Port Access Interlock
An interlock mechanism is provided between the three access types of terminal files. It prevents more than
one file from being successfully opened at a time, but allows certain
open()s to succeed while others are
PENDING so that a port can be opened through a call-out connection while getty has a pending
open() at
a call-in connection. The three access types are given a priority that determines which
open() will
succeed if more than one file has an
open() issued against it. The three access types are ordered from
lowest priority to highest as follows: call-in, call-out, and direct.
If an
open() is issued to a port which already has a SUCCESSFUL open() on it of a lower priority type,
the new open() will be returned with an [EBUSY] error. ([EBUSY] will also be returned by an attempted
open() on a CCITT call-out file if an incoming call indication is currently being received. In this case, if
there is a PENDING open() on the corresponding CCITT call-in file, this PENDING
open() will com-
plete.) If the lower priority
open() is PENDING, the new open() will succeed if possible, or will be left
PENDING if waiting for the STATUS and the lower priority open() will become BLOCKED. If a higher
priority
open() has succeeded or is PENDING, the new open() will be BLOCKED, unless the new
open() has the O_NDELAY flag bit set, in which case the open() will be returned with an [EBUSY]
error. Once an open() on one type of file is SUCCESSFUL, any PENDING opens on lower priority files
will become BLOCKED.
When a file of one priority is closed, a BLOCKED
open() on the next lower priority type file will become
active. If all of the STATUS are raised, the open() will be SUCCESSFUL, otherwise the
open() will
become PENDING waiting for the STATUS. If the lower priority
open()
is SUCCESSFUL (because the
connection was maintained when the higher priority file was closed), the port characteristics (speed, parity,
etc.) that were set by the higher priority file will be inherited by the lower priority file. If the connection is
not maintained through the
close(), the port characteristics will be set to default values.
Modem Timers
There are four timers currently defined for use with modem connections. The first three of the timers are
applicable only to CCITT mode connections. In general, the effect of changing a timer value while the
timer is running is system dependent. However, setting the timer value to zero is guaranteed to disable
the timer even if it is running.
The connect timer is used to limit the amount of time to wait for a connection to be established once it has
been begun. This timer is started when an incoming call has been received on a call-in file, or when an
open() has been issued on a call-out file for which no opens are already pending. If the connection is
completed in time, the timer is aborted. If the time period expires, the connection is aborted. For a call-in
file, the driver will again wait for an incoming call and the
open() will remain pending. For a call-out
file, the open() will be returned with an [EIO] error.
The carrier detect timer is used to limit the amount of time to wait before causing a disconnect if DCD
drops. If carrier is not re-established in this time, a disconnect will occur. If carrier is re-established before
the timeout, the timer will be aborted and the connection maintained. During the period when carrier is
not raised, no data will be transferred across the line.
The no activity timer is used to limit the amount of time a connection will remain open with no data
transfer across the line. When the data line becomes quiescent with no data transfer, this timer will be
started. If data is again transferred over the line in either direction before the time limit, the timer will be
aborted. If no activity occurs before the timeout has occurred, the driver will disconnect the line. This can
be used to avoid long and costly telephone connections when data transfer has been stopped either normally
or abnormally.
The last timer defined, the hangup timer, is used for both CCITT and simple modes. This timer controls
the amount of time to wait after disconnecting a modem line before allowing another open(). This time
period should be made long enough to guarantee that the connection has been terminated by the telephone
88 Hewlett-Packard Company 3 HP-UX 11i Version 2: December 2007 Update