The information in this document is subject to change without notice.
Hewlett-Packard makes no warranty of any kind with regard to this
manual, including, but not limited to, the implied warranties of
merchantability and fitness for a particular purpose. Hewlett-Packard
shall not be held liable for errors contained herein or direct, indirect,
special, incidental or consequential damages in connection with the
furnishing, performance, or use of this material.
Warranty. A copy of the specific warranty terms applicable to your
Hewlett- Packard product and replacement parts can be obtained from
your local Sales and Service Office.
Restricted Rights Legend. Use, duplication or disclosure by the U.S.
Government is subject to restrictions as set forth in subparagraph (c) (1)
(ii) of the Rights in Technical Data and Computer Software clause at
DFARS 252.227-7013 for DOD agencies, and subparagraphs (c) (1) and
(c) (2) of the Commercial Computer S oftware Restricted Rights clause at
FAR 52.227-19 for other agencies.
HEWLETT-PACKARD COMPANY 3000 Hanover Street Palo Alto,
California 94304 U.S.A.
Use of this manual and flexible disk(s) or tape cartridge(s) supplied for
this pack is restricted to this product only. Additional copies of the
programs may be made for security and back-up purposes only. Resale of
the programs in their present form or with alterations, is expressly
prohibited.
TrademarkNotices UNIXisaregistered trademark in the UnitedStates
and other countries, licensed exclusively through X/Open Company
Limited.
X Window System is a trademark of the Massachusetts Institute of
Technology.
MS-DOS and Microsoft are U.S. registered trademarks of Microsoft
Corporation.
OSF/Motif is a trademark of the Open Software Foundation, Inc. in the
U.S. and other countries.
4
Printing History
The manual publishing date and part number indicate its current
edition. The publishing date will change when a new edition is
published. Minor changes may be made without changing the publishing
date. The manual part number will change when extensive changes are
made.
Manual updates may be issued between editions to correct errors or
document product changes. To ensure t hat you receive the updated or
new editions, you should subscribe to the appropriate product support
service.See your HP sales representativefor details.
First EditionDec 1992Release 1.0
Second EditionMar 1994Release 2.1
The ZCOM Subsystem consists of software and firmware t hat provide
the base set of features for the ACC Product family. It consists of:
• HP-UX interface drivers that communicate with the ACC Mux cards
• the ZCOM Mux Kernel which is an operating system that is
downloaded to the ACC Mux cards
• a set of daemon and utility programs that provide and facilitate
access to the ZCOM Subsystem
• a library of routines t hat provides a comprehensive user interface t o
the ZCOM Subsystem.
The ZCOM Subsystem also provides a powerful framework for
experienced data communication programmers to develop customized
protocols for specialized data communication applications.
This document describes the programmatic interface to the ZCOM
Subsystem. It describes the ZCOM Subsystem tables, buffers, and
routines, and how they are used to achieve program-to-device and
program-to-program communication. It als o contains information
required when writing application programs to take advantage of ACC
product features, such as:
• remote node access
Thisfeatureallowsprogrammaticrequeststoberoutedtoeithera
Mux card that is connected to the system on which the request is
made, or to a program or Mux card on a remote system.
• dual interface Mux panel configurations
This feature allows two systems to connect to a single Mux panel.
• multiple protocol support
• true multi-thread programming support
• 64-bit programming support
12Chapter1
ZCOM Subsystem
ZCOM Software Overview
ZCOM Software Overview
Figure 1-1 on page 14 presents an architectural overview of the ZCOM
Subsystem.
The ZCOM application interface provides low level access to the ZCOM
Subsystem. Application programs make requests via the ZCOM library
routines which are then communicated to the firmware on the ACC Mux
card via the HP-UX drivers.
The firmware which runs on the ACC Mux card includes the ZCOM Mux
kernel software plus ZCOM protocol modules. The ZCOM protocol
modules provide the protocol specific firmware that runs on the ACC
Mux card
Note that the highlighted area in Figure 1-1 shows which software
components are provided by the base ZCOM Subsystem. Only protocol
modules used for loopback testing, and for monitoring the health of the
ACC Mux card and panel are provided with the base ZCOM Subsystem.
Protocol specific modules, such as X.25, are added to the ZCOM
Subsystem as separate products. The Protocol User’s Guides provided
with these products must be used in conjunction with this Programmer’s
Reference Guide when writing ZCOM application program
.
s.
Chapter 113
ZCOM Subsystem
ZCOM Software Overview
Figure 1-1Overview of ZCOM Software Structure
Application
or Utility
Program
X.25 TCP/IP
X.25 Level3
Prog. Accs.
Application
or Utility
Program
Other high
level
protocol
ZCOM HP-UX Drivers (LDM/DAM)
ZCOM Mux Kernel
......
......
Application
or Utility
Program
Low level
ZCOM I/F
HP9000
System
ACC Mux I/F
ZCOM
Protocol
Module
(X.25)
ZCOM
Protocol
Module
Mux datacomm interface to network
14Chapter1
ZCOM
Protocol
Module
......
ZCOM
Protocol
Module
Figure 1-2 presents another view of the ZCOM Subsystem which
includes the relationships between the various components of the ZCOM
Subsystem:
Figure 1-2ZCOM Subsystem Components
C Application
Program
ZCOM Subsystem
ZCOM Software Overview
ZCOM initialization
and Mux download
by ZMON
zmasterd
zmon
zmlog
Error log
Files
The ZCOM Subsystem is initialized by the zmon daemon which reads a
memory image file and downloads appropriate firmware to the ACC Mux
interface cards. The memory image file is created by running the ttgen
utility on an ASCII configuration file which contains information such as
what protocol will be used on the various ports of the ACC Mux cards,
and protocol specific configuration.
ZCOM I/F Library
ZCOM HP-UX Drivers
ACC I/F
Card
ACC I/F
Card
ACC I/F
Card
zterm
Utility
ZCOM Kernel
Tables & Buffers
...
ACC I/F
Card
Chapter 115
ZCOM Subsystem
ZCOM Software Overview
The zmlog program is used to log error messages generated by the
programs and daemons of the ZCOM Subsystem. The zmasterd daemon
is used to facilitate starting up and shutting down the daemons in the
ZCOM Subsystem, and to automatically recover from daemon failures.
Application programs make calls to the routines in the ZCOM
application interface. The same requests that can be made
programmatically can also be made interactively by using the zterm
program
.
16Chapter1
ZCOM Subsystem
ZCOM Concepts
ZCOM Concepts
Throughout this manual, references are made to terminal ZLU or just
terminal. This does not mean a physical terminal device type but is a
generic term that can refer to any kind of physical or logical entity.
Examples of physical entities are printers, an HDLC link, terminals, etc.
Examples of logical entities might be an X.25 Permanent or Switched
Virtual Circuit.
In the ZCOM Subsystem, messages are sent directly from sender to
receiver (where the receiver is another program or a terminal ZLU).
They are routed using a pointer called a ‘ZLU’ which stands for ‘ZCOM
Logical Unit’. ZCOM uses t he ZLU for its addressing mechanism. A ZLU
may represent a terminal (for instance, an X.25 virtual circuit) or an
application program. Messages are sent to and received by ZLUs.
Figure 1-3 on page 18
shows a sample set of program and terminal ZLUs,
and their interaction with each other and a Mux card:
Chapter 117
ZCOM Subsystem
ZCOM Concepts
Figure 1-3Definition and Features of ZLUs
Terminal 2
Terminal 1
Terminal
ZLU=57
Program
ZLU=502
Application
Program A
Mux card
Terminal
ZLU=231
Program
ZLU=500
Application
Program B
Terminal 3
Terminal
ZLU=101
To communicate to another program or to a terminal, a program uses
ZCOM library calls to write to a program or terminal ZLU. Each program
ZLU points to a queue that contains all messages, including timeout and
statusmessages, that were deliveredto the program ZLU. These pointers
are maintained automatically by the ZCOM Subsystem. When a message
is sent to a ZLU, the data is moved to a system buffer first and the
address of the message is moved to the attached input queue.
18Chapter1
ZCOM Subsystem
ZCOM Concepts
Program ZLUs
Each program may open one or more program ZLUs which provides an
input message queue to that program. Think of a program’s input
message queue as a m ailbox where messages can be delivered. All
messages delivered are queued at the end of the input queue for a
program in the order in which they were received. Note that the message
is not actually delivered to the program, but simply placed into the input
queue. The program must issue a ZCOM library call to retrieve the
messages one-by-one from the input queue. The method used to cause a
message to be placed into a program’s input queue will be different
depending on whether the message was created by another program or a
physical/logical device.
If a message is sent (generated) by another program, then the sending
program must specify the ZLU of the program’s input queue to place the
message into. The receiving program need not do anything for the
message to be successfully delivered to their mail box (program input
queue).
However, when a message is generated by a terminal ZLU, any program
that wishes to receive messages from that device (terminal ZLU) must
inform the ZCOM Subsystem first. The program should issue a ZCOM
call (zset_rcvr) to tell the ZCOM Subsystem that all data coming from
the specified terminal ZLU should be delivered to its input queue.
Whenever data arrives from the device, it will be placed into the input
queues of all programs that have requested this data.
Terminal ZLUs
Terminal ZLUs represent a physical or logical device and do not have
input queues of their own. Any data coming from a terminal ZLU will be
delivered to the input queues of all applications that have requested it. If
there is no application interested in receiving the data, then the data is
thrown away and a message is logged to that effect.
TerminalZLUs do however have three different output (transmit)
queues. When a program sends data to a terminal ZLU,it can select one
of three queues to place that data on. Each queue represents a different
level of priority. The Express Queue is used for extremely high-priority
protocol dependent requests. The High-Priority Queue is used for high
priority data and the Low-Priority Queue is used for low priority data.
When a message is generated by an application, the buffers involved are
queued to the selected transmit queue and the ZCOM driver is notified.
Chapter 119
ZCOM Subsystem
ZCOM Concepts
The driver is then responsible for handling the message. Messages on the
express q ueue are sent before those on the high priority queue which are
sent before those on the low priority queue.
Because the ZCOM Subsystem itself takes responsibility for the delivery
of messages, the sending program is able to specify a number of options
when it passes the message to the system. These options include:
• Continue execution whether the message is sent successfully or not.
• Continue execution but report any error status (status messages are
queued to the ZLU of the calling program).
• Continueexecution; a definite response will be queued to the program
ZLU when the send has completed.
• Suspend execution until the send has completed (i.e.,
acknowledgment that the message was transmitted).
On completion, the message buffer may also be passed back to the
sending application program if required.
Each message on the ZLU has a ‘type’ attribute so that the program
reading the ZLU is able to differentiate between status messages,
timeout messages and data messages from terminals or other programs.
20Chapter1
ZCOM Subsystem
User Interface
User Interface
The interface between the application programs and the ZCOM
Subsystem is through the ZCOM ‘C’ Application Programming Interface
(API) library. The functions provided by this library are documented in
Chapter 4 , “ZCOM C I/F Library Routines.” All functions within the
library are thread-safe and can be used in multi-threaded programs.
Both 32-bit and 64-bit applications are supported.
The interactive program ZTERM gives the user access to all the ZCOM
routines and can be used to test programs or terminals by sending and
receiving messages between them. The program ZSCAN allows the
programmer to display the contents of the ZCOM memory areas.
Chapter 121
ZCOM Subsystem
References
References
The following manuals should be referred to when using the ZCOM
application interface:
• ACC Installation and Configuration Guide
• ACC Utilities Reference Guide
The manuals corresponding to the protocol being used should also be
ZCOM message handling is achieved through logical constructs called
ZLUs which maintain queues for messages to terminals and programs.
The terminal ZLUs are either defined a t ZCOM configuration time using
ttgen, or can be created programmatically using the Dynamic System
Configuration functions; the program ZLUs are allocated dynamically
from a pool of ZLUs when requested.
24Chapter2
ZCOM Message Handling
ZLU Definition
ZLU Definition
There are three types of ZLUs. These are:
•Program
• Terminal (or remote device via a communication link)
•Mapped
Program ZLUs
A Program ZLU may be either a primary ZLU or an auxiliary ZLU. All
programs using ZCOM must have a primary ZLU defined. Other ZLUs
may then be defined as auxiliary if required. If a message is sent to
another program, then the destination ZLU is the other program’s
primary or auxiliary ZLU.
Terminal ZLUs
Terminal ZLUs are used to direct messages to terminals. Before a
program can receive messages from a terminal, a program must set itself
up as receiver for that particular terminal’s ZLU (using the zset_rcvr
routine call). Any number of programs can be set up as a receiver for a
given terminal at any one time. It is possible, of course, to set up a
program to route messages to other programs from the terminal ZL U.
NOTETerminal ZLU is a generic term. The actual physical entity associated
with a terminal ZLU is dependent on the particular protocol being used.
For example, with a TTY protocol a Terminal ZLU would be associated
withaphysicalterminalorterminallikedevice.However,witha
protocol such as X.25, a terminal ZLU might represent a virtual circuit
or the HDLC line (X.25 level 2).
Chapter 225
ZCOM Message Handling
ZLU Definition
Mapped ZLUs
AllmessagesaddressedtoaparticularZLUwillberedirectedtothe
alternate ZLU specified in the zmapr routine call if the original ZLU has
been mapped to a different ZLU. One use of mapped ZLUs is for
providing high availability systems. For example, if a hardware failure
was detected in one of the ACC Mux cards, the application could map all
of the ZLUs associated with the failed card to a spare unused card in the
system.
26Chapter2
ZCOM Message Handling
Message Queuing
Message Queuing
Each program ZLU (either primary or auxiliary) has a single input
queue on which messages are received and read on a first-in-first-out
basis.Because the ZLU is the input queuing mechanismfor timeoutsand
statuses,as well a s for data messages, all programs should request
(through the zopen routine) at least one program ZLU before using the
other ZCOM calls.
The ztimr routine may be used to enable or disable the timer on a
program ZLU. When enabled, a timeout message is added to the input
queue of the ZLU every n seconds (n being specified as a parameterto
the ztimr call). If there are already 10 or more messages on the queue, no
timer message is queued. Timer processing stops when ZTIMER and
ZCLOCK are reset to zero via the ztimr routine (a zero “time” value).
The application program uses the zread routinetoreadmessagesfrom
the input queue. All response and status messages are written to the
primary program ZLU. Data messages can be written to eit her the
primary or auxiliary program ZLUs.
When a zsend routine call is executed, the message to be sent is moved to
the ZCOM kernel buffer which is queued to the ZLU to which the
messagewassent.Themessageisaddedtotheendofthequeueforthe
specified ZLU.
Figure 2-1Program Message Queueing
Application A
zread
Chapter 227
Primary
Program
Input
Queue
Points to the
Input Queue
MSGMSG
ZCOM Message Handling
Message Queuing
Queues for terminal ZLUs are located in the physical terminal tables in
the ZCOM memory area as shown in Figure 2-2. The physical terminal
tables (one per terminal) maintain four queues for each terminal.
Figure 2-2Physical Terminal Table
Physical Terminal Table
Express Queue
High Priority Queue
Low Priority Queue
Unacknowledged Queue
The driver reads messages first from the express queue until there are
no remainingexpress queue messages, then from the high priorityqueue
until there are no high priority messages, at which stage the low priority
queue is read. Any further additions to the higher priority queues will be
read before the driver continues with the lower priority queues. When
the interface card is ready to accept messages, t he driver moves the
message to the unacknowledged queue and transfers the message to the
interface card (through the unacknowledged queue). Both the interface
card and the driver use DMA (Direct Memory Access) hardware to
transfer the messages. If the number of buffers on the unacknowledged
queue is less than the limit specified to TTGEN, more messages will be
transferred, otherwise the transfer will be suspended until some
outstanding messages are acknowledged.
Once the interface card has transmitted the message and has responded
with a definite status, the driver passes the status (if requested to do so)
back to the calling program. If the calling program also requires the
message buffer to be sent back with the status response, it is picked up
from the unacknowledged queue. Once the driver has passed the
message to the program, the message is removed from the
unacknowledged queue.
Messages in the unacknowledged queues for each terminal are also used
in a Mux restart: the messages are movedback to the high priority queue
to b e resent. The size of the unacknowledged queue is configurable in the
TTGEN configuration file.
28Chapter2
ZCOM Message Handling
Priorities
Priorities
Priorities only apply to messages that are destined for terminals.
MessagestoprogramZLUsaresimplyaddedtotheendoftheinput
queue for that ZLU.
Messages destined for terminal ZLUs may have either express, high or
low priority. The priority for a message is determined by bits
ZCOM_ZSEND_LPRand ZCOM_ZSEND_XPS of the mode parameter, in
the zsend and zcntl routine calls. If the ZCOM_ZSEND_XPS bit is set,
then the message is queued on the express queue in the physical
terminal table for that terminal ZLU. If the ZCOM_ZSEND_LPR bit is
set, then the message is queued on the low priority queue in the physical
terminal table for that terminal ZLU. If neither bit is set, then the
message is queued on the high priority queue. This enables background
tasks to be sent at lower priorities, without impacting any on-line
throughput.
The driver reads the information from the terminal tables, looking at the
high priority queue for each terminal and sending the message at the
head of that queue. The driver only checks the low priority queue if there
are no messages on the high priority queue. This means that any
message on the high priority queue will be sent first.
NOTEThe Express Queue should be reserved for Protocol Control events, such
as, interrupts or resets. Normally, data should not be sent using the
Express Queue.
Chapter 229
ZCOM Message Handling
Multiplexing
Multiplexing
The multiplexing feature of ZCOM allows more than one logical terminal
to be mapped to a single physical terminal. This mechanism i s
implemented in ZCOM by allowing messages to and from a terminal
ZLU to be intercepted by a program (which is able to alter the data
content, e.g., adding or removing headers) and then forwarded on to the
destination physical terminal or its receiver program.
Some fields in the logical terminal table and in the physical terminal
table are mentioned in the following descriptions; more information on
these fields can be found in the logical terminal table and the physical
terminal table information in the section on Tables and Data Structures.
The outbound and the inbound multiplexing are separate, so although in
most situations the multiplexing program will perform both functions, it
is possible to perform only inbound multiplexing or only outbound
multiplexing in any program.
The ltflag field of the logical terminal table (zltt_type) contains two flag
bits ZCOM_LTFLAG_OMX and ZCOM_LTFLAG_IMX, which indicate
whether messages to or from the logical terminal respectively, are to be
handled by a multiplexing program. These bits are set by TTGEN
according to the device type.
When more than one logical terminal is mapped to a single physical
terminal, the ltgzlk field (<zltt_type>.ltgzlk) linkage forms a circular list
of terminals in the same multiplexed group (i.e., mapped to the same
physical terminal). The ltqzlk field contains the ZLU number (16-bit) of
the next terminal in the group. For a non-multiplexing terminal, this
field contains the ZLU number of the current terminal (i.e., pointing
back to itself, a special case for circular list).
30Chapter2
ZCOM Message Handling
Multiplexing
Outbound Multiplexing
The multiplexing program uses the zread call to determine the origin of
the message, after which, the program would normally attach a protocol
header and forward the message to the destination physical terminal.
MZAUXL in the message header (see the chapter on Tables and Data
Structures) can be used to save the originating source node and ZLU on
the outbound message. The MZSRCE field in the message header is then
overridden with the multiplexing program’s primary ZLU, hence status
and response messages may be routed to the multiplexing program
insteadof the sender. Routine zsend writes to the physical terminal (with
bit ZCOM_ZSEND_NOMX set in the mode parameter). Routine zsend
with user header (mode bit ZCOM_ZSEND_MHD) must also be used.
The responses to the outbound messages are received by the
multiplexing program as type 6 (ZCOM_MSTYPE_RSLT) messages
(request code ZCOM_MRQCODE_WRITE [2]). The multiplexing
program has to strip the protocol header which it had previously added
and forward the response to the ZLU number saved in MSPARE (using
zsend with bits ZCOM_ZSEND_MHD and ZCOM_ZSEND_NOMX both
set).
Figure 2-3Outbound Multiplexing
Logical Terminal #1
TZLU1
TZLU2
LTZMXP-PZLU
Logical Terminal #2
LTGZLK=TZLU2
Chapter 231
Physical
Terminal
PZLU
ZCOM Message Handling
Multiplexing
If the ZCOM_LTFLAG_OMX bit is set in the LTFLAG word of the logical
terminal table, then a logical terminal is enabled for outbound
multiplexing. This means that any message sent (by zsend)tothis
terminal ZLU will be formatted as normal (type 4,
ZCOM_MSTYPE_LPLT, message with request descriptor block), but
instead of being queued to the physical terminal transmit queue, it will
be queued to the program ZLU defined by LTZMXP. These fields must
have been defined to the system for each terminal b y a prior zset_rcvr
call (mode 2, ZcOUTB_MLTPLX) by the outbound multiplexing program
during its initialization.
The zcntl call works in a similar way to zsend. For example, an enable of
a multiplexed logical terminal ZLU will queue an enable request (type 4,
ZCOM_MSTYPE_LPLT, request code 7, ZCOM_MRQCODE_ENB) to the
outbound multiplexing program’s input queue. These messages would
normally be used to maintain the flags for the logical terminal in
LTSTAT. They may also generate a control command to the physical
terminal from the multiplexing program.
Inbound Multiplexing
If the ZCOM_LTFLAG_IMX bit is set in the LTFLAG word of the logical
terminal table, then the logical terminal is enabled for inbound
multiplexing. This means that when an application program selects the
terminal for input (using zset_rcvr default mode 0), zset_rcvr will
insert the application program’s ZLU into LTZRVR (rather than
PTZRVR for a t erminal without inbound multiplexing).
It is up to the inbound multiplexing program to define itself to the ZCOM
subsystem as the receiver for messages from the physical terminal using
the zset_rcvr (mode 1, ZcINB_MLTPLX) call. This sets PTZRVR in the
physical terminal table.
The inbound multiplexing program has the task of receiving a ll
messages from the physical terminal. It determines the origin of the
logical terminal from which the messages were sent. Then it processes
any of the control messages and forwards the data portion of any data
messages to the application receiver.
32Chapter2
Figure 2-4Inbound Multoplexing
ZCOM Message Handling
Multiplexing
TZLU
APPLICATION
Physical
Ter minal
Logical
PTZLU
Terminal
LTZRVR
PTZRVR=PZLU
PZLU
Thus, to process an inbound message with multiplexing:
• zread (themessagetypewillbetype1,ZCOM_MSTYPE_MSLT-a
message from a terminal ZLU).
• The source ZLU is obtained from PTZLU. PTZLU gives the ZLU of
one of the ZLUs in a multiplexed group.
• Decode the protocol header to extract the logical terminal address.
Use the ltfind routine to scan the multiplexed group to find a match of
the logical terminal address with LTADDR.
• Build a ZCOM message header where the source ZLU is the ZLU
found by ltfind, and the destination ZLU is taken from LTZRVR of the
logicalterminalable.
•Usezsend (with bit ZCOM_ZSEND_MHD set) to send the message
and the ZCOM header to LTZRVR.
Chapter 233
ZCOM Message Handling
Terminal State
Terminal State
Within the ZCOM subsystem, the terminal state may be either enabled
or disabled, activated or deactivated. For normal I/O operations, a
terminal ZLU must be both enabled and activated. If a terminal is
disabled (regardless of whether it is activated), then no messages can be
sent to it or received from it.
If a terminal is enabled but deactivated, then messages can be sent to
the terminal, but none can be received. The following table illustrates
the different combinations.
NOTEA terminal state of disabled overrides the activated/deactivated status.
For some protocols (such as the NCR 301 protocol), the protocol handler
automatically deactivates the terminal when a valid message is received
and until it has been processed. Each time a message is received, the
terminal must be reactivated by the receiving program, using the zcntl
command with the ‘activate’ request code ( request code 9,
ZCOM_MRQCODE_ACT).
34Chapter2
ZCOM Message Handling
Error Handling
Error Handling
In the normal functioning of ZCOM, transmission errors on messages to
terminal ZLUs are handled by the Mux interface card firmware. The
firmware always sends a status back to the driver after it has processed
a request - retries are handled internally . The driver checks the mode of
the send (i. e., send no wait, report errors, etc.) to determine what to pass
back to the requesting program.
If a power failure occurs or the Mux interface card crashes, the driver
receives an interrupt from the operating system. This interrupt causes
thedrivertosendarequesttoZMONtodownloadthefirmwaretothe
particular interface card and to perform a full restart sequence (which
also involves re-sending any unacknowledged messages). If the directory
/var/opt/acc/dmp exists, ZCOM will upload the contents of the Mux
card memory and store it in a file in this directory whenever a Mux card
failure is detected. This provides the ability to analyze firmware failures
which can be particularly valuable during the development of custom
protocols.
For a detailed description of ZCOM C interface routine error codes,
please refer to the ACC Error Guide.
Chapter 235
ZCOM Message Handling
Error Handling
36Chapter2
3ZCOMTablesandData
Structures
37
ZCOM Tables and Data Structures
Introduction
Introduction
This chapter gives a detailed description of the ZCOM subsystem
memory organization and table layout.Each table structures is described
in overview, followed by a detailed explanation of all of the elements
within the table.
38Chapter3
Memory Organization
The ZCOM Logical Device Manager (LDM driver) reserves a contiguous
block of kernel memory for tables for its use. The maximum size of this
memory block is tunable at kernel build time through the
zcom_mem_size parameter in the “system” file used to build your
kernel. T he default value for this parameter is 4 Mbytes. This memory is
allocated relative to a starting pointer. The memory is organized by
function into the following groups:
Interface Tables
Response Records
Queue Header Structures
ZCOM Data Buffers
The TTGEN configuration file describes the sizes and initial content of
these tables. When TTGEN is run, it produces a memory image file that
isthesamesizeandinthesameformatasthismemorylayout.The
memory image file is loaded into the kernel memory by ZMON via the
LDM when the system is initialized. Most of the tables are preset up in
the file by TTGEN; however, the response headers, queue headers and
data buffers are created and initialized by the LDM.
Note that TTGEN reports the size of the memory block in the “System
Information” section of the listing (if a listing is requested). If the
tunableparameter zcom_mem_size is different from the reported size of
the memory block, the ‘ZCOM Data Buffers’ area will be increased or
reduced to fit the memory block in the kernel memory during ZCOM
subsystem startup.
Chapter 339
ZCOM Tables and Data Structures
Differences in 32-bit and 64-bit Data Structures
Differences in 32-bit and 64-bit Data
Structures
HP-UX supports 64-bit mode using the LP64 model. This means the long
and pointer fields are 64-bits in length. The ZCOM memory data
structures are designed to be 32/64-bit neutral by using conditional
padding fields. For example, a pointer field is defined as a 64-bit pointer
in 64-bit mode. But when the same field is used in the 32-bit kernel, it is
a 32-bit pointer prefixed with a 32-bit padding field (the padding is
inserted in front of the field). The data structures hence are the same
sizes in both 32 and 64-bit modes. This gives better control over data
alignment in the data structures, and allows 32-bit utilities to
manipulate both the 32and 64-bit data structures easily.
But this still does not give full transparency to 32-bit programs that
access ZCOM kernel tables on a 64-bit system. When a 32-bit program
manipulates a 64-bit long or pointer field in a data structure, the
program should consider whether the data structure comes from a 32-bit
or 64-bit kernel, even though it has the same size and layout. The
program should treat the padding fields as hidden fields (same as the
data structure alignment gaps inserted by the compiler) and should not
reference them directly.
Another side-effect is the ‘shifting’ of the long or pointer fields. Although
the overall layout is the same, the location offset of a long or pointer field
within a data structure is different in 32-bit and 64-bit modes. When
used in 32-bit mode, due to the presence of the 32-bit padding, the
position of a long or pointer field will be shifted 4-bytes towards the end,
compared to the same field when used in 64-bit mode.
Some of the data fields are of fixed 64-bit (e.g. hssoff in zheader_type)in
both 32/64 modes. If a 32-bit program is to manipulate these 64-bit fields,
it is recommended that the program should be compiled with the option
-Ae (extended ANSI) or -Ac (K&RCmode),soastoenablethe‘long long’
type for 64-bit integer.
The following sections describe the ZCOM data structures in 64-bitmode. Hence the conditional padding fields are suppressed. If they are
used in a 32-bit environment, the long and pointer fields will become
32-bit, and the 32-bit padding will be present.
40Chapter3
NOTE
ZCOM Tables and Data Structures
Differences in 32-bit and 64-bit Data Structures
The following sections document the data structures used internally by
the ACC ZCOM product to implement its functionality. These data
structures are subject to change without notice. Programs that directly
use these structures may be required to recompile their sources when a
new version of t he ZCOM subsystem is released (this will be indicated in
the release notes).
Chapter 341
ZCOM Tables and Data Structures
ZCOM Header Structure
ZCOM Header Structure
The ZCOM Header structure holds the system parameters and pointers
to other areas of the ZCOM memory tables as well as other information
that pertains to the whole ZCOM subsystem. The layout o f the ZCOM
Header structure zheader_type isshowninTable3-1.
T able 3-1ZCOM Header Structure
Field NameField DescriptionField TypeSize
HLABELHeader labelchar [4]4
HZREVCZCOM rev codeuns.short2
HTREVCTTGEN rev codeuns.short2
HNAME1Name of TTGEN source filechar [256]256
HNAME2Name of TTGEN object filechar [256]256
HSNAMESystem name (79 characters max)char [80]80
HSSOFFSystem starting offsetuns.longlong8
HSSSIZETotal system size in bytesuns.int4
HBPSIZEBuffer pool size in bytesuns.int4
HNDMAXTotal number of node table entriesuns.short2
HZLMAXTotal number of ZLUsuns.short2
HTMZLUNumber of terminal ZLUsuns.short2
HSPZLUNumber of program ZLUsuns.short2
HSPZL1First program ZLU numberuns.short2
HLTDSZESize of LTDATA in LT Tableuns.short2
HLTMAXNumber of logical terminal tablesuns.short2
HPTMAXNumber of physical terminal t ablesuns.short2
HNCARDNumber of interface tablesuns.short2
HNRESPNumber of response recordsuns.short2
HNLTQLNumber of LTT queue labelsuns.short2
HNLTSLNumber of LTT storage labelsuns.short2
HPNTBLPointer to 1st Node table entrypointer8
(Bytes)
42Chapter3
ZCOM Tables and Data Structures
ZCOM Header Structure
T able 3-1ZCOM Header Structure
Field NameField DescriptionField TypeSize
HPZLUPointer to 1st Zlu tablepointer8
HPTTBLPointer to 1st Logical terminal tablepointer8
HPPTBLPointer to 1st Physical terminal tablepointer8
HPIFTPPointer to 1st Interface tablepointer
HPRESPPointer to 1st response recordpointer8
HPQUESPointer to 1st Queue headerpointer8
HPBFFRPointer to data buffer poolpointer8
HPQLIMDefault program queue limit (msgs)uns.int4
HUNACKDefault terminal unack limit (bytes)uns.int4
HMAXTXDefault pending TX limit (messages)uns.int4
HIPLIMDefault IFT port TX limit (msgs)uns.int4
HCTOTALTotal number of DSC requestsuns.int4
HCSTATEDSC state
short2
(Bytes)
If positive, it is the number of active DSC
requests. If negative, DSC feature is suspended.
HCSWAITNumberofDSCstatewaitersuns.short2
HRDATAQRemote data queue headerzqhd_type56
HNDPIDZNODE Process IDint4
HNDSIGZNODE required s ignalint4
HNIDLEZNODE idle timer valueuns.int4
HNHIGHZNODE queue high-water markuns.int4
HNLOWZNODE queue low-water markuns.int4
HNWAITZNODE high-water mark waiteruns.short2
HLCLNDLocal node numberuns.short2
HLTQTBQueue label entries (16 bytes each)struct [20]20*16
HLTSTBStorage label entries (16 bytes each)struct[20]20*16
DSC_ercvrsDyn. Reconfig. SEM receiverspointer8
ETPLIMDefault E1/T1 port transmit limituns.int4
HOSTYPEType of operating systemint4
Chapter 343
ZCOM Tables and Data Structures
ZCOM Header Structure
HLABEL - ZMON identifier label
The identifier label contains the word ‘ZMON’ and provides compatibility
with HP1000 version of ZCOM. The memory image file contains the word
‘TTGE’ in this position. The LDM overwrites this after the ZCOM
subsystem has been initialized.
HZREVC - ZCOM revision code
TTGEN initializes this field with a 16-bit revision code, indicating the
version of the table structures. This revision code is stored as four 4-bit
digits. The first two digits represent the revision of a major release and
the last two digits represent a minor release revision. Data structures
and applications linked with a previous revision of the ZCOM software
will be compatible if they have same major revision code. ZMON checks
whether the revision code is acceptable. The different minor numbers
indicate compatible revisions, such as bug fixes (as long as the major
release revision code is the same).
HTREVC - TTGEN revision code
TTGEN inserts its integer revision code in this field in the memory
image file. It is loaded into memory (unchanged) by ZMON and the LDM.
This 16-bit revision code is stored in the same format as the ZCOM
revision code (HZREVC). However, there is no validation of this field.
HNAME1 -NameoftheTTGENsourcefile
Full path name of the source file used by TTGEN to generate the object
file. This field is limited to 256 bytes and is null terminated.
HNAME2 -NameofTTGENobjectfile
Full path name of the TTGEN produced object file which was then used
to startup (initialize) the ZCOM subsystem. This field is limited to 256
bytes and is null terminated.
HSNAME - ZCOM subsystem runtime instance name
Contains the contents of t he System-Name parameter supplied in the
TTGEN configuration file. This field is limited to 80 bytes and is null
terminated.
44Chapter3
ZCOM Tables and Data Structures
ZCOM Header Structure
HSSOFF - System starting offset
This pointer contains the starting physical kernel memory address of the
ZCOM subsystem memory. It is initialized to zero by TTGEN. ZMON
initializes it with the memory address while loading the memory tables
into kernel memory. It is a 64-bit value when used in a 64-bit kernel.
HSSIZE - Total runtime system size in bytes
This is the total size in bytes of the ZCOM subsystem memory, including
all tables, queue headers, and the buffer pool.
HBPSIZE - Buffer pool size in bytes
This is the size in bytes of the ZCOM buffer pool. It is defined by the
Buffer-Pool parameter in the TTGEN configuration file.
HNDMAX -Numberofnodeentries
This contains the maximum number of node entries which may exist in
the node entries memory section. This value is defined by the Node-Entry
keyword in the TTGEN configuration file. Each Local-Node and
Remote-Node definition consumes one node table entry.
HZLMAX - Total number of ZLUs
Total number of terminal ZLUs and spare (i.e.,program) ZLUs. That is,
this is the combined values of the Program-ZLU and Terminal-ZLU
parameters specified in the TTGEN configuration file.
HTMZLU -NumberofterminalZLUs
This is the number of ZLUs out of the total (HZLMAX) that are allocated
to terminals. The terminal ZLU numbers are allocated from 1 up to the
number specified in this field. The TTGEN Terminal-ZLU parameter is
used to initialize this field.
HSPZLU -NumberofprogramZLUs
Total number of available program ZLUs. The TTGEN Program-ZLU
parameter is used to initialize this field.
HSPZL1 - First program ZLU number
Number of the first ZLU not allocated to terminal ZLUs. This field is
initialized to the value of the TTGEN parameter Terminal-ZLU +1.It
indicates where the program ZLUs begin within the ZLU Table. Note
that program ZLUs are assigned from the range (Terminal-ZLU+1) to
(Terminal-ZLU + Program-ZLU).
Chapter 345
ZCOM Tables and Data Structures
ZCOM Header Structure
HLTDSZE - Logical terminal table LDATA buffer size
This specifies the size of the LDATA buffer in the logical terminal tables.
This value is initialized from the Logical-Size parameter in the TTGEN
configuration file. Set this parameter to 212 for backward compatibility
with HP 1000 programs (so that the total size of Logical Terminal Table
with extension is 512 bytes).
HLTMAX - Number of logical terminal tables
Contains the maximum number of Logical Terminal Tables (LTT) which
may exist in the configuration. This value is initialized from the
Logical-Term parameter in the TTGEN configuration file.
HPTMAX -Numberofphysicalterminaltables
Contains the maximum number of Physical Terminal Tables (PTT)
which may exist in the configuration. This value is initialized from the
Physical-Term parameter in the TTGEN configuration file.
HNCARD - Number of Mux interface tables
Number of Interface Tables (IFTs) which may exist in the configuration.
This value is initialized from the Interface-Table parameter in the
TTGEN configuration file. Note that there is one Interface Table (IFT)
per Mux card defined.
HNRESP -Numberofresponserecords
This field contains the number of response records in the ZCOM
subsystem. This value is initialized from the Program-ZLUparameter in
the TTGEN configuration file.
HNLTQL - Number of LTT queue labels
Numberof entries in the queue label table,up to a maximum valueof 20.
It is initialized by TTGEN to the number of Logical-Data statements
defined in the TTGEN configuration file. This value can be modified by
calling the zltqueue() routine.
HNLTSL - Number of LTT storage labels
Number of entries in the storage label table, up to a maximum value of
20. It is initially set up by TTGEN and subsequently maintained by the
LDM.
HPNTBL - Node Table pointer (znode_type *)
This is a pointer to the first entry in the Node Table. Note that all of the
node entries are stored in sequential order within kernel memory.
46Chapter3
ZCOM Tables and Data Structures
ZCOM Header Structure
HPZLU -ZLUtablepointer(zlu_type*)
This is a pointer to the 1st entry in the ZLU table. Note that all of the
ZLU table entries are stored in sequential order within kernel memory.
HPTTBL - Logical Terminal Table pointer (zltt_type *)
This is a pointer to the 1st Logical Terminal table. Note that all of the
LTTs are stored in sequential order within kernel memory.
HPPTBL - Physical TerminalTable pointer (zptt_type *)
This is a pointer to the 1st physical terminal table. Note that all of the
PTTs are stored in sequential order within kernel memory.
HPIFTP - Interface Table pointer (zift_type *)
This is a pointer to the first Interface Table (IFT). Note that all of the
IFTs are stored in sequential order within kernel memory.
HPRESP - Pointer to the first response record (zrsp_type *)
This is a pointer to the first response record. Note t hat all of the response
records are stored in sequential order within kernel memory.
HPQUES - Queue Header pointer (zqhd_type *)
This is a pointer to the first Queue Header. Note that all of the Queue
Headers are stored in sequential order within kernel memory.
HPBFFR - Data buffer pointer (char *)
This is a pointer to the start of the data buffer pool. The data buffer pool
is a block of contiguous kernel memory used for dynamically allocating
data buffers for a variety of uses. The size of this block of memory is
determinedby the Buffer-Pool parameter from the TTGEN configuration
file.
HPQLIM - Default program ZLU message queue limit
The default program ZLU message queue limit is the maximum number
of messages that may be queued on each program ZLU. This value is
initialized from the Queue-Limit parameter in the TTGEN configuration
file. The default limit may be overridden during a zopen() by specifying a
non-zero value in the limit parameter. The program ZLU queue limit
maybechangeddynamicallybycallingthezsetql() routine.
Chapter 347
ZCOM Tables and Data Structures
ZCOM Header Structure
HUNACK - Maximum number of unacknowledged Tx buffers pending
onaterminalZLU
Upper limit of the total size (in bytes) of all unacknowledged transmit
messages to a terminal ZLU. If this limit has been reached, any further
write requests to the terminal ZLU will be queued up in the terminal
table, but will not processed by the driver immediately. The driver will
resume processing of queued transmit requests when the Mux card
acknowledges the completion of a previously issued transmit request for
this terminal ZLU.This mechanism is used to prevent a few (or only one)
terminal from consuming all of the transmit buffers on the Mux interface
card. This field is initialized from the Unack-Limit parameter in the
TTGEN configuration file. The unacknowledged queue limit may be
changed dynamically by calling the zsetql() routine.
HMAXTX - Maximum number of Tx buffers pending on a terminal ZLU
Limit of transmit buffers pending on a terminal. When this limit is
reached, the program doing write requests to the terminal will be
suspended until some of the pending transmit requests are sent.
Together with the limit imposed by HUNACK, this protects the ZCOM
system buffers from excessive usage due to dead terminals (or other kind
of device).
HIPLIM - Default IFT port TX limit (bytes)
This field contains the limit (in bytes) of all unacknowledged transmit
messages t o terminal ZLUs belonging to the same port of a 2/8-port Mux
card. Each port on the card has approximately 24,480 bytes of buffer
space available for both internal use and transmit requests. If the DAM
issues a transmit request to the Mux card and the Mux card does not
have enough free buffers to hold the request data, the Mux will reject the
requestwithan“out of buffers” error. The DAM will retry the request
after an unacknowledged transmit request completes. This field is used
to minimize the number of retries (and thereby increase overall
performance) by imposing a limit on the size of unacknowledged
transmit requests. This value is configured through the Port-Limit
parameter in the TTGEN configuration file and is used t o initialize the
individual port limits iplimit[] kept in the interface table (zift_type).
48Chapter3
ZCOM Tables and Data Structures
ZCOM Header Structure
HCTOTAL - Total number of Dynamic System Configuration (DSC)
requests
This field contains the number of DSC requests processed by the ZCOM
subsystem since it was initialized and started up. It is incremented every
time a DSC request is processed. This value is for information purposes
only.
HCSTATE - Dynamic System Configuration (DSC) State
This field is used by the ZCOM subsystem as an indicator for controlling
DSC functions.When the value is zero or positive, the DS C functions are
enabled.The value represents the number of active DSC requests. When
the value is negative, DSC functions are disabled. DSC requests are
rejected until this field is set to zero. This field is initialized to zero by
TTGEN.
HCSWAIT -NumberofDSCstatewaiters
This field contains the number of processes suspended, waiting for the
DSC state to be set to zero. That is, the processes are waiting for the DSC
functions to be enabled. A process will be suspended if it issues a DSC
request while the DSC functions are disabled or if it issues a DSC disable
request while other DSC requests are in progress.
HRDATAQ - Remote data queue (ZNODE Queue)
This is t he data queue for remote ZCOM requests. All ZCOM API
requests to a remote node or deferred remote request responses will be
added to this queue by the LDM. The remote node request daemon,
ZNODE, reads and processes the request from this queue. This special
queue is sometimes referred to as the ZNODE queue or ZNODE data
queue.
HNDPID - ZNODE HP-UX process ID (PID)
This field contains the process ID (PID) of the local ZNODE daemon to
use for signalling the arrival of data on the ZNODE queue. If this value
is positive, the LDM will send a signal to this process ID whenever new
data is placed in the queue. If this value is negative, a signal will be sent
to the process group. The group ID used is the absolute value of this field.
This field is initialized to zero by TTGEN and is set up by the ZNODE
program when it starts up.
Chapter 349
ZCOM Tables and Data Structures
ZCOM Header Structure
HNDSIG - ZNODE signal number
ContainsthetypeofsignaltousewheninformingZNODEofthearrival
of new data in the ZNODE queue. This field is initialized to zero by
TTGEN and is set up by the ZNODE program when it starts up.
HNIDLE - ZNODE idle timer
This contains the time in seconds since ZNODE last issued a
Node-Status Update ioctl request to the ZCOM subsystem (LDM). The
LDM timer increments this field once every second and marks all nodes
as DOWN when it exceeds the inacti vity period (currently 20 seconds).
This field is initialized to zero when the ZCOM runtime subsystem is
started up.
HNHIGH, HNLOW - ZNODE queue high and low water marks (flow
control)
ThesetwofieldsareusedbytheLDMtocontroltheflowofdatabetween
the ZNODE daemon and t he LDM. When the number of pending
messages on the ZNODE queue reaches the high-water mark, programs
initiating remote requests a re suspended to avoid excessive buffer usage.
Suspended programs will be allowed to resume execution when the
number of queued messages drops to or below the low-water mark.
A special cas e exists when both the high and low water marks are set to
the same value. In this situation, whenever the number of pending
messages on the ZNODE queue is at or above this mark, all remote
requestsarerejectedwithanimmediateerrorreturnvalueofZENBUSY
(-1, ZNODE is busy).
Note that this mechanism is only applicable to programs initiating
remote requests and does not limit the messages or responses generated
as a result of ZCOM subsystem operation (e.g. a terminal ZLU returns a
message to its receiver in a remote system).
ThesetwovaluesaredefinedbytheFlow-Controlkeywordinthe
TTGEN configuration file. If not specified, they will default to a
high-water mark value of the maximum queue limit and a low-water
markvalueofzero(i.e.themechanismisdisabled).
HNWAIT - ZNODE queue high-water mark waiter
This field is maintained and used by the LDM to keep track of the
number of programs currently suspended due to the high/low water
mark flow control mechanism. It is initialized to zero by TTGEN.
50Chapter3
ZCOM Tables and Data Structures
ZCOM Header Structure
HLCLND - Local node number
The node number of the local ZCOM subsystem. If the Node-Definition
section in the TTGEN configuration file is omitted, TTGEN defaults this
field to one (1). Otherwise, it is initialized to the value of the Local-Node
parameter. It is set up by TTGEN as the first node table entry that has
zero ZLU number. There may be other numbers that also refer to the
local node but HLCLND is the only one that is used to identify the local
node on outbound messages.
HLTQTB - Queue label table
Each entry in the queue label table indicates the ownership of a data
queue in a logical terminal table. Each entry has a structure of 16 bytes
(zqlb_type)asshowninTable3-2.
The table is initialized by TTGEN from the Logical-Data statements in
the TTGEN configuration file. There is one entry in the Queue label table
for each Logical-Data statement. Additional entries can be added to this
table by calling the zltqueue routine (up t o a maximum of 20 queue
labels).
Chapter 351
ZCOM Tables and Data Structures
ZCOM Header Structure
HLTSTB - Storage label table
The storage label entry indicates the ownership of an application data
storage area in the logical terminal table extension area. Each entry is a
structure of 16 bytes (zslb_type), as shown in Table 3-3.
Table 3-3Storage Label Table
Field NameField DescriptionField TypeSize
SLBGRPAppl. grp. number (0 = globally assigned)uns.short2
SLBNAMStorage label namechar8
SLBSZESize of the application data in bytesuns.short2
SLBOFFOffset from the start of the LTT to the application data
in the extension area. Therefore, this value is the size
of the LTT plus the offset of the application data from
the start of the LTT extension area.
SLBRSV<reserved>, unusedchar2
The table is initialized by TTGEN from the Logical-Data statements in
the TTGEN configuration file. There is one entry in the Storage label
table for each Logical-Datastatement. Additional entries can be added to
this table by calling the zltqueue() routine (up to a maximum of 20
storage labels).
short2
(Bytes)
DSC_ercvrs - Dynamic Reconfiguration System Event Receivers pointer
(zshaddr_type *)
This field contains a pointer to a linked list of all applications that wish
to be notified whenever a ZCOM subsystem dynamic reconfiguration
system event message is generated (through the zconfig routine). This
field is initialized by TTGEN to zero. It will only contain a value if at
least one application has requested notification.
52Chapter3
ZCOM Tables and Data Structures
ZCOM Header Structure
ETPLIM- Default E1/T1 IFT port TX limit (bytes)
This field contains the limit (in bytes) of all unacknowledged transmit
messagesto terminal ZLUs belongingto the sameport and subchannel of
an E1/T1 card. Each E1/T1 card has approximately 16 M-bytes of buffer
space available for both internal use and transmit requests. If the DAM
issues a transmit request to the E1/T1 card and the card does not have
enough free buffers to hold the request d ata, the Mux will reject the
requestwithan“out of buffers” error. The DAM will retry the request
after an unacknowledged transmit request completes. This field is used
to minimize the number of retries (and thereby increase overall
performance) by imposing a limit on the size of unacknowledged
transmit requests. This value is configured through the E1T1-Port-Limit
parameter in the TTGEN configuration file and is used to initialize the
individual port and subchannel limit array iplimit[] kept in the interface
table (zift_type).
HOSTYPE -Typeofoperatingsystem
This field indicates the type of operating system that manipulates the
data structures. The allowed valuesare 0, 32 (32-bit kernel) or 64 (64-bit
kernel). It is first set up by TTGEN to 0. Then it is set to 32 or 64 by
ZMON when it initializes the ZCOM kernel memory block.
Chapter 353
ZCOM Tables and Data Structures
Node Entries Table
Node Entries Table
TheNodeEntriestablecontainsinformationabouttheremoteZCOM
systems that communicate with the local ZCOM subsystem. Each
Local-Node and Remote-Node definition in the TTGEN configuration file
occupy one entry in the table. Each entry structure is 392 bytes long and
has the format shown in Table 3-4.
Table 3-4Node Entries Table
Field NameField DescriptionField TypeSize
node_numZCOM system node numberuns.short2
timeoutDefault timeout value for this nodeuns.short2
flagsNode status and internal flagsuns.int4
statsStatistics for this nodestruct16
ndshzrvrsList of node status event receiverspointer8
nhostNumber of hosts in the host arrayuns.short2
spare1Reserved, not useduns.short2
spare2Reserved, not usedint4
hostHost link informationstruct [4]4*88
(Bytes)
NODE_NUM - Node number
This field contains a unique node number that identifies the entry.
TIMEOUT - Default timeout value for this node
This field contains timeout in seconds for requests sent to this remote
node. Most remote ZCOM requests (e.g. ZOPEN, ZTIMR,etc)requirea
definite response from the remote ZCOM subsystem. If the response is
not received within the timeout period specified by this field, error
ZENTOUT (-23) is returned to the application program. This field is
initialized by TTGEN with the timeout value specified in a Remote-Node
definition. This field is zero for a local node entry.
54Chapter3
ZCOM Tables and Data Structures
Node Entries Table
FLAGS - Node status and internal flags
This bit-field structure contains bits to maintain state and other internal
information about this node. The contents of this field are as follows:
FLAGS.event -Set to 1 if there is at least one application that wants to be
notified of a status change for the node.
FLAGS.valid -Set to 1 if this node entry in the table is valid; that is,
currently defined and in use.
FLAGS.status -Set to 1 if this node is currently UP. The status bit indicates
whether a remote node is usable. If this bit is not set, the
LDM will reject all requests to that node with a
ZENDOWN(-61)error.Foralocalnode,thestatus bit
indicates that the ZNODE daemon is running properly.
FLAGS.local-Set to 1 if this node entry in the table represents the local
node.
STATS - Statistics for this node
This field is a data structure that contains some statistics on the data
traffic for this node. The layout of this structure is shown in Table 3-5.
Table 3-5STATS Data Structure
Field NameField DescriptionField TypeSize
icountNumber of incoming messagesuns.int4
ibytesNumber of incoming bytesuns.int4
ocountNumber of outgoing messagesuns.int4
obytesNumber of outgoing bytesuns.int4
NDSHZRVRS - Pointer to a list of receivers for node status events.
This field contains a pointer to a linked list of applications to be notified
whenever this node changes state. Whenever this node changes state
from up-to-down or down-to-up, a node status system event message will
be sent to each program in this linked list. That is, those applications
that have issued a zevent_rcvr() call to receive node status events. This
field will be set to zero if there are no applications to be notified.
Chapter 355
(Bytes)
ZCOM Tables and Data Structures
Node Entries Table
NHOST - The number of defined hosts in the host array.
This field contains the number of host link records defined in the HOST
table below .This field is zero for a local node entry.
HOST - Host link information structure (array)
This array of structurescontains informationabout eachof the host links
for this node. It can hold information on up to four host links. Each
element of the array contains the fields for one host link as shown in
Table 3-6.
Table 3-6Host Link Information Structure
Field NameField DescriptionField TypeSize
linknameHost name or IP address for this linkchar [64]64
statsStatistics for this linkstruct16
flagsNode status and flagsuns.int4
spare3Reserved, not usedint4
(Bytes)
LINKNAME - The name of the remote system
This field contains the host name or the IP a ddress to be used in
accessing the remote node via TCP/IP. If a host name is specified, it must
be defined in the /etc/hosts file.
STATS - Statistics for this host link
This field is a data structure that contains some statistics on the data
traffic for this link. The layout of this structure is identical to that shown
above. T he data in this structure is maintained by the ZNODE daemon.
FLAGS - Host link status and flags
This bit-field data structure contains information on the status of a link.
It is identical to the flags structure documented above. However only the
status and valid b its are currently used. The status bit indicates whether
this link is currently up or not. If the link is down (status =0),the
ZNODE daemon will route remote requests on any secondary links that
areup.ThedatainthisstructureismaintainedbytheZNODEdaemon.
56Chapter3
ZCOM Tables and Data Structures
ZLU Tables
The ZCOM logical unit table relates a terminal device or a program
queue with a number or logical unit. The ZCOM logical units are called
ZLUs to distinguish them from the HP-UX logical units (LUs).
Each ZLU entry structure contains 40 bytes of data.
The ZLU table is split into two logically distinct parts. The first part is
the physical terminal area, and the second the dynamically assignable
program ZLUs. The latter are used for program input queues. The ZLUs
can be mapped so that a particular ZLU can point to any other ZLU.
Individual ZLU Entries
The individual ZLU data structure (zlu_type) layout is shown in Table
3-7.
Table 3-7Individual ZLU Data Structure (zlu_type)
ZLU Tables
Field NameField DescriptionField TypeSize
(Bytes)
zcksumZLU checksumuns.short2
zlttypeZLU typeuns.short2
zpointZLU pointer or mapped node nmbruns.short2
zmpzluMapped ZLU numberuns.short2
zmpzcsMapped ZLU checksumuns.short2
zlnameZLU Name (8 bytes)char [8]8
zownerPID number of owneruns.short2
ztimerTimeout interval (seconds)short2
zclockTimeout clockshort2
zlockZLU lock pointerpointer8
refcntLock reference countunns.int4
spare1Reserved, not usedint4
Chapter 357
ZCOM Tables and Data Structures
ZLU Tables
ZCKSUM -ZLUchecksum
The checksum is used as an integrity check to ensure that a ZLU has not
been altered while it is active. It is the 16-bit binary sum of bytes 3 to 18
of the ZLU entry (with any overflow discarded). It is calculated when the
ZLU table entry is created.
0ZLU is not defined
1ZLU is local terminal (ZPOINT is a logical terminal number *)
2ZLU is a local program (ZPOINT is a queue number)
3ZLU is mapped (ZPOINT is a mapped ZLU node number)
* The logical terminal number is allocated by TTGEN from the TTGEN
configuration file.
ZPOINT - ZLU pointer or mapped node number
The field is used to link the ZLU with the entity it represents. The
meaning of the field is given in the table under ZLTYPE.
ZMPZLU - Mapped ZLU number
If the ZLU is type 3 (mapped ZLU), then this is the ZLU number (on the
node as given by ZPOINT) onto which this ZLU is being mapped. If ZLU
is not type 3, ZMPZLU is set to zero.
ZMPZCS -MappedZLUchecksum
If the ZLU is not type 3, ZMPZCS is set to zero. Ot herwise, this contains
the checksum of the mapped ZLU.
ZLNAME -NameofZLU
Name assigned to the ZLU by the creator of the ZLU. If the ZLU is the
input queue to a program then this name is usually Z99999 - where
99999 is the program PID number. In this case the other 2 bytes are
space filled. The program ZLU name can b e assigned by the zopen call
when the ZLU is allocated. The ZLU name can be found using zinfo given
58Chapter3
ZCOM Tables and Data Structures
ZLU Tables
its node and ZLU number. The number of a ZLU can be found using
zname given its name and node.
ZOWNER -PIDnumberofowner
When the ZLU is created, the PID number of the creating program is
inserted in this field. When the program closes the ZLU, this field is
cleared. For system created ZLUs, this field is zero (e.g., terminal ZLUs
assigned by TTGEN).
ZTIMER, ZCLOCK - ZLU timeout control
These two parameters act together as a timer clock. The timer value
ZTIMER is set by an application program (via the time parameter in the
ztimr routine). This field is moved into ZCLOCK and decremented by 1
every second. When ZCLOCK reaches zero, a timer message is added to
the queue pointed to by the ZLU. ZCLOCK is then reset to ZTIMER and
the timer continues. If there are already 10 or more messages on the
queue, no timer message is queued. Timer processing stops when
ZTIMER and ZCLOCK are reset to zero via t h e ztimr routine (a zero time
parameter value).
ZLOCK -ZLUlockpointer
It is a pointer to a lock structure used within the kernel. The lock is used
to provide exclusive access to the ZLU in a multi-processor environment.
The locks are created one per ZLU by the ZCOM LDM driver during
ZCOM subsystem startup.
When the ZCOM subsystem processes an application request that refers
to a ZLU, it increment this count. On completion, the count is
decremented. On a zclos( ), the driver will wait until all active requests
are cleared before closing and releases a ZLU.
Chapter 359
ZCOM Tables and Data Structures
Logical Terminal Tables
Logical Terminal Tables
The Logical Terminal Table(LTT)pages contain the logical configuration
information for each terminal ZLU in the ZCOM system. Each terminal
table consists of the basic table (which is fixed for all terminals) and a
table extension (which is of configurable size specified by
LOGICAL-SIZE parameter in the TTGEN configuration file).
The basic table contains common information for all terminal ZLUs. It is
logically divided into two sections; an area reserved for use by the ZCOM
subsystem and a user area that may be manipulated by application
programs (via the zltup routine).
The table extension may be used to store any applicationdefined data
structure and can be manipulated by the application program that
allocates it (via the zltstore routine).
The layout of a Logical Terminal Table (zltt_type) basic table is shown in
Table 3-9 and Table 3-10. Note that the section reserved for use by the
ZCOM system is immediately followed by the user area.
Table 3-9Logical Terminal Table (Reserved Area)
Field NameField DescriptionField TypeSize
LTZLUOwning terminal ZLU numberuns.short2
LTZCSOwning terminal ZLU checksumuns.short2
LTMUXMUX i/f number for this terminaluns.short2
LT PORTPort number within Mux interfaceuns.char1
LTTERMTerminal number within portuns.char1
LTPTERMPointer to physical terminal tablepointer8
LTGZLKZLU of next terminal in groupuns.short2
LTDEVCDevice type of terminaluns.short2
LTTYPELogical type of terminaluns.short2
LTFLAGSystem status flagsuns.short2
LTZMXPZCOM address of multiplexing programstruct6
LTZPRCVRZCOM addr. of indirect primary receiverstruct6
SPARE1Reserved, not usedint4
60Chapter3
(Bytes)
ZCOM Tables and Data Structures
Logical Terminal Tables
Table 3-9Logical Terminal Table (Reserved Area)
Field NameField DescriptionField TypeSize
LTZSHRCVRSPointer to list of indirect shared receiverspointer8
LTHLDQSub-packet holding queue (0)struct56
LTHDQNData holding queues (1~4)struct [4]4*56
This is followed by LTUSER - the user maintainable area - which
consists of the fields shown in Table 3-10.
LTZLU - Terminal ZLU number
This is the ZLU number of the owning terminal.
LTZCS -OwningZLUchecksum
This is the ZLU checksum of the owning terminal.
LTMUX - Mux interface number for this terminal
This is the Mux interface number that this terminal is configured on.
LTPORT- Port number within the Mux card
This is a one byte field that indicates which port this terminal is
attached to within the Mux card.
LTTERM - Terminal number within port
This is a one byte field that indicates which terminal within a port this
terminal is configured on. This field has been replaced by the ltmxtm
field. This field continues to be valid for 2/8-channel MUX cards for
backwards compatibility reasons.
LTPTERM - Pointer to the physical terminal t able (zptt_type *)
It contains the memory address of the related physical terminal table.
This field is used as a linkage to find physical terminal information.
LTGZLK - ZLU of next terminal in group
Contains the circular linkage of ZLUs linked to the same physical
terminal. The linkage is to allow de-multiplexing of inbound messages.
For a normal 1:1 terminal, the entry will contain its own ZLU number.
Note that there is no checksum associated with this ZLU.
LTDEVC -Terminaldevicetype
Unique identification of the actual terminal connected to the system.
Two different terminals can have the same screen format and physical
protocol, but the device type may not necessarily be the same; it relates
to the symbolic device type specified in the TTGEN configuration file.
LTTYPE - Logical terminal type
The logical terminal type is used to describe the message format
expected from the terminal. For screen-type terminals this will identify
the terminal as belonging to a class of terminals with the same screen
formatting attributes and message delimiters (e.g., IBM.3278 or
NCR.501).
62Chapter3
LTFLAG - System status flags
Currently the system status flags are used to indicate whether the
outbound multiplexing and the inbound multiplexing are enabled.
Figure 3-2System Status flags
1510987654321011121314
OM IM
ZCOM Tables and Data Structures
Logical Terminal Tables
OM IM -
Both are set by TTGEN according to the device type specified. These
flags may be modified dynamically by use of the zltmx routine call.
LTZMXP - ZCOM address of multiplexing program
This field contains the node, ZLU number,and checksumof the outbound
multiplexing program. If the ZCOM_LTFLAG_OMX bit in ltflag is set,
the responsible multiplexing program should set up this field with its
primary ZLU (via the zset_rcvr routine, mode 2). All out-going messages
will then be queued to its primary ZLU.
LTZPRCVR - ZCOM address of primary indirect receiver
This field contains the node, ZLU number, and checksum of the program
to receive data messages from an inbound multiplexed terminal. If the
ZCOM_LTFLAG_IMX bit in ltflag is set, the system sets up this field on
a zset_rcvr (mode 0) call. All incoming messages will be received by the
inbound multiplexing program, which will then route the data to the
receiver specified in this field.
LTZSHRCVRS -Pointertoalinkedlistofindirectsharedreceivers
This field contains a pointer to a linked list of shared receivers that wish
to receive data messages from an inbound multiplexed terminal. Each
entry in the linked list represents one program. If t he
ZCOM_LTFLAG_IMX bit in ltflag is set, the system sets up this field on
a zset_rcvr (mode 0) call. All incoming messages will be received by the
inbound multiplexing program, which will then route the data to each of
the receivers specified in this linked list.
Outward bound multiplexing, ZCOM_LTFLAG_OMX bit
Inbound multiplexing, ZCOM_LTFLAG_IMX bit
Chapter 363
ZCOM Tables and Data Structures
Logical Terminal Tables
LTHLDQ - Sub-packet holding queue
This queue is a holding queue for partial messages to an inbound
multiplexed terminal.
LTDHQN - Data holding queues
For use by an application program to store temporary data for each
terminal. Only the queue header is stored in these fields, as the data
itself is stored in the ZCOM subsystem buffers.
LTUSER - User-maintainable area
The fields in the user-maintainable area may be modified by the zltup
call. The area consists of the following fields (up to the end of the
terminal table):
LTADDR - Logical terminal address
Holds the logical terminal addressing information needed to recognize
the correct logical terminal in a group of multiplexed terminals. This is a
10-byte field, however the multiplexing program may use these bytes
according to the specific requirements of the protocol.
LTSTAT -Logicalstatus
Contains the status of the logical terminal. This entry is maintained by a
multiplexing program and will remain unaltered for a normal 1:1
terminal.
Figure 3-3Logical Status Structure LTSTAT
1510987654321011121314
EN AC
EN AC UP -
LTCWCT, LTTXCT, LTRXCT, LTERCT - Message and error counters
Allow message counters for control writes, transmit data, receive data,
and error events to be maintained by the multiplexing application
program, for multiplexed logical terminals.
LTAPNO - System applicationnumber
This field is initialized by TTGEN based on the value specified in the
Term or Lterm statement in the TTGEN configuration file. This field is
not used by the ZCOM subsystem. It allows applications to recognize the
terminals which are assigned to it. Each ZCOM application which is a
direct receiver of terminal messages should access only those terminals
with its allocated application number.
LTINST, LTBRCH, LTWORK, LTAREA -TerminallogicalID
These logical terminal ID fields describe the owner and location of the
terminal at an application program level. At this level the physical
parameters are not relevant. Because these fields are at an application
level, their contents are largely dependent on the particular application.
LTNAME -Terminalname
This is a 30-byte ASCII description of the terminal. It is used by the
ZCOM utility programs as well as application programs. The field is
initialized from the desc parameter of the Term or Lterm statements in
the TTGEN configuration file.
The logical terminal table extension follows the basic table, and is used
exclusively by the application programs.The size of this area is specified
in the HLTDSZE field in the ZCOM header table (zheader_type).
Chapter 365
ZCOM Tables and Data Structures
Physical Terminal Tables
Physical Terminal Tables
The physical terminal table (zptt_type) contains information used by the
LDM and DAM to initialize and control a physical terminal (or other
device). The PTT consists of a system area, which is reserved for use by
the ZCOM subsystem, and a user area which may be manipulated by
application programs. The user modifiable portion of the PTT
immediately follows the reserved area. The layout of the PTT is shown in
Table 3-11 and Table 3-12.
Table 3-11Physical Terminal Tables (System Area)
Field NameField DescriptionField TypeSize (Bytes)
PTZLUOwning terminal ZLU numberuns.short2
PTZCSOwning terminal ZLU checksumuns.short2
PTMUXMUX number for this terminaluns.short2
PTPORTPort number within in terfaceuns.char1
PTTERMTerminal number within portuns.char1
PTMX_TERMTerminal number in carduns.short2
SUBCHSubchannel number on portuns.short2
PTZPRCVRZCOM address of primary receiverstruct6
PTZPCTL_RCVRZCOM address of primary control receiverstruct6
PTZSHRCVRSPointer to list of shared receiverspointer8
PTZSHCTLRCVRSPointer to list of shared control receiverspointer8
PTLISTPointer to next PTT of same portpointer8
PTTXLXPointer to next PTT on express listpointer8
PTTXQXExpress transmit buffer queuestruct56
PTTXLAPointer to next PTT on high priority listpointer8
PTTXQAHigh priority transmit buffer queuestruct56
PTTXLBPointer to next PTT on low priority listpointer8
PTTXQBLow priority transmit buffer queuestruct56
PTTXQCUnacknowledged transmit buffer queuestruct56
PENDG_TXREQNext request for $DATAstruct56
PTPZLKZLU of next PTT on t his portuns.short2
66Chapter3
ZCOM Tables and Data Structures
Physical Terminal Tables
Table 3-11Physical Terminal Tables (System Area)
Field NameField DescriptionField TypeSize (Bytes)
PTDRSTDriver terminal statusuns.short2
PTFWSTFirmware terminal statusuns.short2
PTTYPEPhysical type of terminaluns.short2
SCFG_LENLength of special configurationuns.short2
SPEC_CFGSpecial protocol configurationuns.char[6]6
Table 3-12Physical Terminal Tables (User Maintainable Area PTUSER)
The terminal ZLU number points back to the ZLU table entry for the
owner of the terminal. The ZLU contains the checksum for the ZLU as
well as its number. It is used by the driver to derive the source ZLU for
all messages received for this physical terminal. This parameter is
initially setup by TTGEN in the memory image file. These fields are
maintained by the ZCOM subsystem when ZLU and terminal linkage are
modified.
PTMUX - Mux number of t erminal
The Mux interface number of the terminal. This is set initially through
the TTGEN configuration file and is subsequently maintainable.
PTPORT - Terminal port number
The port number of the terminal on the Mux interface. This is set
initially through the TTGEN configuration file and is subsequently
maintainable.
PTTERM - Terminal number within port
The terminal number on the Mux interface card within the port. This is
set initially through the TTGEN configuration file and is subsequently
maintainable. This field has been replaced by the ptmx_term field. It
remains valid for 2/8-channel cards for backwards compatibility reasons.
PTMX_TERM - Terminal number within port or card
This field contains the firmware terminal number this terminal ZLU is
associated with. The firmware manages terminals using a terminal
number while the ZCOM subsystem manages terminals using ZLUs on
the host. On 2/8-channel cards, the t erminal number must be unique for
a given port. On E1/T1 cards, the terminal number is unique per card.
SUBCH - Subchannel number within port
This field contains the subchannel this terminal ZLU is configured on. If
the card does not support subchannels, this field is set to zero.
PTZPRCVR - ZCOM address of primary receiver
Node number, ZLU, and checksum used as the destination address for
normal messages and unsolicited status messages received for this
physical terminal. This field is set by the zset_rcvr call (mode 0 or mode 1
if multiplexed terminal).
68Chapter3
ZCOM Tables and Data Structures
Physical Terminal Tables
PTZPCTL_RCVR - ZCOM address of primary control receiver
This is the node number, ZLU, and checksum used as the destination
address for any control input messages received for this terminal. This
field is set by a zset_rcvr mode 3 call. The control input messages are
distinguishedby the protocol modules on the MUX, by setting bit 1 of the
input message tag byte.
PTZSHRCVRS -Pointertoalinkedlistofsharedreceivers
This field contains a pointer to a linked list of programs that wish to
receive normal messages and unsolicited status messages from this
physical terminal. Each entry in the linked list contains the node
number, ZLU, and checksum of the application which will be used as the
destination address for normal messages and unsolicited status
messages received from this physical terminal. This field is set by the
zset_rcvr call (mode 0 or mode 1 if multiplexed terminal). If there are no
shared receivers, this field will contain a zero. When a data or status
message arrives, it will be delivered to each application in the linked list
(as well any primary receiver).
PTZSHCTLRCVRS -Pointertoalinkedlistofsharedcontrolreceivers
This field contains a pointer to a linked list of programs that wish to
receive control messages from this physical terminal. Each entry in the
linked list contains the node number, ZLU, and checksum used as the
destination address for any control input messages received for this
terminal. This field is set by a zset_rcvr mode 3 call. The control input
messages are distinguished by the protocol modules on the MUX, by
setting bit 1 of the input message tag byte. If there are no shared control
receivers, this field will contain a zero. When a control message arrives,
it will be delivered to each application in the linked list (as well an any
primary control receiver).
PTLIST - Pointer to next PTT on the same port
Contains a pointer to the physical terminal table of the next terminal on
the same Mux interface card and port number as the current terminal.
These pointers form a circular list of terminals on the same port. Field
PTPZLK forms the same circular list, but contains the ZLU number.
Chapter 369
ZCOM Tables and Data Structures
Physical Terminal Tables
PTTXLX - Pointer to next PTT on the express list linkage
This linkage (containing the physical terminal table address) is used to
link together physical terminals on the M ux which have messages
queued on the express transmit queue. This field is NULL if the terminal
is not on the list. It is initialized to NULL by TTGEN and is maintained
by the LDM and DAM.
PTTXQX - Express transmit buffer queue
This queue contains the express transmit requests waiting to be sent. It
also contains the terminal configuration (zcntl)requests.Whena
message has been transferred to the card, the buffers are moved to the
unacknowledged transmit buffer queue. Once the buffer has been
acknowledged as sent or flushed by the card it is removed from the
unacknowledged queue and returned to the sending program (if
requested by the program).
The express transmit queue is designed for passing critical control
(protocoldependent) data to the terminal.In general,none of the normal
queue limit mechanisms apply to requests on this queue. Normal user
data should NEVER be placed on this queue. An example of appropriate
requests would be an X.25 Reset request or X.25 Expedited data.
Requests on this queue are always processed first, regardless of any
transmit limits that may have been reached.
PTTXLA - Pointer to next PTT on the high priority list linkage
This linkage (containing the physical terminal table address) is used to
link together physical terminals on the M ux which have messages
queued on their high priority transmit queue. This field is NULL if the
terminal is not on the list. It is initialized to NULL by TTGEN and is
maintained by the LDM and DAM.
PTTXQA - High priority transmit buffer queue
This queue contains the high priority transmit requests waiting to be
sent. It also contains the terminal configuration (zcntl)requests.The
data on this queue is processed only after all express transmit data has
been processed. When a message has been transferred t o the card, the
buffers are moved to the unacknowledged transmit buffer queue. Once
the buffer has been acknowledged as sent or flushed by the card it is
removed from the unacknowledged queue and returned to the sending
program (if requested by the program). Note that requests on this queue
are subject to the unacknowledged and port transmit limits.
70Chapter3
ZCOM Tables and Data Structures
Physical Terminal Tables
PTTXLB - Pointer to next PTT on low priority list linkage
AsforPTTXLAabove,exceptthatthelinkagepertainstothelow
priority transmit queue.
PTTXQB - Low priority transmit buffer queue
The low priority queue is operated in a similar manner to the high
priority queue. Data on this queue is processed only after all express and
high priority data has been processed. Note that requests on this queue
are subject to the unacknowledged and port transmit limits.
PTTXQC - Unacknowledged transmit buffer queue
This queue contains the buffers from PTTXQA/B after they have been
transferred to the interface card, and until they have been acknowledged
as sent (or aborted) by the Mux interface card.
PENDG_TXREQ - Next request of $DATA in unack’d transmit queue
This field is used internally by the ZCOM subsystem.
PTPZLK - ZLU of next PTT on this port
Contains the ZLU number of the next terminal which is on the same
Mux interface and port as this terminal. These ZLU numbers form a
circular list of terminals on the same port. Field PTLIST forms the same
circular list, but contains the physical terminal table memory address.
PTDRST -Terminalstatus
The terminal status is ma intained by the driver in t his field. The status
change requests from application programs are updated in this field
after they are successfully passed to the interface card. The driver uses
this value to reset the terminal status on the Mux interface after a
powerfail or reset.
The content of this field is as follows:
Figure 3-4Terminal Status Field PTDRST
1510987654321011121314
AV
EN AC
IN EN AC AV - Terminal is available for use
Chapter 371
UP
Terminal has been initialized (ZCOM_PTDRST_INT)
Terminal is enabled (ZCOM_PTDRST_ENB)
Terminal is active (ZCOM_PTDRST_ACT)
ZCOM Tables and Data Structures
Physical Terminal Tables
The IN bit indicates whether the terminal is considered as part of the
current configuration. It is initialized by TTGEN and maintained by the
driver. The EN and AC bits represent the current status of the terminal.
They are initialized by TTGEN and maintained by the driver. They are
reflected in the opposite sense by DS and IA on the interface card a nd in
PTFWST.
When the ZCOM subsystem starts up, the driver sets the AV bit if the
terminal is successfully initialized.
PTFWST - Firmware terminal status
This word contains the TMSTAT and TMSTT2 bytes from the Mux (via
$STDT buffer)
Figure 3-5Firmware terminal status PTFWST
1510987654321011121314
IA
DS SP
DS -
Terminal is disabled
SP -
Terminal is on slow poll list
Terminal is inactive (no poll)
IA GP - Terminal is group polled
DN - Terminal is down
DC - Terminal downcounter expired
GA - Group poll active
GM - Group poll master
GP DNGA GM
DC
The status in bits 7-0 is copied from the $STDT buffer. These bits
represent the field TMSTT2 from the interface terminal table.
PTTYPE -Terminaltype(physical)
Protocol module terminal type. It is initially setup by TTGEN in the
memory image file but is subsequently maintainable.
SCFG_LEN - Length of the special protocol configuration bytes.
This field contains the length of any protocol specific configuration data
contained in the spec_cfg[] field.
SPEC_CFG - Special protocol configuration data
This field contains any protocol specific configuration data that might be
needed. The details on its contents and how to configure this field is
documented in the protocol manuals.
72Chapter3
ZCOM Tables and Data Structures
Physical Terminal Tables
PTUSER - User-maintainable area
This area extends to the end of the physical terminal table.It defines the
area that may be modified by a zptup call, and contains all the following
fields:
These words usually contain the poll and select addresses specified for
the terminal in the TTGEN configuration file. For some protocols
however, t hey contain other configuration information. Specific content
for these words is documented in protocol accessory manuals.
PTOPTN - Protocol options
Used to define options to the protocol module on the Mux interface card.
Only bits 0 - 7 are relevant to the Mux. Bits 8 - 15 may contain other
(host level) options. The definition of the bits depends on the protocol
(PTTYPE) type.
PTVCNO - X.25 logical channel number
Used to contain status information - by x25cn & zx25d for X.25
terminals.
PTCNFG - Special configuration
For X.25, contains a call number.
PTCWCT - Terminal control write counter
This counter is incremented by the driver every time a control write
buffer for this terminal is transferred to the Mux interface card.
PTTXCT - Terminal transmit message counter
This counter is incremented by the driver every time a transmit buffer
for this terminal is transferred to the Mux interface card.
PTRXCT - Terminal receive message counter
This counter is incremented by the driver every time a receive message is
transferred from the Mux interface card for this terminal.
Chapter 373
ZCOM Tables and Data Structures
Physical Terminal Tables
PTERCT - Terminal error message counter
This counter is updated by the driver after each $STDT buffer has been
transferred from the Mux interface card. The $STDT buffer contains the
number of errors that have occurred for a terminal since the last $STDT
buffer was sent to the driver.
74Chapter3
ZCOM Tables and Data Structures
Interface Table
Interface Table
TheinterfacetableshowninTable3-13isastructurethathasone
instance for each Mux interface card defined in the TTGEN
configuration file. It is primarily used by the DAM for controlling the
backplane interaction with the Mux interface card. (zift_type)
Table 3-13Interface Table
Field NameField DescriptionField TypeSize (Bytes)
istimeTime of ZMON control of cardint4
bc1_addrLevel 1 Bus converter addressuns. char1
bc_addrBus converter address for this carduns.char1
card_addrCard address of this interfaceuns.short2
inhpaInterface HPA value from TTGENlong8
iftypeInterface card typeuns.short2
ifstatInterface card statusuns.short2
ischdlScheduler event flagsuns.short2
itcntrInterface terminal countuns.short2
ifrtryReset retry countuns.short2
irserrRestart error countuns.short2
ifstcnStatus update request countuns.short2
intfnoInterface card numberuns.short2
imaxportsMaximum # of ports per carduns.short2
imaxsubc_portMax. # of subchannels per portuns.short2
imaxsubc_cardMax. # of subchannels per carduns.short2
imaxtermsMax. # of terminals per carduns.short2
ifnameFirmware download file namechar [256]256
iffldtDownload file link timeuns.int4
iffnmnDownload file module namechar [12]12
ifrudtROM label: ROM update timeuns.int4
ifrmnmROM label: module namechar [12]12
ifrrevROM label: revision codechar [8]8
Chapter 375
ZCOM Tables and Data Structures
Interface Table
Table 3-13Interface Table
Field NameField DescriptionField TypeSize (Bytes)
ifwinfoFirmware run-time information worduns.short2
ifboffBuffer pointer adjusted offsetuns.short2
spare1Reserved, not usedint4
intfcqInterface control queuestruct56
ifdmaqDMA receive buffer queuestruct56
txcx_headExpress queue terminal listsPointer8
txca_headHigh-priority queue terminal listsPointer8
txcb_headLow-priority queue terminal listsPointer8
itxlstxExpress terminal list headersPointer8
itxlstaHigh priority terminal list headersPointer8
itxlstbLow priority terminal list headersPointer8
iplimitP ort unack TX limit (in bytes)Pointer8
ipbytesPort unack TX size (in bytes)Pointer8
ipstatPort status/Subchannel statusPointer8
ipcntrPointer to terminal count per portPointer8
iportnPointer to port configuration bytesPointer8
ifplookPTT lookup table pointerPointer8
ifcmdbpCurrent backplane command buffer pointerPointer8
ilockPointer to IFT lockPointer8
ihpapPointer to HPA entryPointer8
cardCard type specific informationUnion of:
bsp
mmp
In the following definitions of the different fields, there are references to
$PORT, $FIRQ and $STDT, transactions. For more information on these
transactions, refer to the backplane protocol descriptions.
76Chapter3
3616
18592
ZCOM Tables and Data Structures
Interface Table
ISTIME - Time of last ZMON restart/shutdown this card.
This field contains the time (seconds since the Epoch) when ZMON last
processed a restart or shutdown request for this card. It is used
internally by ZMON to detect and ignore multiple restart/shutdown
requests.
BC1_ADDR - First level bus converter address for this MUX interface
card
For HP9000 Series K systems the address is of the form bc1/bc/s. This
field refers to the first level bus converter address indicated as bc1. For
other systems this field is initialized to zero.
BC_ADDR - Bus converter address for this MUX interface card
This field contains the I/O bus converter address representing the I/O
bus that the MUX interface card is installed in. On systems that contain
only one I/O bus (S8x7, I30, H50, etc), this field is initialized to zero.
CARD_ADDR - Card address for this MUX interface card
This field contains the I/O card address representing the I/O slot number
that the MUX interface card is installed in. It is initialized by TTGEN
from the slot value specified in the MUX statement of the TTGEN
configuration file.
INHPA - Interface HPA value (from TTGEN)
The HPA value is built as follows:
Table 3-14Interface HPA Value INHPA
63-3231-2827-1817-1413-121110-65-21-0
All 1’s (111...)1111Bus
Address
For the Mux interfacein an HP-PB standard backplane,the card address
is 4 x slot number. In the TTGEN configuration file, the card address is
given as BUS:SLOT (e.g., 0:48), or BUS:BUS:SLOT. Here the 10-bit Bus
Address field is translated from the 1’s complement of BUS (i.e.,
1023-BUS). The Slot field is specified by SLOT/4. The Module, Page,
Register Set, and Reg No. fields are set to 0. For the example of
BUS:SLOT=0:48, the HPA is 0xFFFB0000. For EISA standard
backplanes the address is the slot number.
Chapter 377
SlotModulePageRegister
Set
Reg No.00
ZCOM Tables and Data Structures
Interface Table
IFTYPE - Interface card type
Specified in TTGEN through the interface definition (the keyword MUX)
This field allows for the future support of extra interface types.
IFSTAT - interface card status
This word indicates the current status of the Mux card. It is updated by
the driver. Bit 15 indicates whether the card is usable (when set) or not
(when cleared).
Table 3-15Interface Card Status IFSTAT
SymbolValue (hex)Meaning
ZCOM_IFSTAT_BOOT0x0000Driver and interface not initialized
ZCOM_IFSTAT_RST0x8001Being reset
ZCOM_IFSTAT_TMO0x8002Timed out
ZCOM_IFSTAT_PWF0x8003Power failed
ZCOM_IFSTAT_DWN0x0004Card down (due to serious error)
ZCOM_IFSTAT_ACT0x8005Up and active
ZCOM_IFSTAT_FWF0x8006Firmware failure
ZCOM_IFSTAT_OPR0x8007Operator reset
ZCOM_IFSTAT_DMI0x8008DMA interrupt error
ZCOM_IFSTAT_CDD0x8009Card dead, no activity
ZCOM_IFSTAT_NOC0x000ACard absent
ZCOM_IFSTAT_FER0x800BHardware fatal error
ZCOM_IFSTAT_DSB0x000CCard disabled
ZCOM_IFSTAT_INC0x000DCard startup incomplete
ZCOM_IFSTAT_SUSP0x000ECard being suspended (OLAR)
When the card status is down (i.e., ZCOM_IFSTAT_DWN),it can only be
resumed through a control request to the driver which will reset the
78Chapter3
driver and the interface card (via “zmon restart”).
ISCHDL - Scheduler event flags
The scheduler uses this word to store the event flags that control the
state of the backplane.
Figure 3-6Scheduler Event Flags ISCHDL
1510987654321011121314
NB
AC ST
AC -
Driver currently active
ST -
Card has sent status transfer request ($STDT)
Driver cannot get any free system buffers
NB PA - Pause after current event
ITCNTR - Interface terminal counter
The terminal counter is the actual number of terminals defined on this
Mux interface card.
PA
ZCOM Tables and Data Structures
Interface Table
IFRTRY - Reset retry count
This is used to count the number of times the Mux interface has been
reset due to a backplane timeout, or firmware failure. It is incremented
by ZMON each time the Mux card is reset by a request from the DAM. If
it reaches an unsatisfactory level, the Mux card will be disabled (set
down) by ZMON.
The driver will decrement the retry count if it is not zero after every 30
successful status $STDT replies (i.e., every 5 minutes). If an unstable
Mux interface fails and restarts too often, the ZCOM subsystem will
markitas“down”andstopusingit.
Chapter 379
ZCOM Tables and Data Structures
Interface Table
IRSERR - Restart error count
This field contains the count of the number of errors which occurred
during the last restart or enable. These errors are due to $PORT or
$TERM commands and will be separately reported to ZMON. This field
is kept for information purposes only.
IFSTCN - Status update request count
This counts the number of $STDT replies until IFRTRY will be
decremented.
INTFNO - Interface card number
This is the interface number that was specified in the Mux statement of
the TTGEN configuration file.
IMAXPORTS - M aximum number of ports on card.
This field contains the maximum number of ports supported by this
specific ACC interface card.
IMAXSUBC_PORT - Maximum number of subchannels per port.
This is the maximum number of subchannels supported on each port of
this ACC interface card. The minimum value of this field is 1 (e.g.
2/8-channel cards).
IMAXSUBC_CARD - Maximum number of subchannels on card.
This field contains the number of subchannels supported by this card.
For a non-E1/T1 card, this value should be the same as the imaxports
field.
IMAXTERMS - Maximum number of terminals allowed on card.
This field contains the maximum number of terminal ZLUs that may be
configured on this card.
IFNAME - Firmware download file name
This contains the full path name of the firmware file to be downloaded
into this Mux card whenever t he ZCOM subsystem is started, the Mux
card is reset, or is recovering from a powerfail or firmware failure. It is
initialized from the information supplied in the Mux statement of the
TTGEN configuration file. This field is a maximum of 256 bytes
including the null terminator byte.
80Chapter3
ZCOM Tables and Data Structures
Interface Table
IFFLDT, IFFMNM - Download file link time and module name
These two fields contain the time (since Epoch) when the download
firmware file is linked (by zlink program) and its module name. These
are set up by zlink and stored in the download file. When ZMON loads
the file to the Mux interface card, it extracts them from the file and puts
them into these two fields. The MX command in zmntr displays these
fields.
IFRUDT, IFRMNM, IFRREV - ROM update time, module name and
revision code
The ZCOM subsystem ROM contains its module name, revision code and
update time in byte locations 40~5D hex. ZMON reads these bytes from
theMuxinterfacecardwhenitloadsthefirmwarefile,andstoresthem
in these fields. The MX command in zmntr displays these fields. The time
is translated from the ROM ASCII time stamp and stored in Epoch
format.
IFWINFO - Firmware run-timeinformation word
This is a 16-bit field refreshed by the DAM once every 10 seconds with
the runtime information word from the Mux firmware. It contains the
average percentage activity of the Mux interface for the previous 10
seconds and the type code of the Mux front panel connected.
IFBOFF - B uffer pointer adjusted offset
Contained with the interface table are buffers that are used for DMA
transfers between the driver and the Mux card. These buffers are a
multipleof 64 bytes and must be aligned on a 64-byte address boundary.
This field contains the byte offset needed to cause the buffers to start on
a 64-byte boundary. TTGEN initializesthis field with the byte offset
value.
INTFCQ - Interface control queue (zqhd_type)
This queue contains pending port requests from application programs.
The operation of this queue is described in the section on the DAM. This
format of the queue header structure (zqhd_type)isdescribedlaterin
this chapter.
IFDMAQ - DMA receive buffer queue (zqhd_type)
Holds the current receive buffer during an $RXDT DMA transfer. This
format of the queue header structure (zqhd_type)isdescribedlaterin
this chapter.
Chapter 381
ZCOM Tables and Data Structures
Interface Table
TXCX_HEAD - Pointer to head of the express queue linked lists
TXCA_HEAD - Pointer to head of the high-priority queue linked lists
TXCB_HEAD - Pointer to head of the low-priority queue linked lists
ITXLSTX - Pointer to express terminal list array (in union)
ITXLSTA - Pointer to high-priority terminal list array (in union)
ITXLSTB - Pointer to low-priority terminal list array (in union)
IPLIMIT - Pointer to port/subchannel unack Tx limit array (in union)
IPBYTES - Pointer to port/subchannel unack Tx size array (in union)
IPSTAT - Pointer to port/subchannel status array (in union)
IPCNTR - Pointer to # of terminals per port/subchannel array (in union)
IPORTN - Pointer to port configuration array (in union)
IFPLOOK - Pointer to PTT interrupt vector array.
IFCMDBP - Pointer to current backplane command buffer (in union)
These fields are used internally by the ZCOM subsystem.
CARD - Interface card specific data structures (union)
This field is a union which contains two structures. These structures
hold information that are specific to the type of interface card associated
with this IFT entry. The structure card.mmp is used if the IFT is
associated with an 8-port PCI or E1/T1 interface card. Otherwise, the
card.bsp structure is used for 2/8-channel NIO and EISA interface cards.
CARD.MMP has the following fields shown in Table 3-16.
Table 3-16CARD.MMP Structure
Field NameField DescriptionField TypeSize
(Bytes)
itxlstxExpress terminal list headersstruct[128]128*40
itxlstaHigh priority terminal list headersstruct[128]128*40
itxlstbLow priority terminal list headersstruct[128]128*40
iplimitPort unack TX limit (in bytes)uns.int [128]128*4
ipbytesPort unack TX size (in bytes)int [128]128*4
ipendg_bufsTotal pending Tx size (in bufrs)int [128]128*4
82Chapter3
ZCOM Tables and Data Structures
Interface Table
Table 3-16CARD.MMP Structure
Field NameField DescriptionField TypeSize
(Bytes)
ipstatPort status/Subchannel statusuns.short [128]128*2
ipcntrTerminal count per portuns.short [128]128*2
iportnPort configuration bytess truct[4]4*4
isubch_bufSubchannel configurationstruct[4]4*256
ifcmdbufCurrent backplane command bufferuns.char [16]16
iscratchScratch area for buffer alignmentuns.char [64]64
icfg_lkuptCard configuration parametersstruct64
Chapter 383
ZCOM Tables and Data Structures
Interface Table
CARD.BSP has the following fields shown in Table 3-17.
Table 3-17CARD.BSP Structure
Field NameField DescriptionFieldTypeSize
(Bytes)
itxlstxExpress terminal lis t headersstruct[8]8*40
itxlstaHigh priority terminal list headersstruct[8]8*40
itxlstbLow priority terminal list headersstruct[8]8*40
iplimitPort unack TX limit (in bytes)uns.int [8]8*4
ipbytesPort unack TX size (in bytes)int [8]8*4
ipstatPort status/Subchannel statusuns.short [8]8*2
ipcntrTerminal count per portuns.short [8]8*2
iportnPort configuration bytesstruct[8]8*4
ifirqbp$FIRQ reply buffer pointerpointer8
irespbpBackplane response buffer pointerpointer8
istdtbp$STDT reply buffer pointerpointer8
ifpntrPointer to current PTTpointer8
ifcmdbufCurrent backplane command bufferuns.char [256]256
ifirqbufFIRQ response bufferuns.char [64]64
irespbufBackplane response bufferuns.char [64]64
istdtbufSTDT status bufferuns.char [2048]2048
iscratchScratch area f or buffer alignmentuns.char [64]64
The fields for both the card.mmp and card.bsp structures are described
below. In many cases, the field names in the two structures are the same
and in such cases, their function is identical. Only the number of
elements in the array is different. The itxlstx through iportn fields are
arrays indexed by the communication channel. For the 2/8-port ACC
cards (e.g. card.bsp), each element in the array represents a physical
port. For the 4-port E1/T1 ACC cards, these arrays are indexed by a
combination of port and subchannel. Specifically elements 0-31 represent
port 0 and subchannels 0 to 31; elements 32-63 represent port 1 and
subchannels 0 to 31, etc.
84Chapter3
ZCOM Tables and Data Structures
Interface Table
ITXLSTX - Express transmit list headers (zptl_type)
This field is an array of list headers for the express transmit requests
associated with each port or subchannel of the Mux card. Each list
header represents the head of a linked list of PTTs that have pending
express transmit requests waiting to be sent to the Mux card. The list
linkage is maintained through the PTTXLX pointer in each physical
terminal table. The express transmit requests themselves are linked to
the queue maintained by the PTTXQX field in each PTT. The structure of
the list header is shown below. There is one copy of this list header for
each port or subchannel on the Mux interface.
Table 3-18ITXLSTX Express Transmit List Headers
Field NameField DescriptionField TypeSize
nextlPointer to next active TX listpointer8
prevlPointer to previous active Tx listpointer8
tmcountNumber of terminals in the listuns.short2
subchnSubchannel number of this listuns.char1
spare1Reserved, unusedchar1
spare2Reserved, unusedint4
tmheadPointer to 1st terminal table in listpointer8
tmtailPointer to last terminal table in listpointer8
(Bytes)
ITXLSTA - High priority t ransmi t list headers (zptl_type)
This field is an array of list headers for the high priority transmit
requests associated with each port or subchannel of the Mux card. Each
list header represents the head of a linked list of PTTs that have pending
high priority transmit requests waiting to be sent to the Mux card. The
list headers in this array function identically to ITXLSTX only for the
high priority transmit requests.A terminal may be linked to ITXLSTX,
ITXLSTA and ITXLSTB all at the same time, if it has express, high, and
low priority transmit requests in progress.
ITXLSTB - Low priority transmit list headers (zptl_type)
The list headers in this array function identically to ITXLSTA only for
the low priority transmit requests. A terminal may be linked to
ITXLSTX, ITXLSTA and ITXLSTB all at the same time, if it has express,
high, and low priority transmit requests in progress.
Chapter 385
ZCOM Tables and Data Structures
Interface Table
IPLIMIT - Port unacknowledged transmit limit (in bytes)
This array contains the limit (in bytes) of all unacknowledged transmit
messages to terminals belonging to the same port or subchannel of this
interface. This array contains one element, one for each port or
subchannel of the Mux card. If the DAM issues a transmit request to the
Mux card and the Mux card does not have enough free buffers to hold the
request data, the Mux will reject the request with an “out of buffers”
error. The DAM will retry the request after an unacknowledged transmit
request completes. This field is used to minimize the number of retries
(and thereby increase overall performance) by imposing a limit on the
size of unacknowledged transmit requests. This array is initialized by
TTGEN from the default value hpiplim in the ZCOM header. This value
is configured through the Port-Limit or E1T1-Port-Limit parameter in
the TTGEN configuration file.
IPBYTES - Port unack TX size (in bytes)
This array is maintained by the DAM and keeps track of the number of
256-byte buffers currently in use by all unacknowledged transmit
messages to a port of this interfacecard. The ipbytes array contains one
element for each port/subchannel on the Mux card. The DAM compares
the iplimit value for a port with the ipbytes value times 256 t o determine
whether it should issue a transmit request immediately or wait until a
previously issued transmit request completes. The DAM uses this
method to predict when the Mux card will reject a request with an “out ofbuffers” error and can thereby avoid sending a request now which has a
high probability of needing to be retransmitted later.
IPENDG_BUFS - Total pending transmit size (in # of buffers)
This field is used internally by the ZCOM drivers.
86Chapter3
ZCOM Tables and Data Structures
Interface Table
IPSTAT - Port/Subchannel status
Dependingon the card type this interface table is for, this ipstat field
either contains the status of each subchannel in a 4-port E1/T1 ACC
card, or the status of each port in a non-4-port E1/T1 ACC card (e.g.,
2-port card or 8-port ACC card).
The individual ipstat bits are handled as follows:
ZCOM_IPSTAT_UND:
The undefined bit. Being undefined is synonymous with being not c onfigured.
For a non-4-port card, this bit in ipstat indicates whether a port is defined or
not.
For a 4-port card, this bit in ipstat indicates whether a subchannel is defined
or not. However, for defined/undefined status, we must also keep track of
whether ports are defined or not. So we will use another field, iportn, to
indicate whether the ports these subchannels are related to are defined or
not. If iportn[] is equal to -1, then the port is undefined. Note in the case of a
4-port card that if a port is marked as undefined, then all subchannels related
to that port are marked as undefined. If a port is marked as defined, a
subchannel may still be marked undefined until it is explicitly marked as
defined. So for a 4-port card we need a way to keep separate track of whether
ports and subchannels are defined or not.
ZCOM_IPSTAT_DWN:
The down bit. Indicates the status of ports.
For a non-4-port card, this bit in ipstat indicates whether a port is down or
not.
For a 4-port card, the down status for the subchannels related to a port as a
group are being used to indicate the down status of the port. For example, if a
port is consideredup, then all subchannels related to that port are marked as
up in ipstat. If a port is considered down, then all subchannels related to that
port are marked as down in ipstat. Individual subchannels related to that
port c annot be marked up or down independent of the other subchannels for
that port.
ZCOM_IPSTAT_DSB:
The disabled bit.
Fora non-4-port card, this bit in ipstat indicates whether a port is disabled or
not.
Fora 4-port card, this bit in ipstat indicates whether a subchannel is disabled
or not. Individual subchannels can be marked as disabled or enabled,
independent of each other. For a 4-port card, a request may be sent down to
the ZCOM software to enable or disable a “port”. This just means marking all
of the subchannels for that port as enabled or disabled. However, for 4-port
cards, the ZCOM software does not keep track of the enabled/disabled status
Chapter 387
ZCOM Tables and Data Structures
Interface Table
for ports. It only keeps track of the enabled/disabled status for subchannels
via ipstat.
ZCOM_IPSTAT_TXB:
The out-of-transmit buffers bit.
For a non-4-port card, indicates the status of ports.
For a 4-port card, indicates the status of subchannels.
ZCOM_IPSTAT_TXBX:
The out-of-transmit-buffers (XPS queue) bit.
For a non-4-port card, indicates the status of ports.
For a 4-port card, indicates the status of subchannels.
The DAM maintains the port status to determine the usability of a
port/subchannel.A port/subchannelis operating normally if the status value
is zero. If it is out of transmit buffers, no new transmit data transfer will be
initiated.If the port/subchannel is disabled, down or undefined, the DAM will
ignore all processing for this port.
IPCNTR - Terminal count per port/subchannel
This field contains the number of terminals defined on each
port/subchannel of this Mux interface card. It is initialized by TTGEN
based on the number of Term entries in the TTGEN configuration file
and is kept for informational purposes only.
88Chapter3
ZCOM Tables and Data Structures
Interface Table
IPORTN - Port configuration buffer (zpconf_type)
This array contains the configuration bytes for each port on the Mux
card. The Port statements in the Port-Definition section of the TTGEN
configuration file are used to define the initial values of this array. Each
element of the array is associated with a single port on the Mux card.
Each element can be dynamically configured by calling the zport routine.
The layout is similar to the data portion of the $PORT backplane
transaction command for the 2/8-channel ACC cards and is as shown in
Table 3-19.
Table 3-19Port C onfiguration Buffer IPORTN
31-3029-2827-2625-2423-2221-2019-1615-1413-0
ecodesyncmodeparityxclocksclockbaudpmodespare
The layout for the 4-channel E1/T1 ACC card is as follows:
Table 3-204-Channel E1/T1 ACC Card Format
31-3029-2626-2221-2019-1615-1110-0
ecodefmodesparesclocksparepmodespare
ecode-Encoding modes
sync-Sync mode select
mode-Operating mode
parity-Parity select
xclock-Clock multiplier
sclock-C lock source
baud-Baud rate value
pmode-Port mode select
fmode-Frame mode select
spare-Reserve, not used
Chapter 389
ZCOM Tables and Data Structures
Interface Table
ISUBCH_BUF - Portsubchannel configuration buffer (subchbuf_def)
This array contains the subchannel configuration bytes for each port on
the ACC E1/T1 4-port Mux card. The Subch statements in the
Subchannel-Definition section of the TTGEN configuration file are used
to define the initial values of this array. Each element of the array i s
associated with a single port on the Mux card. Each element can be
dynamically configured by calling the zconfig routine. The structure
layout is as shown in Table 3-21.
Table 3-21Port Su bchannel Configuration Structure
Each element of the timeslot array has the structure shown in
Table 3-22.
Table 3-22Timeslot Array Element Structure
31-302928-2423-1615-141312-87-0
spareTTITxSubchTxFillspareRTIRxSubchRxFill
TTI-Transmit Timeslot Inhibit
TxSubch-Transmit subchannel number
TxFill-Transmit fill mask
RTI-Receive Timeslot Inhibit
xclock-Clock multiplier
RxSubch-Receive subchannel number
RxFill-Receive fill mask
spare-Reserved, not used (must be 0)
90Chapter3
ZCOM Tables and Data Structures
Interface Table
Each element of the subchannel specification array has the following
structure:
Table 3-23Subchannel Specificat ion Array Element Structure
31-3029-2423-876-32-10
spareITBSspareINVsparemodespare
ITBS-IndividualTransmitBufferSize
INV-Inversion flag
mode-Transmission mode
spare-Reserved, not used (must be 0)
IFIRQBP, IRESPBP, ISTDTBP - DMA reply buffer pointers (char *)
These fields point to the corresponding buffers kept at the e nd of the
interface table that are used by the DAM for DMA operations. The actual
values of these pointers are initialized at ZCOM subsystem initialization
timebytheLDM.ThesepointersarechosenbytheLDMsothateach
buffer is 64-byte aligned. (The buffers must be aligned so that the DMA
may read/write directly to them). These fields are not used for ACC
E1/T1 cards.
IFPNTR - Pointer to active physical terminal table
This field contains the address of the currently active physical terminal
table entry within this interface table. This field is not used for ACC
E1/T1 cards It is maintained by the DAM.
IFCMDBUF - Current backplane command buffer
This field is the buffer area for DMA transfer of a backplane command to
theMuxinterfacecard.Theactualareabeingusedisoffsetbythe
number of bytes specified in IFBOFF. This area is accessed by the
pointer field IFCMDBP.
Chapter 391
ZCOM Tables and Data Structures
Interface Table
IFIRQBUF, IRESPBUF, ISTDTBUF - DMA response buffers
These are response buffers that are written to by DMA read requests to
theMuxinterfacecard.TheFIRQbuffercontainstheresultsofan
$FIRQ backplane transaction. The Response buffer contains the
response that provides the DAM with the completion status from the
Mux card firmware. The Status buffer contains the data returned from a
$STDT transaction. This data is updated into the physical terminal
tables by the DAM. The actual area being used is offset by the number of
bytes specified in IFBOFF. This area is accessed by the pointer set up in
the corresponding pointer fields IFIRQBP, IRESPBP, ISTDTBP. These
fields are not used for ACC E1/T1 cards.
ISCRATCH - Scratch area for buffer alignment
This area is needed to insure that DMA buffers can be aligned on a
64-byte boundary. This is a requirement of the hardware.
IFPLOOK -Physicalterminaltablelookup
This table is used by the DAM during FIRQ processing to determine the
physical terminal table address based on the port and terminal number
passed back from the Mux interface. It is indexed by the value [(port
number * 8) + terminal number] for the 2/8-channel NIO and EISA ACC
cards. For the ACC E1/T1 and 8-Port PCI cards, it is simply indexed by
the terminal number. The DAM uses this table as an interrupt vector to
the PTT associated with an unsolicited interrupt (FIRQ). This table is
variable in size and is dynamically allocated from HP-UX kernel
memory. U sual ly only a few of the v alues in the array are used. Unused
entries are null filled. The LDM creates and initializes this table during
startup of the ZCOM subsystem. This table is not accessible by user
space applications.
This field is an array of pointers, which will be accessed by an array
index.
92Chapter3
ZCOM Tables and Data Structures
Interface Table
ICFG_LKUPT - Optional E1/T1 tunable parameters (zcfg_lookup_t)
This structure contains the optional E1/T1 tunable parameters that
allow you to fine tune the allocation of resources (memory) within the
E1/T1 card. Specifically, these parameters allow you to fine tune how
card memory is divided up between internal tables and I/O buffers.
These parameters may be specified in the TTGEN Interface-Definition
section. This structure has the fields shown in Table 3-24.
Table 3-24Optional E1/T1 Tunable Parameters
Field NameField DescriptionField TypeSize
datadelay$DATA transfer delay (milliseconds)uns.short2
ttablenbrMaximum # of terminal table entriesuns.int2
ttablesizeSize of terminal table entries (in bytes)uns.int4
zbufsizeSize of the card’s buffers (in bytes)uns.int4
zbufnbrNumber of I/O buffersuns.int4
mheadnbrNumber of buffer header entriesuns.int4
mquota
bquota
tracesizeFirmware trace buffer sizeuns.int4
traceoptFirmware trace option bitsuns.int4
spare1~3Reserved, not useduns.int[3]4*3
tsizeSize of timer tables in bytesuns.int[4]4*4
Quota of msg headers allowed for each
subchannel
Quota of buffers allowed for each subchanneluns.int4
uns.int4
(Bytes)
Chapter 393
ZCOM Tables and Data Structures
Response Records
Response Records
Response records are used to k eep track of the i ssue-and-wait operations
in the ZCOM subsystem. Currently, it is used for the send-with-wait (for
example, z send mode 8), port configuration (zport and zconfig routines),
interface card control (zconfig), and remote API calls.
When a program requests a issue-and-wait operation, the LDM allocates
a spare response record from the pool, sets up the sleeping address, and
puts the caller to sleep. At a later time, when the operation is completed,
the driver (LDM or DAM) sets up the return status and wakes up the
waiter. The waiter then reads the return status and releases the
response record back to the p ool.
The layout of the response record (zrsp_type)isshownbelow.
RPADDR - Waiter sleeping address
The LDM puts an appropriate address into this field and puts the
application to sleep on this address. This field is zero when the record is
not being used. When this field is set, the remaining fields of the
structure will contain valid information.
94Chapter3
ZCOM Tables and Data Structures
Response Records
RPTYPE -Expectedresponsetype
This field contains the type of response the waiter is expecting. The LDM
setsuptheresponsetypewhenitinitializestherecord.Thisfieldis
validated when a response is returned. Currently, it may contain one of
the values Table 3-26.
A buffer completion response is returned when a local request (e.g. port
configuration) is completed. A remote completion response is returned
when a remote API request is processed in the remote system. An
interface request response is returned when ZCOM has completed an
interface control request.
RPNODE - Remote node
This contains the remote node number for a remote completion response.
It is initialized by the LDM before a remote request is sent, and is used
to validate the returned response.
RPSEQN - R equest/Response sequence number
For remote and interface requests, the LDM generates and stores a
request sequence number in this field. This number is used to validate
the returned response.
RPEXPT - Response expiration timeout value
This filed contains the expiration time (Coordinated Universal Time, in
seconds) of an outstanding request. The LDM generates a timeout
response if the current time exceeds this value. Currently, only the
remote completion response uses this field to trigger timeout processing.
RPCODE - Return status or error code
When a response is received, the response status or error code is
temporarily stored in this field. The value is then picked up by the
waiting process when it resumes execution.
Chapter 395
ZCOM Tables and Data Structures
Response Records
RPBUFQ - Response buffer queue
When a response carries data in addition to just a status or error code,
the data is stored in this queue temporarily. The data is retrieved by the
waiting process when it resumes execution. Currently, only remote
completion responses use this queue for data storage.
96Chapter3
Queue Hea der
The queue header area contains t he descriptor block for all the ZCOM
subsystem queues. The first queue is used to link the free buffers in the
buffer pool.
Free Queue Header (zfqh_type), queue 0, basically is the same as the
other buffer queues. However, its fields are viewed and used slightly
differently from the other queues. Its size is the same as a buffer queue.
ZCOM Tables and Data Structures
Queue Header
Table 3-27Free Queue Header (zfqh_type)
Field NameField DescriptionField TypeSize
QNMSGNumber of messages on queueuns.int4
QALLOCNumber o f allocated messagesuns.int4
QHEADPointer to first message on queuepointer8
QTAILPointer to last message on queuepointer8
QMMAXHistorical max number of messagesuns.int4
QTMSGTotal messages through queueuns.int4
QBYTESNumber of bytes on queueuns.int4
QWAITERNumber of waiters on th is queueuns.short2
QFLAGQueue flagsuns.short2
Chapter 397
(Bytes)
ZCOM Tables and Data Structures
Queue Header
Table 3-28Queue Header (zqhd_type)
Field NameField DescriptionField TypeSize
QNMSGNumber of messages on queueuns.int4
QLIMITMax messages/bytes allowed on queueuns.int4
QHEADPointer to first message on queuepointer8
QTAILPointer to last message on queuepointer8
QMMAXHistorical max number of messagesuns.int4
QTMSGTotal messages through queueuns .int4
QBYTESNumber of bytes on queueuns.int4
QWAITERNumber of waiters on this queueuns.short2
QFLAGQueue flagsuns.short2
QFDATAQueue function datauns.int4
SPARE1Reserved, not usedint4
QFUNCQueue functionpointer8
(Bytes)
QNMSG - Number on queue
Counter of the number of messages on the queue. When this is zero the
queue is empty.
QALLOC -Numberofallocatedmessages
This field is used in the free queue header to keep track of the number of
buffer segments allocated for ZCOM subsystem use. A value of zero
means that no buffers have been allocated for use by the ZCOM
subsystem. A large value indicates heavy usage of the buffer pool.
QLIMIT -Queuelimit
The maximum number of messages o r bytes that may be l inked to this
queue. If the ZCOM_QFLAG_BLT bit in qflag is not set, this field is a
limit on the number of messages. Otherwise, this value is a limit on the
number of bytes that can be linked to this queue. The default queue limit
is initialized from the Queue-Limit parameter in the TTGEN
configuration file when the queue is initialized. The queue limit may be
modifieddynamicallybycallingthezsetql routine.
98Chapter3
ZCOM Tables and Data Structures
Queue Header
QHEAD, QTAIL - Queue head and tail pointers (zbhd_type *)
These are pointers to the first and last messages attached to this queue.
If the queue is empty, these values are undefined. If the queue has only
one buffer, then the values are equal.
QMMAX - Number of messages on the queue
The largest number of outstanding messages ever linked to this q ueue at
any given point in time. This value is initialized to zero and is updated
any time QNMSG is larger than this field.
QTMSG - Total number of messages through this queue
Counter of all messages that have either passed through, or are still on,
this queue.
QBYTES - Number of bytes on the queue
The number of bytes on the queue is the actual number of bytes of all the
buffers (messages) linked to this queue. This includes the data length
and buffer header areas of each message in the queue. The sum of these
fields across all queues (including the free queue) at any instant will
equal the total amount of buffer space allocated in the ZCOM subsystem.
QWAITER - Number of processes waiting on this queue
This field is used to indicate whether any processes are waiting for data
from this queue. If a process reads from the queue and no data is
available, and it has not done a read without wait, the process is
suspended (put to sleep) by the LDM and this counter is incremented. At
a later time when a new message is added to this queue, the LDM or
DAM will wake up all processes suspended on this queue address and set
this field to zero.
Chapter 399
ZCOM Tables and Data Structures
Queue Header
QFLAG - Queue flags
This field contains some indicators which may affect the processing of a
queue. The format is shown in Table 3-29.
Table 3-29Queue Flags
15-876543210
COLSELFUNCBLTENB
SymbolValue (hex)Meaning
ZCOM_QFLAG_ENB0x0001Queue is enabled
ZCOM_QFLAG_BLT0x0002Queue limit on byte size
ZCOM_QFLAG_FUNC0x0004Queue uses wakeup function
ZCOM_QFLAG_SEL0x0008Queue has a failed “select”
ZCOM_QFLAG_COL0x0010Queue h as a “select” collision
When the FUNC bit is set, it indicates the kernel function kept in qfunc
is to be called whenever data is added to the queue. This feature may
only be used by kernel drivers (via the zsetkfunc routine).
The BLT bit is set if the queue limit check is performed on the number of
bytes rather than the number of messages. Currently, only the PTT
unacknowledged transmit queue uses it.
Queue manipulation is allowed only when the ENB bit is set. All queues
are set to disabled by TTGEN initially, and enabled by the zopen( ) call
(where a buffer queue is assigned to a ZLU). During ZCOM subsystem
shutdown, the LDM will disable the program queues by clearing this bit.
The SEL and COL bits are used internally for the “select-for-read”
function on program ZLUs. When a program ZLU has been “selected”
while it has no data, the LDM sets the SEL bit. If more than one
program selects this empty ZLU, the COL bit is set. When data arrives
for this ZLU the LDM uses these two bits to decide whether to wake up
one or multiple programs waiting on the “select” for this ZLU.
QFDATA - Queue function data
100Chapter3
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.