Ioctl Requests isdnio(7I)
NAME
isdnio - ISDN interfaces
SYNOPSIS
#include
#include
int ioctl(int fd, int command, /* arg */ ...);
DESCRIPTION
ISDN ioctl commands are a subset of ioctl(2) commands that
perform a variety of control functions on Integrated Ser-
vices Digital Network (ISDN) STREAMS devices. The arguments
command and arg are passed to the file designated by fd and
are interpreted by the ISDN device driver.
fd is an open file descriptor that refers to a stream. com-
mand determines the control function to be performed as
described in the IOCTLS section of this document. arg
represents additional information that is needed by command.
The type of arg depends upon the command, but generally it
is an integer or a pointer to a command-specific data struc-
ture.
Since these ISDN commands are a subset of ioctl and
streamio(7I), they are subject to errors as described in
those interface descriptions.
This set of generic ISDN ioctl commands is meant to control
various types of ISDN STREAMS device drivers. The following
paragraphs give some background on various types of ISDN
hardware interfaces and data formats, and other device
characteristics.
Controllers, Interfaces, and Channels
This manual page discusses operations on, and facilities
provided by ISDN controllers, interfaces and channels. A
controller is usually a hardware peripheral device that pro-
vides one or more ISDN interfaces and zero or more auxiliary
interfaces. In this context, the term interface is
synonymous with the term "port". Each interface can provide
one or more channels.
Time Division Multiplexed Serial Interfaces
ISDN BRI-TE, BRI-NT, and PRI interfaces are all examples of
Time Division Multiplexed Serial Interfaces. As an example,
a Basic Rate ISDN (BRI) Terminal Equipment (TE) interface
provides one D-channel and two B-channels on the same set of
SunOS 5.11 Last change: 7 Apr 1998 1
Ioctl Requests isdnio(7I)
signal wires. The BRI interface, at the S reference point,
operates at a bit rate of 192,000 bits per second. The bits
are encoded using a pseudoternary coding system that encodes
a logic one as zero volts, and a logic zero as a positive or
negative voltage. Encoding rules state that adjacent logic
zeros must be encoded with opposite voltages. Violations of
this rule are used to indicate framing information such that
there are 4000 frames per second, each containing 48 bits.
These 48 bits are divided into channels. Not including fram-
ing and synchronization bits, the frame is divided into 8
bits for the B1-channel, 1 bit for the D-channel, 8 bits for
B2, 1 bit for D, 8 bits for B1, 1 bit for D, and 8 bits for
B2. This results in a 64,000 bps B1-channel, a 64,000 bps
B2-channel, and a 16,000 bps D-channel, all on the same
serial interface.
Basic Rate ISDN
A Basic Rate ISDN (BRI) interface consists of a 16000 bit
per second Delta Channel (D-channel) for signaling and X.25
packet transmission, and two 64000 bit per second Bearer
Channels (B-channels) for transmission of voice or data.
The CIT recommendations on ISDN Basic Rate interfaces,
I.430, identify several "reference points" for standardiza-
tion. From (Stallings89): Reference point T (terminal)
corresponds to a minimal ISDN network termination at the
customer's premises. It separates the network provider's
equipment from the user's equipment. Reference point S (sys-
tem) corresponds to the interface of individual ISDN termi-
nals. It separates user terminal equipment from network-
related communications functions. Reference point R (rate)
provides a non-ISDN interface between user equipment that is
not ISDN-compatible and adaptor equipment. ... The final
reference point ... is reference point U (user). This inter-
face describes the full-duplex data signal on the subscriber
line.
Some older technology components of some ISDN networks occa-
sionally steal the low order bit of an ISDN B-channel octet
in order to transmit in-band signaling information between
switches or other components of the network. Even when out-
of-band signaling has been implemented in these networks,
and the in-band signaling is no longer needed, the bit-
robbing mechanism may still be present. This bit robbing
behavior does not appreciably affect a voice call, but it
will limit the usable bandwidth of a data call to 56000 bits
per second instead of 64000 bits per second. These older
network components only seem to exist in the United States
of America, Canada and Japan. ISDN B-channel data calls that
have one end point in the United States, Canada or Japan may
SunOS 5.11 Last change: 7 Apr 1998 2
Ioctl Requests isdnio(7I)
be limited to 56000 bps usable bandwidth instead of the nor-
mal 64000 bps. Sometimes the ISDN service provider may be
able to supply 56kbps for some calls and 64kbps for other
calls. On an international call, the local ISDN service pro-
vider may advertise the call as 64kbps even though only
56kbps are reliably delivered because of bit-robbing in the
foreign ISDN that is not reported to the local switch.
A Basic Rate Interface implements either a Terminal Equip-
ment (TE) interface or a Network Termination (NT) interface.
TE's can be ISDN telephones, a Group 4 fax, or other ISDN
terminal equipment. A TE connects to an NT in order to gain
access to a public or private ISDN network. A private ISDN
network, such as provided by a Private Branch Exchange
(PBX), usually provides access to the public network.
If multi-point configurations are allowed by an NT, it may
be possible to connect up to eight TE's to a single NT
interface. All of the TE's in a multipoint configuration
share the same D and B-channels. Contention for B-Channels
by multiple TEs is resolved by the ISDN switch (NT) through
signaling protocols on the D-channel.
Contention for access to the D-channel is managed by a col-
lision detection and priority mechanism. D-channel call con-
trol messages have higher priority than other packets. This
media access function is managed at the physical layer.
A BRI-TE interface may implement a "Q-channel", the Q-
channel is a slow speed, 800 bps, data path from a TE to an
NT. Although the structure of the Q-channel is defined in
the I.430 specification, the use of the Q-channel is for
further study.
A BRI-NT interface may implement an "S-channel", the S-
channel is a slow speed, 4000 bps, data path from a NT to an
TE. The use of the S-channel is for further study.
Primary Rate ISDN
Primary Rate ISDN (PRI) interfaces are either 1.544Mbps (T1
rate) or 2.048Mbps (E1 rate) and are typically organized as
23 B-channels and one D-Channel (23B]D) for T1 rates, and 30
B-Channels and one D-Channel (30B]D) for E1 rates. The D-
channels on a PRI interface operate at 64000 bits per
second. T1 rate PRI interface is the standard in the United
States, Canada and Japan while E1 rate PRI interface is the
standard in European countries. Some E1 rate PRI interface
SunOS 5.11 Last change: 7 Apr 1998 3
Ioctl Requests isdnio(7I)
implementations allow access to channel zero which is used
for framing.
Channel Types
ISDN channels fall into several categories; D-channels,
bearer channels, and management pseudo channels. Each chan-
nel has a corresponding device name somewhere under the
directory /dev/isdn/ as documented in the appropriate
hardware specific manual page.
D-channels
There is at most one D-channel per ISDN interface. The
D-channel carries signaling information for the manage-
ment of ISDN calls and can also carry X.25 packet data.
In the case of a PRI interface, there may actually be no
D-channel if Non-Facility Associated Signaling is used.
D-channels carry data packets that are framed and
checked for transmission errors according to the LAP-D
protocol. LAP-D uses framing and error checking identi-
cal to the High Speed Data Link (HDLC) protocol.
B-channels
BRI interfaces have two B-channels, B1 and B2. On a BRI
interface, the only other type of channel is an H-
channel which is a concatenation of the B1 and B2 chan-
nels. An H-channel is accessed by opening the "base"
channel, B1 in this case, and using the ISDNSETFORMAT
ioctl to change the configuration of the B-channel from
8-bit, 8 kHz to 16-bit, 8kHz.
On a primary rate interface, B channels are numbered
from 0 to 31 in Europe and 1 to 23 in the United States,
Canada and Japan.
H-Channels
A BRI or PRI interface can offer multiple B-channels
concatenated into a single, higher bandwidth channel.
These concatenated B-channels are referred to as an "H-
channels" on a BRI interface. The PRI interface version
of an H-channel is referred to as an Hn-channels where n
is a number indicating how the B-channels have been
aggregated into a single channel.
o A PRI interface H0 channel is 384 kbps allowing
3H0]D on a T1 rate PRI interface and 4H0]D
channels on an E1 rate PRI interface.
SunOS 5.11 Last change: 7 Apr 1998 4
Ioctl Requests isdnio(7I)
o A T1 PRI interface H11 channel is 1536 kbps
(2464000bps). This will consume the channel
normally reserved for the D-channel, so signal-
ing must be done with Non-Facility Associated
Signaling (NFAS) from another PRI interface.
o An E1 PRI interface H12 channel is 1920 kbps
(3064000bps). An H12-channel leaves room for
the framing-channel as well as the D-channel.
Auxiliary channels
Auxiliary channels are non-ISDN hardware interfaces that
are closely tied to the ISDN interfaces. An example
would be a video or audio coder/decoder (codec). The
existence of an auxiliary channel usually implies that
one or more B-channels can be "connected" to an auxili-
ary interface in hardware.
Management pseudo-channels
A management pseudo-channel is used for the management
of a controller, interface, or hardware channel. Manage-
ment channels allow for out-of-band control of hardware
interfaces and for out-of-band notification of status
changes. There is at least one management device per
hardware interface.
There are three different types of management channels
implemented by ISDN hardware drivers:
o A controller management device handles all
ioctls that simultaneously affect hardware
channels on different interfaces. Examples
include resetting a controller, mu-code (as in
the Greek letter mu) downloading of a con-
troller, or the connection of an ISDN B-channel
to an auxiliary channel that represents an
audio coder/decoder (codec). The latter case
would be accomplished using the
ISDNSETCHANEL ioctl.
o An interface management device handles all
ioctls that affect multiple channels on the
same interface. Messages associated with the
activation and deactivation of an interface
arrive on the management device associated with
the D channel of an ISDN interface.
o Auxiliary interfaces may also have management
SunOS 5.11 Last change: 7 Apr 1998 5
Ioctl Requests isdnio(7I)
devices. See the hardware specific man pages
for operations on auxiliary devices.
Trace pseudo-channels
A device driver may choose to implement a trace device
for a data or management channel. Trace channels receive
a special MPROTO header with the original channel's
original MPROTO or MDATA message appended to the spe-
cial header. The header is described by:
typedef struct {
uintt seq; /* Sequence number */
int type; /* device dependent */
struct timeval timestamp;
char f[8]; /* filler */
} audtracehdrt;
ISDN Channel types
The isdnchant type enumerates the channels available on
ISDN interfaces. If a particular controller implements any
auxiliary channels then those auxiliary channels will be
described in a controller specific manual page. The defined
channels are described by the isdnchant type as shown
below:
/* ISDN channels */
typedef enum {
ISDNCHANONE = 0x0, /* No channel given */
ISDNCHANSELF, /* The channel performing the ioctl */
ISDNCHANHOST, /* Unix STREAM */
ISDNCHANCTRLMGT, /* Controller management */
/* TE channel defines */
ISDNCHANTEMGT, /* Receives activation/deactivation */
ISDNCHANTEDTRACE, /* Trace device for protocol analysis apps */
ISDNCHANTED,
ISDNCHANTEB1,
ISDNCHANTEB2,
/* NT channel defines */
ISDNCHANTMGT, /* Receives activation/deactivation */
ISDNCHANTDTRACE, /* Trace device for protocol analysis apps */
ISDNCHANTD,
ISDNCHANTB1,
ISDNCHANTB2,
SunOS 5.11 Last change: 7 Apr 1998 6
Ioctl Requests isdnio(7I)
/* Primary rate ISDN */
ISDNCHANPRIMGT,
ISDNCHANPRID,
ISDNCHANPRIB0, ISDNCHANPRIB1,
ISDNCHANPRIB2, ISDNCHANPRIB3,
ISDNCHANPRIB4, ISDNCHANPRIB5,
ISDNCHANPRIB6, ISDNCHANPRIB7,
ISDNCHANPRIB8, ISDNCHANPRIB9,
ISDNCHANPRIB10, ISDNCHANPRIB11,
ISDNCHANPRIB12, ISDNCHANPRIB13,
ISDNCHANPRIB14, ISDNCHANPRIB15,
ISDNCHANPRIB16, ISDNCHANPRIB17,
ISDNCHANPRIB18, ISDNCHANPRIB19,
ISDNCHANPRIB20, ISDNCHANPRIB21,
ISDNCHANPRIB22, ISDNCHANPRIB23,
ISDNCHANPRIB24, ISDNCHANPRIB25,
ISDNCHANPRIB26, ISDNCHANPRIB27,
ISDNCHANPRIB28, ISDNCHANPRIB29,
ISDNCHANPRIB30, ISDNCHANPRIB31,
/* Auxiliary channel defines */
ISDNCHANAUX0, ISDNCHANAUX1, ISDNCHANAUX2, ISDNCHANAUX3,
ISDNCHANAUX4, ISDNCHANAUX5, ISDNCHANAUX6, ISDNCHANAUX7
} isdnchant;
ISDN Interface types
The isdninterfacet type enumerates the interfaces avail-
able on ISDN controllers. The defined interfaces are
described by the isdninterfacet type as shown below:
/* ISDN interfaces */
typedef enum {
ISDNTYPEUNKNOWN = -1, /* Not known or applicable */
ISDNTYPESELF = 0, /*
* For queries, application may
* put this value into "type" to
* query the state of the file
* descriptor used in an ioctl.
*/
ISDNTYPEOTHER, /* Not an ISDN interface */
ISDNTYPETE,
ISDNTYPENT,
ISDNTYPEPRI,
} isdninterfacet;
Activation and Deactivation of ISDN Interfaces
The management device associated with an ISDN D-channel is
used to request activation, deactivation and receive
SunOS 5.11 Last change: 7 Apr 1998 7
Ioctl Requests isdnio(7I)
information about the activation state of the interface. See
the descriptions of the ISDNPHACTIVATEREQ and
ISDNMPHDEACTIVATEREQ ioctls. Changes in the activation
state of an interface are communicated to the D-channel
application through MPROTO messages sent up-stream on the
management device associated with the D-channel. If the D-
channel protocol stack is implemented as a user process, the
user process can retrieve the MPROTO messages using the
getmsg(2) system call.
These MPROTO messages have the following format:
typedef struct isdnmessage {
unsigned int magic; /* set to ISDNPROTOMAGIC */
isdninterfacet type; /* Interface type */
isdnmessagetypet message; /* CIT or vendor Primitive */
unsigned int vendor[5]; /* Vendor specific content */
} isdnmessaget;
typedef enum isdnmessagetype {
ISDNVPHVENDOR = 0, /* Vendor specific messages */
ISDNPHAI, /* Physical: Activation Ind */
ISDNPHDI, /* Physical: Deactivation Ind */
ISDNMPHAI, /* Management: Activation Ind */
ISDNMPHDI, /* Management: Deactivation Ind */
ISDNMPHEI1, /* Management: Error 1 Indication */
ISDNMPHEI2, /* Management: Error 2 Indication */
ISDNMPHIC, /* Management: Info Ind, connection */
ISDNMPHID /* Management: Info Ind, disconn. */
} isdnmessagetypet;
IOCTLS
STREAMS IOCTLS
All of the streamio(7I) ioctl commands may be issued for a
device conforming to the the isdnio interface.
ISDN interfaces that allow access to audio data should
implement a reasonable subset of the audio(7I) interface.
ISDN ioctls
ISDNPHACTIVATEREQ Request ISDN physical layer
activation. This command is valid
for both TE and NT interfaces. fd
must be a D-channel file descrip-
tor. arg is ignored.
TE activation will occur without
use of the ISDNPHACTIVATEREQ
ioctl if the device corresponding
to the TE D-channel is open,
SunOS 5.11 Last change: 7 Apr 1998 8
Ioctl Requests isdnio(7I)
"on", and the ISDN switch is
requesting activation.
ISDNMPHDEACTIVATEREQ fd must be an NT D-channel file
descriptor. arg is ignored.
This command requests ISDN physi-
cal layer de-activation. This is
not valid for TE interfaces. A TE
interace may be turned off by use
of the ISDNPARAMPOWER command
or by close(2) on the associated
fd.
ISDNACTIVATIONSTATUS fd is the file descriptor for a
D-channel, the management device
associated with an ISDN inter-
face, or the management device
associated with the controller.
arg is a pointer to an
isdnactivationstatust struc-
ture. Although it is possible for
applications to determine the
current activation state with
this ioctl, a D-channel protocol
stack should instead process mes-
sages from the management pseudo
channel associated with the D-
channel.
typedef struct isdnactivationstatus {
isdninterfacet type;
enum isdnactivationstate activation;
} isdnactivationstatust;
typedef enum isdnactivationstate {
ISDNOF = 0, /* Interface is powered down */
ISDNUNPLUGED, /* Power but no-physical connection */
ISDNDEACTIVATEDREQ, /* Pending Deactivation, NT Only */
ISDNDEACTIVATED, /* Activation is permitted */
ISDNACTIVATEREQ, /* Attempting to activate */
ISDNACTIVATED, /* Interface is activated */
} isdnactivationstatet;
The type field should be set to
ISDNTYPESELF. The device
specific interface type will be
returned in the type field.
The isdnactivationstatust
structure contains the interface
SunOS 5.11 Last change: 7 Apr 1998 9
Ioctl Requests isdnio(7I)
type and the current activation
state. type is the interface type
and should be set by the caller
to ISDNTYPESELF.
ISDNINTERFACESTATUS The ISDNINTERFACESTATUS ioctl
retrieves the status and statis-
tics of an ISDN interface. The
requesting channel must own the
interface whose status is being
requested or the ioctl will fail.
fd is the file descriptor for an
ISDN interface management device.
arg is a pointer to a struct
isdninterfaceinfo. If the
interface field is set to
ISDNTYPESELF, it will be
changed in the returned structure
to reflect the proper device-
specific interface of the
requesting fd.
typedef struct isdninterfaceinfo {
isdninterfacet interface;
enum isdnactivationstate activation;
unsigned int phai; /* Physical: Activation Ind */
unsigned int phdi; /* Physical: Deactivation Ind */
unsigned int mphai; /* Management: Activation Ind */
unsigned int mphdi; /* Management: Deactivation Ind */
unsigned int mphei1; /* Management: Error 1 Indication */
unsigned int mphei2; /* Management: Error 2 Indication */
unsigned int mphiic; /* Management: Info Ind, connection */
unsigned int mphiid; /* Management: Info Ind, disconn. */
} isdninterfaceinfot;
ISDNCHANELSTATUS The ISDNCHANELSTATUS ioctl
retrieves the status and statis-
tics of an ISDN channel. The
requesting channel must own the
channel whose status is being
requested or the ioctl will fail.
fd is any file descriptor. arg is
a pointer to a struct
isdnchannelinfo. If the inter-
face field is set to
ISDNCHANSELF, it will be
changed in the returned structure
to reflect the proper device-
specific channel of the
SunOS 5.11 Last change: 7 Apr 1998 10
Ioctl Requests isdnio(7I)
requesting fd.
typedef struct isdnchannelinfo {
isdnchant channel;
enum isdniostate iostate;
struct isdniostats {
ulongt packets; /* packets transmitted or received */
ulongt octets; /* octets transmitted or received */
ulongt errors; /* errors packets transmitted or received */
} transmit, receive;
} isdnchannelinfot;
ISDNPARAMSET fd is the file descriptor for a
management device. arg is a
pointer to a struct isdnparam.
This command allows the setting
of various ISDN physical layer
parameters such as timers. This
command uses the same arguments
as the ISDNPARAMGET command.
ISDNPARAMGET fd is the file descriptor for a
management device. arg is a
pointer to a struct isdnparam
This command provides for query-
ing the value of a particular
ISDN physical layer parameter.
typedef enum {
ISDNPARAMNONE = 0,
ISDNPARAMNT101, /* NT Timer, 5-30 s, in milliseconds */
ISDNPARAMNT102, /* NT Timer, 25-100 ms, in milliseconds */
ISDNPARAMTET103, /* TE Timer, 5-30 s, in milliseconds */
ISDNPARAMTET104, /* TE Timer, 500-1000 ms, in milliseconds */
ISDNPARAMAINT, /* Manage the TE Maintenance Channel */
ISDNPARAMASMB, /* Modify Activation State Machine Behavior */
ISDNPARAMPOWER, /* Take the interface online or offline */
ISDNPARAMPAUSE, /* Paused if == 1, else not paused == 0 */
} isdnparamtagt;
enum isdnparamasmb {
ISDNPARAMTEASMBCIT88, /* 1988 bluebook */
ISDNPARAMTEASMBCTS2, /* Conformance Test Suite 2 */
};
typedef struct isdnparam {
isdnparamtagt tag;
union {
unsigned int us; /* micro seconds */
unsigned int ms; /* Timer value in ms */
unsigned int flag; /* Boolean */
SunOS 5.11 Last change: 7 Apr 1998 11
Ioctl Requests isdnio(7I)
enum isdnparamasmb asmb;
enum isdnparammaint maint;
struct {
isdnchant channel; /* Channel to Pause */
int paused; /* TRUE or FALSE */
} pause;
unsigned int reserved[2]; /* reserved, set to zero */
} value;
} isdnparamt;
ISDNPARAMPOWER If an implementation provides
power on and off functions, then
power should be on by default. If
flag is ISDNPARAMPOWEROF then
a TE interface is forced into
state F0, NT interfaces are
forced into state G0. If flag is
ISDNPARAMPOWERON then a TE
interface will immediately tran-
sition to state F3 when the TE
D-channel is opened. If flag is
one, an NT interface will transi-
tion to state G1 when the NT D-
channel is opened.
Implementations that do not pro-
vide ISDNPOWER return failure
with errno set to
ENXIO.ISDNPOWER is different
from ISDNPHACTIVATEREQ since
CIT specification requires that
if a BRI-TE interface device has
power, then it permits activa-
tion.
ISDNPARAMNT101 This parameter accesses the NT
timer value T1. The CIT recom-
mendations specify that timer T1
has a value from 5 to 30 seconds.
Other standards may differ.
ISDNPARAMNT102 This parameter accesses the NT
timer value T2. The CIT recom-
mendations specify that timer T2
has a value from 25 to 100 mil-
liseconds. Other standards may
differ.
SunOS 5.11 Last change: 7 Apr 1998 12
Ioctl Requests isdnio(7I)
ISDNPARAMTET103 This parameter accesses the TE
timer value T3. The CIT recom-
mendations specify that timer T3
has a value from 5 to 30 seconds.
Other standards may differ.
ISDNPARAMTET104 This parameter accesses the TE
timer value T4. The CTS2 speci-
fies that timer T4 is either not
used or has a value from 500 to
1000 milliseconds. Other stan-
dards may differ. CTS2 requires
that timer T309 be implemented if
T4 is not available.
ISDNPARAMAINT This parameter sets the multi-
framing mode of a BRI-TE inter-
face. For normal operation this
parameter should be set to
ISDNPARAMAINTECHO. Other uses
of this parameter are dependent
on the definition and use of the
BRI interface S and Q channels.
ISDNPARAMASMB There are a few differences in
the BRI-TE interface activation
state machine standards. This
parameter allows the selection of
the appropriate standard. At
this time, only
ISDNPARAMTEASMBCIT88 and
ISDNPARAMTEASMBCTS2 are
available.
ISDNPARAMPAUSE This parameter allows a manage-
ment device to pause the IO on a
B-channel. pause.channel is set
to indicate which channel is to
be paused or un-paused.
pause.paused is set to zero to
un-pause and one to pause. fd is
associated with an ISDN interface
management device. arg is a
pointer to a struct isdnparam.
ISDNSETLOPBACK fd is the file descriptor for an
ISDN interface's management
SunOS 5.11 Last change: 7 Apr 1998 13
Ioctl Requests isdnio(7I)
device. arg is a pointer to an
isdnloopbackrequestt struc-
ture.
typedef enum {
ISDNLOPBACKLOCAL,
ISDNLOPBACKREMOTE,
} isdnloopbacktypet;
typedef enum {
ISDNLOPBACKB1 = 0x1,
ISDNLOPBACKB2 = 0x2,
ISDNLOPBACKD = 0x4,
ISDNLOPBACKEZERO = 0x8,
ISDNLOPBACKS = 0x10,
ISDNLOPBACKQ = 0x20,
} isdnloopbackchant;
typedef struct isdnloopbackrequest {
isdnloopbacktypet type;
int channels;
} isdnloopbackrequestt;
An application can receive D-
channel data during D-Channel
loopback but cannot transmit
data. The field type is the bit-
wise OR of at least one of the
following values:
ISDNLOPBACKB1 (0x1) /* loopback on B1-channel */
ISDNLOPBACKB2 (0x2) /* loopback on B2-channel */
ISDNLOPBACKD (0x4) /* loopback on D-channel */
ISDNLOPBACKEZERO (0x8) /* force E-channel to Zero if */
/* fd is for NT interface */
ISDNLOPBACKS (0x10) /* loopback on S-channel */
ISDNLOPBACKQ (0x20) /* loopback on Q-channel */
ISDNRESETLOPBACK arg is a pointer to an
isdnloopbackrequestt struc-
ture. ISDNRESETLOPBACK turns
off the selected loopback modes.
ISDN Data Format
The isdnformatt type is meant to be a complete description
of the various data modes and rates available on an ISDN
interface. Several macros are available for setting the for-
mat fields. The isdnformatt structure is shown below:
/* ISDN channel data format */
typedef enum {
SunOS 5.11 Last change: 7 Apr 1998 14
Ioctl Requests isdnio(7I)
ISDNMODENOTSPEC, /* Not specified */
ISDNMODEHDLC, /* HDLC framing and error checking */
ISDNMODETRANSPARENT /* Transparent mode */
} isdnmodet;
/* Audio encoding types (from audioio.h) */
#define AUDIOENCODINGNONE (0) /* no encoding*/
#define AUDIOENCODINGULAW (1) /* mu-law */
#define AUDIOENCODINGALAW (2) /* A-law */
#define AUDIOENCODINGLINEAR (3) /* Linear PCM */
typedef struct isdnformat {
isdnmodet mode;
unsigned int samplerate; /* sample frames/sec*/
unsigned int channels; /* # interleaved chans */
unsigned int precision; /* bits per sample */
unsigned int encoding; /* data encoding */
} isdnformatt;
/*
* These macros set the fields pointed
* to by the macro argument (isdnformatt*)fp in preparation
* for the ISDNSETFORMAT ioctl.
*/
ISDNSETFORMATBRID(fp) /* BRI D-channel */
ISDNSETFORMATPRID(fp) /* PRI D-channel */
ISDNSETFORMATHDLCB64(fp) /* BRI B-ch @ 56kbps */
ISDNSETFORMATHDLCB56(fp) /* BRI B-ch @ 64kbps */
ISDNSETFORMATVOICEULAW(fp) /* BRI B-ch voice */
ISDNSETFORMATVOICEALAW(fp) /* BRI B-ch voice */
ISDNSETFORMATBRIH(fp) /* BRI H-channel */
ISDN Datapath Types
Every STREAMS stream that carries data to or from the ISDN
serial interfaces is classified as a channel-stream data-
path. A possible ISDN channel-stream datapath device name
for a TE could be /dev/isdn/0/te/b1.
On some hardware implementations, it is possible to route
the data from hardware channel to hardware channel com-
pletely within the chip or controller. This is classified as
a channel-channel datapath. There does not need to be any
open file descriptor for either channel in this configura-
tion. Only when data enters the host and utilizes a STREAMS
stream is this classified as an ISDN channel-stream data-
path.
ISDN Management Stream
A management stream is a STREAMS stream that exists solely
for control purposes and is not intended to carry data to or
from the ISDN serial interfaces. A possible management
SunOS 5.11 Last change: 7 Apr 1998 15
Ioctl Requests isdnio(7I)
device name for a TE could be /dev/isdn/0/te/mgt.
CHANEL MANAGEMENT IOCTLS
The following ioctls describe operations on individual chan-
nels and the connection of multiple channels.
ISDNSETFORMAT fd is a data channel, the management
pseudo-channel associated with the data
channel, or the management channel asso-
ciated with the data channel's interface
or controller. arg is a pointer to a
struct isdnformatreq. The
ISDNSETFORMAT ioctl sets the format of
an ISDN channel-stream datapath. It may
be issued on both an open ISDN channel-
stream datapath Stream or an ISDN
Management Stream. Note that an open(2)
call for a channel-stream datapath will
fail if an ISDNSETFORMAT has never
been issued after a reset, as the mode
for all channel-stream datapaths is ini-
tially biased to ISDNMODENOTSPEC. arg
is a pointer to an ISDN format type
(isdnformatreqt*).
typedef struct isdnformatreq {
isdnchant channel;
isdnformatt format; /* data format */
int reserved[4]; /* future use - must be 0 */
} isdnformatreqt;
If there is not an open channel-stream
datapath for a requested channel, the
default format of that channel will be
set for a subsequent open(2).
To modify the format of an open STREAM,
the driver will disconnect the hardware
channel, flush the internal hardware
queues, set the new default configura-
tion, and finally reconnect the data
path using the newly specified format.
Upon taking effect, all state informa-
tion will be reset to initial condi-
tions, as if a channel was just opened.
It is suggested that the user flush the
interface as well as consult the
hardware specific documentation to
insure data integrity.
If a user desires to connect more than
one B channel, such as an H-channel, the
SunOS 5.11 Last change: 7 Apr 1998 16
Ioctl Requests isdnio(7I)
B-channel with the smallest offset
should be specified, then the precision
should be specified multiples of 8. For
an H-channel the precision value would
be 16. The user should subsequently open
the base B-channel. If any of the
sequential B-channels are busy the open
will fail, otherwise all of the B-
channels that are to be used in conjunc-
tion will be marked as busy.
The returned failure codes and their
descriptions are listed below:
EPERM /* No permission for intented operation */
EINVAL /* Invalid format request */
EIO /* Set format attempt failed. */
ISDNSETCHANEL The ISDNSETCHANEL ioctl sets up a
data connection within an ISDN con-
troller. The ISDNSETCHANEL ioctl can
only be issued from an ISDN management
stream to establish or modify channel-
channel datapaths. The ioctl parameter
arg is a pointer to an ISDN connection
request (isdnconnreqt*). Once a data
path is established, data flow is
started as soon as the path endpoints
become active. Upon taking effect, all
state information is reset to initial
conditions, as if a channel was just
opened.
The isdnconnreqt structure is shown
below. The five fields include the
receive and transmit ISDN channels, the
number of directions of the data path,
as well as the data format. The reserved
field must always be set to zero.
/* Number of directions for data flow */
typedef enum {
ISDNPATHNOCHANGE = 0, /* Invalid value */
ISDNPATHDISCONECT, /* Disconnect data path */
ISDNPATHONEWAY, /* One way data path */
ISDNPATHTWOWAY, /* Bi-directional data path */
} isdnpatht;
typedef struct isdnconnreq {
isdnchant from;
isdnchant to;
SunOS 5.11 Last change: 7 Apr 1998 17
Ioctl Requests isdnio(7I)
isdnpatht dir; /* uni/bi-directional or disconnect */
isdnformatt format; /* data format */
int reserved[4]; /* future use - must be 0 */
} isdnconnreqt;
To specify a read-only, write-only, or
read-write path, or to disconnect a
path, the dir field should be set to
ISDNPATHONEWAY, ISDNPATHTWOWAY ,
and ISDNPATHDISCONECT respectively.
To modify the format of a channel-
channel datapath, a user must disconnect
the channel and then reconnect with the
desired format.
The returned failure codes and their
descriptions are listed below:
EPERM /* No permission for intented operation */
EBUSY /* Connection in use */
EINVAL /* Invalid connection request */
EIO /* Connection attempt failed */
ISDNGETFORMAT The ISDNGETFORMAT ioctl gets the ISDN
data format of the channel-stream data-
path described by fd. arg is a pointer
to an ISDN data format request type
(isdnformatreqt*). ISDNGETFORMAT
can be issued on any channel to retrieve
the format of any channel it owns. For
example, if issued on the TE management
channel, the format of any other te
channel can be retrieved.
ISDNGETCONFIG The ISDNGETCONFIG ioctl is used to get
the current connection status of all
ISDN channels associated with a particu-
lar management STREAM. ISDNGETCONFIG
also retrieves a hardware identifier and
the generic interface type. arg is an
ISDN connection table pointer
(isdnconntabt*). The isdnconntabt
structure is shown below:
typedef struct isdnconntab {
char name[ISDNIDSIZE]; /* identification string */
isdninterfacet type;
int maxpaths; /* size in entries of app's array int npaths; */
/* number of valid entries returned by driver */
SunOS 5.11 Last change: 7 Apr 1998 18
Ioctl Requests isdnio(7I)
isdnconnreqt *paths; /* connection table in app's memory */
} isdnconntabt;
The table contains a string which is the
interface's unique identification
string. The second element of this table
contains the ISDN transmit and receive
connections and configuration for all
possible data paths for each type of
ISDN controller hardware. Entries that
are not connected will have a value of
ISDNOCHAN in the from and to fields.
The number of entries will always be
ISDNMAXCHANS, and can be referenced in
the hardware specific implementation
documentation. An isdnconntabt
structure is allocated on a per con-
troller basis.
SEE ALSO
getmsg(2), ioctl(2), open(2), poll(2), read(2), write(2),
audio(7I), streamio(7I)
ISDN, An Introduction - William Stallings, Macmillan Pub-
lishing Company. ISBN 0-02-415471-7
SunOS 5.11 Last change: 7 Apr 1998 19
|