Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
ACC Programmer's Reference Guide > Chapter 4 ZCOM C I/F Library Routines

ZCONFIG (3X)

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

zconfig - ZCOM Dynamic System Configuration (DSC)

SYNOPSIS

#include   <zcom/zcomsys.h>
#include <zcom/zcomcall.h> /* If compliled with ANSI C (recommended) */

int32 zconfig (zap, mode, node, cdata, rdata)

zaddr_type *zap;
uint32 mode;
uint32 node;
zconfig_type *cdata;
zcfgret_type *rdata;

DESCRIPTION

Routine zconfig provides a general purpose mechanism for configuring a ZCOM system dynamically, i.e. altering some of the system tables or hardware settings while the system is running.

ATTENTION: The current release provides very limited user support for the functionality documented here. Specifically, the only supported functions are the Dynamic System Configuration (DSC) Control request to send a "Reconfiguration Complete" system event message and all of the Port Configuration actions.

The configuration modified by use of the zconfig routine is only effective while this instance of the ZCOM subsystem is running. The new configuration remains in force until changed by another call or until the ZCOM system is reinitialized. If the ZCOM subsystem is shutdown and restarted, the original configuration defined in the TTGEN configuration file is restored and all dynamic configuration changes are lost. Therefore, all permanent configuration information should be defined in the TTGEN configuration file.

This routine is intended for use by advanced user programs and should be used with care. Since this routine is used to dynamically modify the internal data structures used in the ZCOM subsystem, applications which use this functionality may need to be recompiled with new releases of the ACC base product.

The libraries libzcom_c.a and libpthread.a must be linked into the calling program by giving the options "-lzcom_c -lpthread" to cc(1) or ld(1)

Threads Considerations

This routine may be called from multi-threaded application using the POSIX (1003.1c) kernel threads API package. It has the following characteristics when called by multi-threaded application:

cancellation point

Thread cancellation can occur when a thread calls this routine

async-cancel unsafe

The calling thread's cancelability type must be PTHREAD_CANCEL_DEFERRED if cancellation is enabled.

async-signal unsafe

It cannot be called from a signal handler.

fork unsafe

It cannot be called by a child process after fork (2) but before exec (2).

PARAMETERS

zap

Pointer to source ZCOM address.

It is the ZCOM address identifying the originator of the configuration request and is usually set to the primary ZLU of the calling program. In this implementation, the originator must be from the local node, i.e. the "node" field of this address must be either zero or the local node number (except for the Port Configuration functions)

mode

Operating mode.

The mode parameter specifies whether to perform the configuration with or with-out wait. Allowed values are:

ZcDSC_IMMEDIATE(0) - Immediate configuration.

RS 4 The caller is suspended until the requested configuration is completed. The rdata parameter contains the returned response data.

ZcDSC_DEFERRED (1) - Deferred configuration.

RS 4 ZCONFIG initiates the configuration and returns. On completion, a response message is sent to the "saddr". This mode is not supported.

node

Destination node.

This is the node number of the remote (or local) ZCOM system where the configuration is to take place. If zero is specified, it is the local system. Note that the node parameter must specify the local system with this release (except for the Port Configuration functions)

cdata

Configuration data.

This points to a data structure containing all the information necessary for the configuration. See below for a description of this structure.

rdata
(Return Param)

Response data.

This points to a data structure containing the returned configuration response data. It is returned with valid data only when it is an immediate configuration (mode ZcDSC_IMMEDIATE) and zconfig returns with zero (i.e. no error). See the following for a description of this structure.

Configuration Data

The configuration data structure consists of a header and a "union" data portion for configuration information

/* Configuration Header */ 
typedef struct {
uint16 config; /* Type of configuration */
uint16 action; /* Configuration action */
uint16 tag1; /* Tag parameter 1 */
uint16 tag2; /* Tag parameter 2 */
} zcfghdr_type;

/* Configuration Data */
typedef struct {
zcfghdr_type header; /* Header Information */
union {
struct {
uint32 cfg_class; /* Class of Reconfig (1-999 Resvd) */
uint32 cfg_info1; /* Caller supplied information. */
} setctl; /* Request = DSC Control */
struct {
char sysname[80]; /* New ZCOM system name */
uint32 qlimit; /* Queue limit */
} setsys;
struct {
uint16 iftno; /* Interface card number */
uint8 bc1_addr; /* 1st level bus converter addr */
uint8 bc_addr; /* Bus converter addr of hardware */
uint16 card_addr; /* Card address of new hardware */
uint16 itype; /* Interface card type */
char fname[ZCOM_MAXFNAME]; /* Firmware filename */
} setcard; /* Request=Interface Configuration */
struct {
uint16 iftno; /* Interface card number */
uint8 bc1_addr; /* 1st level bus converter addr */
uint16 bc_addr; /* Bus converter addr of hardware */
uint16 card_addr; /* Card address of new hardware */
uint16 itype; /* Interface card type */
zcfg_lookup_t cfglt; /* Configuration lookup table info */
char fname[ZCOM_MAXFNAME]; /* Firmware filename */
} setcard_mmp; /* Request=Interface Configuration */
/* For Multi-msg BP protocol. */
struct {
uint16 iftno; /* Interface card number */
uint16 portno; /* Port number */
uint16 rcode; /* Request code */
uint16 spare; /* Reserved, not used */
zpconf_type cnfg; /* Port configuration word */
uint32 qlimit; /* Port tx limit */
} setport; /* Request = Port Configuration */
struct {
zaddr_type zaddr; /* Terminal ZLU */
zaddr_type daddr; /* Destination terminal ZLU */
uint16 iftno; /* Interface card number */
uint16 portno; /* Port number */
uint16 subchno; /* Subchannel number */
uint16 dtype; /* Terminal device type */
uint16 ltype; /* Logical terminal type */
zltt_type ltt; /* Logical terminal data */
zptt_type ptt; /* Physical terminal data */
} setterm; /* Request=Terminal Configuration */
struct {
uint16 iftno; /* Interface card number */
uint16 portno; /* Port number */
uint16 subchno; /* 1/4 Subchannel number */
uint16 rcode; /* Request code */
zptcfg_t *ptcfg; /* Ptr to port & subch config data */
uint32 len; /* Lgth (bytes) of ptcfg->ptinfo */
unit32 qlimit; /* Port transmit limit */
} setportsc; /* Request = Port Sub-Chan Config. */
} data;
} zconfig_type;

The header specifies the configuration. It is returned without change in the response data, and may be used by the caller to identify a configuration request.

Field header.config specifies the type of configuration. The interpretation of the header.action and data fields vary depending on the configuration type. Allowed values are:

ZCOM_ZCONFIG_CNTL

- DSC Control

ZCOM_ZCONFIG_SYS

- System Configuration

ZCOM_ZCONFIG_CARD

- Interface Configuration

ZCOM_ZCONFIG_PORT

- Port Configuration

ZCOM_ZCONFIG_TERM

- Terminal Configuration

ZCOM_ZCONFIG_PORTSC

- Port and Subchannel Configuration

Field header.action specifies what action is to be taken for the specified configuration type. Its meaning depends on header.config.

Fields header.tag1 and header.tag2 are tag parameters and will be returned without change in the response data.

The union field data contains information for the configuration request. The relevant sub-field to be used depends on header.config.

Refer to the individual configuration sections for more information on configuration data.

Response Data

The response data structure consists of the header fields and a "union" data portion for completion response:

/* Configuration Response */
typedef struct {
zcfghdr_type header; /* Header Information */
union {
struct {
int32 error; /* Return ZCOM error */
} ctlret; struct {
int32 error; /* Return ZCOM error */

} sysret;
struct {
uint32 iftno; /* Interface card number */
int32 error; /* Return ZCOM error */
} cardret;
struct {
uint32 iftno; /* Interface card number */
uint32 portno; /* Port number */
int32 status; /* Return status */
} portret;
struct {
zaddr_type zaddr; /* Terminal ZLU */
int32 error; /* Return ZCOM error */
} termret;
struct {
uint32 iftno; /* Interface card number */
uint32 portno; /* Port number */
uint32 subchno; /* Subchannel number */
int32 status; /* Return status */
} portscret;
} data;
} zcfgret_type;

The header is the same as in the configuration data. Its fields are returned without change for the caller to identify the response.

The union field data contains response data returned from the specified configuration. The relevant sub-field to be used depends on header.config.

Refer to the individual configuration sections for more information on response data.

TYPES OF CONFIGURATION FUNCTION

DSC Control

The DSC control function is to provide global control and status on the access of DSC functions. There are 3 DSC control actions.

Action ZcENABLE_DSC(1) is to enable the DSC access after it has been disabled. By default, the DSC access is enabled when ZCOM system is started up.

Action ZcDISABLE_DSC(2) is to disable DSC access. When disabled, local processes attempting DSC functions will be suspended. For DSC requests from remote system, ZCOM error -41 (ZEDSCLOCK, DSC function is disabled) is returned.

Action ZcDSC_SEND_RECFG(3) is used to broadcast a "Reconfiguration Complete" system event message to all interested programs and protocol drivers. This action should only be used after completing all zconfig() calls to dynamically reconfigure the ZCOM subsystem. Any process or protocol driver which has previously called the ZCOM zevent_rcvr() routine will be notified with a system event message. A dynamic reconfiguration complete event message returns an event type of ZCOM_SETYPE_RECONFIG.

Configuration Data

header.config

ZCOM_ZCONFIG_CNTL (DSC Control)

header.action

ZcENABLE_DSC

(1) - Enable DSC access

ZcDISABLE_DSC

(2) - Disable DSC access

ZcDSC_SEND_RECFG

(3) - Broadcast reconfiguration
complete system event message.

header.tag1,
header.tag2

Any values.

data.setctl.cfg_class

Caller supplied type of reconfiguration. There is one predefined configuration class, ZcCLASS_X25. This event should be generated whenever an X.25 link is dynamically configured. This includes modifying the number and/or type of Virtual Circuits and creating or deleting an X.25 level 2 (LAPB) ZLU.
If the ZCOM Subsystem is used with X25/9000 and x25init is executed, this event will be generated if the configuration for an X.25 link is modified. This field is used for action 3 only.

data.setctl.cfg_info1

Caller supplied information that should be specific to the type of reconfiguration which took place. In the case of ZcCLASS_X25, this field must contain the X.25 Level 2 ZLU of the link's configuration that was modified. Note that even if the ZLUs for a link were deleted from the configuration, the old Level 2 ZLU must still be supplied. A positive ZLU number indicates the link has been added, while a negative ZLU value indicates the link was deleted. This field is used for action 3 only.

Response Data

No specific response data or error.

System Configuration

There are 5 system configuration actions. They are for altering parameters related to the whole ZCOM runtime subsystem. Action 1 is for changing the ZCOM runtime system name. The system name is for information purposes only. This function does not affect the operation of the ZCOM subsystem.

Action 2-5 modify various default queue limits in the ZCOM subsystem. Such default limits only affect newly created queues. To modify limits on existing queues, use the zsetql(3X) routine instead.

Configuration Data

header.config

ZCOM_ZCONFIG_SYS (system configuration)

header.action

ZcDSC_MOD_SYS_NAME

(1) - Modify ZCOM runtime
system name.

ZcDSC_SET_PROG_QLIMIT

(2) - Set default program
queue limit.

ZcDSC_SET_TERM_XMIT_QLIMIT

(3) - Set default terminal
transmit queue limit.

ZcDSC_SET_TERM_UNACK_QLIMIT

(4) - Set default terminal
"unack" queue limit.

ZcDSC_SET_PORT_XMIT_LIMIT

(5) - Set default port transmit
limit.

header.tag1,
header.tag2

Any values.

data.setsys.sysname

New runtime ZCOM system name. This field is used for action 1 only.

data.setsys.qlimit

New default queue limit. This field is used for action 2 to 5 only. For program and terminal transmit queues, the limit is in number of messages. For the terminal "unack" queue and the port transmit limit, the limit is in bytes.

Response Data

data.sysret.error

This is the returned system configuration error: 0 - No error (successful)
!=0 - ZCOM error code

The error message text may be fetched using zcomerror(3X) with a non-zero error code.

Interface Configuration

There are 6 interface configuration actions. They are used to alter the parameters related to an interface card, and for controlling the operation of an interface card.

Action ZcDSC_CHNG_FW_FILE (1) modifies the firmware file name (used to download the MUX card). This change will have no effect until the interface card is restarted, causing the new firmware file to be used to download the card.

Action ZcDSC_CREATE_IFT (2) allocates the internal data structures required for a new interface card. That is, it creates a new Interface Table entry.

Action ZcDSC_START_CARD (3) starts up an interface. This initializes the hardware, the ports and terminals according to the configuration kept in the ZCOM tables. In functionality, it is identical to a zmon restart command.

Action ZcDSC_HALT_CARD (4) halts the hardware and stops new requests to the ACC interface card. All pending buffers and terminals linked to the interface remain unchanged. This function prepares an Interface Table entry for reassignment to different hardware (a new MUX interface card).

Action ZcDSC_STOP_CARD (5) stops an interface card as in action ZcDSC_HALT_CARD. In addition, all buffers linked to the interface and its terminals are released. Terminals are then set to unavailable. This function may be used to prepares an interface for re-linking to different hardware, or to eliminate all pending resources for a failed card. It is identical to a zmon shutdown command.

Action ZcDSC_REASSIGN_IFT (6) associates an interface table entry with a different MUX interface card. An interface must be halted or stopped (i.e. action ZcDSC_HALT_CARD or ZcDSC_STOP_CARD) before this request can be issued.

Configuration Data

header.config

ZCOM_ZCONFIG_CARD (interface configuration)

header.action

ZcDSC_CHNG_FW_FILE

(1) - Modify interface firmware file name

ZcDSC_CREATE_IFT

(2) - Create a new interface table

ZcDSC_START_CARD

(3) - Startup (e.g. restart) an interface card

ZcDSC_HALT_CARD

(4) - Disable an interface
ZcDSC_STOP_CARD

(5) - Shutdown (e.g. disable and flush) an interface card

DSC_REASSIGN_IFT

(6) - Link an interface to different hardware

header.tag1,
header.tag2

Any values

data.setcard.iftno

Interface card number (0, 1,...)

data.setcard.bc1_addr

data.setcard.bc_addr

data.setcard.card_addr

These are the bus converter address and card address (as specified in a TTGEN configuration file) of the new hardware. These fields are needed for action 2 and 6 only.

data.setcard.itype

Interface card type. This indicates the hardware type of the new interface card. Currently, the types ZCOM_ITYPE_MUX, ZCOM_ITYPE_Z7200A, ZCOM_ITYPE_Z7300A, ZCOM_ITYPE_Z7340A, ZCOM_ITYPE_Z7350A, and ZCOM_ITTYPE_Z7400AR are supported. This field is needed for action 2 only.

data.setcard.fname

New firmware file name. This field is used for action 1 only.

Response Data

data.cardret.iftno

This is the interface card number as in the configuration data. It indicates the interface table entry that was created or modified.

data.cardret.error

This is the returned interface configuration error:
0 - No error (successful)
< 0 - ZCOM error code
The error message text may be fetched using \fIzcomerror\fR(3X) with a non-zero error code.

Port Configuration

There are 8 port configuration actions. Actions ZcDSC_ALL_PARMS, ZcDSC_CFG_MODE, ZcDSC_BAUD_RATE, and ZcDSC_PORT_MODE configure the datacomm ports on the MUX interface card. All terminal ZLUs on the port being changed must be disabled before the port configuration takes place (use zcntl to disable a terminal ZLU using request code ZCOM_MRQCODE_DSB[8]). Examine the TTGEN configuration file to determine which ports are defined for which MUX interface cards and the terminals associated with each port.

Action ZcDSC_BREAK_REQ is used to activate the Port Break Routine of the protocol firmware. Since Port configuration by-passes the normal terminal transmit queues, this function is used as a software interrupt to the protocol specific firmware to initiate a recovery process when there is a protocol problem and the transmit queues are "blocked up". If the protocol for the specified port does not support this facility, error status 8 is returned.

Action ZcDSC_SET_XMIT_LIMIT changes the port transmit limit of a specific port on a MUX card. This limit controls the flow of requests from the host to the card for terminals on the related port.

Action ZcDSC_ENABLE_PORT enables a port after it has been disabled (action ZcDSC_DISABLE_PORT).

Action ZcDSC_DISABLE_PORT disables a port putting it into an inoperative state. All linked terminals are marked without actually sending a disable request to the interface card. This is to avoid a "hung" terminal disable request due to a hardware failure on a port. This action is designed to isolate a port that has failed from the ZCOM system. The ZCOM system will stop using the port and the terminals on the failed port may then be moved or deleted.

Configuration Data

header.config

ZCOM_ZCONFIG_PORT (port configuration)

header.action

ZcDSC_ALL_PARMS

(1) - Set all operating modes
(Configuration, Baud Rate and Port)

ZcDSC_CFG_MODE

(2) - Set Configuration mode only
(Ecode, Sync, Mode, Parity)

ZcDSC_BAUD_RATE

(3) - Set Baud Rate mode only
(X.Clk, S.Clk, Baud Rate)

ZcDSC_PORT_MODE

(4) - Set Port mode only (Pmode)

ZcDSC_BREAK_REQ

(5) - Port Break request

ZcDSC_SET_XMIT_LIMIT

(6) - Modify port transmit limit

ZcDSC_ENABLE_PORT

(7) - Enable a port

ZcDSC_DISABLE_PORT

(8) - Disable a port

header.tag1,
header.tag2

Any values.

data.setport.iftno

Interface card number (0, 1,...).

data.setport.portno

Port number in the interface card:
0..7 For Z7200A, Z7340A, and Z7400A ACC interface cards
0..3 For the Z7300A ACC interface card
0..1 For the Z7350A ACC interface card

data.setport.rcode

This field is for actions 1-4 only. Values are:
1 - Use configuration in interface table
2 - Use data in field \fIdata.setport.cnfg

data.setport.spare

Unused spare field. For data alignment.

data.setport.cnfg

Configuration data (32 bits). This field is used for actions 1 to 4 only. The content is dependent on the specific hardware being configured. It contains the following information:
For the Z7200A, Z7400A, Z7340A, Z7350A cards:

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

Ecode

Sync

Mode

Parity

X. Clk

S. Clk

Baud 1

Pmode

Pmode2

 

Baud 2

 

0 = Not Used

Ecode

Value

Encoding modes

0 0

NRZ

0 1

NRZI

1 0

FM1 (transition = 1)

1 1

FM0 (transition = 0)

Sync

Value

Sync mode select

0 0

8-Bit sync (monosync)

0 1

16-Bit sync (bisync)

1 0

SDLC Mode

1 1

External sync

   

Mode

Value

Operating mode

0 0

Sync mode

0 1

Async 1 stop

1 0

Async 1.5 stop bits

1 1

Async 2 stop bits

   

Parity

Value

Parity select

0 0

No Parity

0 1

Odd parity

1 0

No Parity

1 1

Even parity

   

X.Clk

Value

Clock multiplier

0 0

X 1

0 1

X 16

1 0

X 32

1 1

X 64

   

S.Clk

Value

Clock source

0 0

External clock

0 1

Internal clock from Baud Rate Generator (BRG)

1 0

X.21 clock source

1 1

DPPL output (must use BRG as source)

The baud rate is split between two 4-bit parameters (for compatibility reasons). If the Baud 1 parameter is 0, then Baud 2 is used. Rates listed in bold are not available on the Z7340A and Z7350A interface cards. Baud rates above 76800 are not supported on the Z7200A card and rates above 128000 are not supported for the Z7400A card.

Baud 1

Value

Rate

Value

Rate

 

0000

Use Baud2

1000

19,200

 

0001

300

1001

38,400

 

0010

600

1010

48,000

 

0011

1,200

1011

57,600

 

0100

2,400

1100

76,800

 

0101

4,800

1101

64,000

 

0110

9,600

1110

128,000

 

0111

14,400

1111

256,000

Baud 2

Value

Rate

Value

Rate

 

0000

150

1000

768,000

 

0001

56,000

1001

1,024,000

 

0010

153,600

1010

1,228,800

 

0011

307,200

1011

1,536,000

 

0100

192,000

1100

1,544,000

 

0101

614,400

1101

2,048,000

 

0110

384,000

1110

Reserved

 

0111

512,000

1111

Reserved

     

Pmode

Pmode2

Pmode

Value

Value

Port mode

0 0

0 0

RS232/V.24 Mode

0 1

0 0

RS422 Mode

1 0

0 0

Loopback Mode (Tristate)

1 1

0 0

X.21/V.11 Mode

0 0

0 1

V.35 (Z7340A and Z7350A only)

0 0

1 0

RS-449 (Z7340A and Z7350A only)

0 0

1 1

V.36 (Z7340A and Z7350A only)

All other values

Reserved

For the Z7300A (E1/T1) card:

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

Ecode

FMode

0

Fsync

S. Clk

0

TxAtt
 

Pmode

0QDCRNP 0LHCFJP 0

Ecode

Value

Encoding modes

0 0

HDB3- High Density Bipolar/3 zeros (E1)

0 1

B8ZS- Bipolar/8 Zero Substitution (T1)

1 0

AMI- (Not Supported)

1 1

Not defined

Fmode

Value

Frame mode parameter

0000

T1: F4 - 4-frame Multiframe

0001

T1: SF - 12-frame Multiframe

0010

T1: ESF - Extended Superframe

0011

T1: F72 - Remote Switch mode

0100

E1: DF - Doubleframe

0101

E1: MF - CRC Multiframe

0110

Transparent (voice) mode

Fsync

Value

Other port for clock synchronization

0 0

Port 0

0 1

Port 1

1 0

Port 2

1 1

Port 3

   

S.Clk

Value

Clock source

0 0

External clock (slave)

 

0 1

Internal clock (master) 

1 0

Clock from other port (specified in Fsync)

1 1

Undefined 

   

TxAtt

Value

T1 Transmit Attenuation (Z7330B only)

0 0

0 dB

0 1

-7.5 dB

1 0

-15 dB

1 1

-22.5 dB

Pmode

Value

Port mode

0000

Reserved

...

0100

Reserved

0101

E1 twisted pair DB9

120 ohm

 

0110

E1 coax BNC

75 ohm

0111

T1 twisted pair RJ45

100 ohm

1000

Loopback Mode (Tristate)

1001

E1 twisted pair RJ45

100 ohm

1010

T1 twisted pair DB9

120 ohm

1011

T1 coax BNC

75 ohm

1100

Reserved

...

1111

Reserved

QD

1 = On

Fast link-down option

Makes the line go down whenever loss of T1/E1 frame synchronization is detected by the FALC. Otherwise by default there is a delay to avoid marking the line down on glitches.

 

CR

1 = On

T1/ESF PRMs transmitted as "carrier"

T1/ESF PRMs transmitted as "carrier". The performance report messages transmitted in T1/ESF mode contain an address which indicates whether the ACC is a "network" or "user" device. By default the ACC is a "user" device.

 

NP

1 = On

T1/ESF performance report messages suppressed

This option suppresses the transmission of performance report messages in T1/ESF mode.

LH

1 = On

Long-haul mode (Z7330B only)

Enables the receive equalization and high power transmit line.

CF

1 = On

Reduced corner frequency (Z7330B only)

The corner frequency at which jitter attenuation begins, is reduced by a factor of ten by setting this option.

JP

1 = On

JT G.706 mode (Z7330B only)

In T1/ESF mode the CRC6 is calculated and the remote alarm processed according to JT G.706 (Japanese variation) by setting this option.

data.setport.qlimit

New port limit (in bytes). This field is for action ZcDSC_SET_XMIT_LIMIT only.

Response Data

data.portret.iftno
data.portret.portno

These are the interface and port numbers as supplied in the original configuration data (request). They indicate the interface and port whose configuration has been modified.

data.portret.status

Completion status returned from port configuration:

 

< 0 - Standard ZCOM error.

PT_OK

(0) - No error (successful).

PT_INV_PORT

(1) - Port number out of range.

PT_BAD_PARM

(2) - Bad parameter.

PT_NOT_DSBL

(3) - Some terminals on this port not disabled.

PT_BAD_BAUD

(4) - Bad baud rate.

PT_ILL_SCLK

(5) - Illegal clock source.

PT_ILL_PMODE

(6) - Illegal port mode.

PT_BAD_PORT

(7) - Port failed self test.

PT_NO_BREAK

(8) - BREAK routine not available.

PT_BAD_XCLK

(9) - Clock multiplier not compatible with configuration mode.

PT_NO_PLL

(10) - No DPLL available at this baud rate.

PT_TOO_FAST

(11) - Async mode not valid for baud > 38400.

The error or status message text may be fetched using zcomstatus (3X) with req = ZCOM_MRQCODE_PORT (or 14) and the return status. Note that status codes PT_BAD_BAUD, PT_ILL_SCLK, PT_ILL_PMODE, and PT_BAD_PORT imply the associated port is now inoperative. Another port configuration request must be performed to recover it.

Port Subchannel Configuration

The port subchannel configuration is only valid for the E1/T1 interface. There are 12 port configuration actions. Actions ZcDSC_ALL_PARMS, ZcDSC_CFG_MODE, ZcDSC_BAUD_RATE, ZcDSC_PORT_MODE, ZcDSC_SET_TIMESLOTS and ZcDSC_SET_SUBC_SPECS configure the datacomm ports and/or subchannels on the MUX E1/T1 interface card. For actions other than ZcDSC_SET_TIMESLOTS and ZcDSC_SET_SUBC_SPECS all terminal ZLUs on the port being changed must be disabled before the port configuration takes place (use zcntl to disable a terminal using request code ZCOM_MRQCODE_DSB[8]). For actions ZcDSC_SET_TIMESLOTS and ZcDSC_SET_SUBC_SPECS all terminal ZLUs on the subchannel(s) being changed must be disabled before the port configuration takes place. Note that, if a timeslot is being reconfigured to a new subchannel both the old and new subchannels must have no enabled terminals, for the reconfiguration to proceed. Examine the TTGEN configuration file or use zinfo() to determine which ports/subchannels are defined for which MUX interface cards and the terminal ZLUs associated with each port.

Action ZcDSC_BREAK_REQ is used to activate the Port Break Routine of the protocol firmware. Since Port configuration by-passes the normal terminal transmit queues, this function is used as a software interrupt to the protocol specific firmware to initiate a recovery process when there is a protocol problem and the transmit queues are "blocked up". If the protocol for the specified port does not support this facility, error status PT_NO_BREAK (8) is returned.

Action ZcDSC_SET_XMIT_LIMIT changes the port transmit limit of a specific port on a MUX card. This limit controls the processing of transmit requests for terminals on the related port.

Action ZcDSC_ENABLE_PORT enables a port after it has been disabled (action ZcDSC_DISABLE_PORT).

Action ZcDSC_DISABLE_PORT disables a port putting it into an inoperative state. All linked terminals are marked disabled without actually sending a disable request to the interface card. This is to avoid a "hung" terminal disable request due to a hardware failure on a port. This action is designed to isolate a port that has failed from the ZCOM system. The ZCOM system will stop using the port and the terminals on the failed port may then be moved or deleted.

Action ZcDSC_ENABLE_SUBC enables a subchannel after it has been disabled (action ZcDSC_DISABLE_SUBC).

Action ZcDSC_DISABLE_SUBC disables a subchannel putting it into an inoperative state. All linked terminal ZLUs are marked disabled without actually sending a disable request to the interface card. This is to avoid a "hung" terminal disable request due to a hardware failure on a subchannel. This action is designed to isolate a subchannel that has failed from the ZCOM system. The ZCOM system will stop using the subchannel and the terminals on the failed subchannel may then be moved or deleted.

Action ZcDSC_SET_TIMESLOTS is used to modify timeslot assignments. Individual timeslots can be configured, without affecting the operation of the remaining timeslots on the same port.

Action ZcDSC_SET_SUBC_SPECS is used to modify subchannel specifications. Individual subchannels can be configured, without affecting the operation of the remaining subchannels on the same port.

Configuration Data

header.config

ZCOM_ZCONFIG_PORTSC (port and subchannel configuration)

header.action

ZcDSC_ALL_PARMS

(1) - Set all operating modes (Configuration, Baud Rate and Port)

ZcDSC_CFG_MODE

(2) - Set Configuration mode only (Ecode, Sync, Mode, Parity)

ZcDSC_BAUD_RATE

(3) - Set Baud Rate mode only (S.Clk)

ZcDSC_PORT_MODE

(4) - Set Port mode only (Pmode)

ZcDSC_BREAK_REQ

(5) - Port Break request

ZcDSC_SET_XMIT_LIMIT

(6) - Modify port transmit limit

ZcDSC_ENABLE_PORT

(7) - Enable a port

ZcDSC_DISABLE_PORT

(8) - Disable a port

ZcDSC_ENABLE_SUBC

(9) - Enable a subchannel

ZcDSC_DISABLE_SUBC

(10) - Disable a subchannel

ZcDSC_SET_TIMESLOTS

(11) - Set timeslot assignment

ZcDSC_SET_SUBC_SPECS

(12) - Set subchannel specification

header.tag1,
header.tag2

Any values.

data.setportsc.iftno

Interface card number (0, 1,...).

data.setportsc.portno

Port number in E1/T1 interface card (0...3).

data.setportsc.subchno

Subchannel number within the port (0...31).

data.setportsc.rcode

This field is used for actions ZcDSC_ALL_PARMS, ZcDSC_CFG_MODE, ZcDSC_BAUD_RATE, ZcDSC_PORT_MODE, ZcDSC_SET_TIMESLOTS and ZcDSC_SET_SUBC_SPECS only. Values are:
1 - Use configuration in interface table
2 - Use data in field data.setportsc.ptcfg

data.setportsc.ptcfg

Pointer to the port and subchannel configuration data of which the data structure zptcfg_t is defined in /opt/acc/include/zcom/zcomsys.h.

data.setportsc.ptcfg->ptcnfg

Port configuration data (32 bits) which is used for actions ZcDSC_ALL_PARMS, ZcDSC_CFG_MODE, ZcDSC_BAUD_RATE and ZcDSC_PORT_MODE only. See the Port Configuration section for the format of the configuration data (data.setport.cnfg field).

data.setportsc.ptcfg->ptinfo.subchb.tmsl[ ]

Timeslot assignment array: used for actions ZcDSC_ALL_PARMS or ZcDSC_SET_TIMESLOTS only. Up to 32 timeslot assignments are allowed. Each element of the array is indexed by the timeslot number. That is, timeslot 0 is in tmsl[0], timeslot 1 is in tmsl[1], etc. For action ZcDSC_ALL_PARMS, all timeslots are configured. For action ZcDSC_SET_TIMESLOTS only timeslot entries with the UPD bit set are configured. The timeslot definition for each element in the array is shown below:

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

0

UPD

TTI

Transmit subch number

Transmit fill mask

Set to 0

RTI

Receive subch number

Receive fill mask

UPD: The Update bit is used with the ZcDSC_SET_TIMESLOTS action to identify timeslots which are to be configured. Timeslots with the UPD bit not set, are unaffected by the ZcDSC_SET_TIMESLOTS action.
Detailed descriptions of the TTI, RTI, Transmit and Receive subchannel numbers, and the Transmit or Receive fill masks, can be found in the Siemens MUNICH32 data sheet in Section 4.2.4 Time Slot Assignment.
A TTI (Transmit Timeslot Inhibit) bit value of '1' causes the transmit timeslot to be placed into tristate. The data is not destroyed but sent in the next non-tristated timeslot allocated to this subchannel.
A RTI (Receive Timeslot Inhibit) bit value of '1' causes all data received in this timeslot to be ignored. The subchannel does not process inbound data for this timeslot.
The Rxcv and Txmit subch nmber fields associate the specified subchannel number with the Transmit and Receive timeslot, respectively. That is, tmsl[3] is used to specify which subchannel(s) will be using timeslot 3 for transmitting and receiving data. Note that they normally are, but are not required to be the same subchannel number for receiving and transmitting.
The fill mask is used to indicate which bits of the transmit and receive timeslot holds data.

data.setportsc.ptcfg->ptinfo.subchb.spec[ ]

Subchannel specification data: used for actions ZcDSC_ALL_PARMS or ZcDSC_SET_SUBC_SPECS only. Up to 32 subchannel specifications are allowed. For action ZcDSC_ALL_PARMS, all subchannels are configured. For action ZcDSC_SET_SUBC_SPECS only subchannel entries with the UPD bit set are configured. The subchannel specification definition is shown below:

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

0

UPD

 

ITBS

 

Set to 0

 

Set to 0

 

0

INV

 

Set to 0

 

Mode

0

UPD: The Update bit is used with the ZcDSC_SET_SUBC_SPECS action to identify subchannels which are to be configured. Subchannels with the UPD bit not set, are unaffected by the ZcDSC_SET_SUBC_SPECS action.
ITBS: Individual Transmit Buffer Size specifies the part of the on-chip transmit buffer allocated to the subchannel. The buffer is 64 bytes long and each timeslot assigned to the subchannel uses two bytes. For example, in the case of a subchannel that uses three timeslots (3 x 64Kbps = 192Kbps), the ITBS value should be set to six (6).
INV: Inversion; if this bit is set, all data of the subchannel transmitted or received by the MUNICH32 is inverted.
Mode: Defines the transmission mode:
00 - Transparent Mode A
01 - Transparent Mode B or Transparent Mode R
10 - V.110/X.30 Mode
11 - HDLC Mode

data.setportsc.len

The length in bytes of the subchannel buffer. For actions ZcDSC_ALL_PARMS, ZcDSC_SET_TIMESLOTS and ZcDSC_SET_SUBC_SPECS this length parameter should be set to the size of the data.setportsc.ptcfg->ptinfo.subchb structure (e.g. "sizeof(subchbuf_def)"). For all other actions this length is zero.

data.setportsc.qlimit

New port limit (in bytes). This field is for action ZcDSC_SET_XMIT_LIMIT only.

Response Data

data.portscret.iftno,
data.portscret.portno,
data.portscret.subchno

These are the interface, port number and subchannel numbers as supplied in the original configuration data (request). They indicate the interface, port and subchannel whose configuration has been modified.

data.portscret.status

Completion status returned from port configuration:

< 0 - Standard ZCOM error PT_OK

PT_OK

(0) - No error (successful)

PT_INV_PORT

(1) - Port number out of range

PT_BAD_PARM

(2) - Bad parameter

PT_NOT_DSBL

(3) - Some terminals in this port not disabled

PT_BAD_BAUD

(4) - Bad baud rate

PT_ILL_SCLK

(5) - Illegal clock source

PT_ILL_PMODE(6) - Illegal port mode

PT_BAD_PORT

(7) - Port failed self test

PT_NO_BREAK

(8) - BREAK routine not available

PT_BAD_XCLK

(9) - Clock multiplier not compatible with configuration mode

PT_NO_PLL

(10) - No DPLL available at this baud rate

PT_TOO_FAST

(11) - Async mode not valid for baud > 38400

PT_NO_BUF

(12) - Subchannel buffer required

PT_SC_ENB

(13) - Subchannel must be disabled

PT_BAD_TS

(14) - Timeslot is not permitted

The error or status message text may be fetched using zcomstatus (3X) with req = ZCOM_MRQCODE_PORT (or 14) and the return status. Note that status codes PT_BAD_BAUD, PT_ILL_SCLK, PT_ILL_PMODE, and PT_BAD_PORT imply the associated port is now inoperative. Another port configuration request must be performed to recover it.

Terminal Configuration

There are 5 terminal configuration actions. They are for altering various internal linkages and terminal tables in the ZCOM runtime system memory.

Action ZcDSC_CREATE_LTT_PTT (1) creates a simple terminal that has one Logical Terminal Table (LTT) and one Physical Terminal Table (PTT).

NOTE: For this new ZCOM terminal, zconfig() allocates data structures in the kernel for ZCOM drivers to access. However, related data structures for this terminal must also be allocated on the target ACC card to complete the task. To allocate the related firmware data structures, use zcntl() with the ZCOM_MRQCODE_TERM rcode value (see the zcntl(3X) man page).

Action ZcDSC_CREATE_LTT_ON_PTT (2) creates and links an LTT to an existing terminal. The newly created LTT becomes an inbound multiplexing terminal and bit ZCOM_LTFLAG_IMX of field "ltaddr" is set automatically.

Action ZcDSC_CLEAR_TERM (3) clears a terminal for deletion. It flushes data buffers and removes the receivers of a terminal. It is usually used to prepare a terminal for deletion. Note that a terminal must be disabled before it can be cleared.

Action ZcDSC_DELETE_TERM (4) removes a terminal and releases its table space to the free pool. If a terminal has multiple LTTs linked to it, only the LTT is removed, the PTT is untouched. Otherwise, both the LTT and PTT are removed. If the PTT is to be removed, it must be disabled and have no pending or active I/O requests. Action ZcDSC_CLEAR_TERM is designed to "clear" a terminal for deletion.

Action ZcDSC_MOVE_TERM (5) is to re-link a terminal to a different port, on the same or different interface cards. After moving the terminal entry, the terminal must be re-configured, enabled and activated (i.e. ZCNTL request 6, 7 and 9) before it can be re-used. A terminal must be disabled and have no active I/O requests before it can be moved.

Configuration Data

header.config

ZCOM_ZCONFIG_TERM (terminal configuration)

header.action

ZcDSC_CREATE_LTT_PTT

(1) - Create a new terminal (LTT and PTT)

ZcDSC_CREATE_LTT_ON_PTT

(2) - Create a new LTT on an existing PTT

ZcDSC_CLEAR_TERM

(3) - Clear connection to an existing terminal

ZcDSC_DELETE_TERM

(4) - Delete an existing terminal

ZcDSC_MOVE_TERM

(5) - Move an existing terminal to another port

header.tag1,
header.tag2

Any values.

data.setterm.zaddr

ZLU of the related terminal. The "node" field is not used. For action 1 and 2, if ZLU is non-zero, it must be an unassigned one and ZLU checksum is not necessary. If ZLU is zero, the system chooses an arbitrary (unused) one. For actions ZcDSC_CLEAR_TERM, ZcDSC_DELETE_TERM, and ZcDSC_MOVE_TERM, the ZLU must be defined and the ZLU checksum must be valid.

data.setterm.daddr

ZLU of the destination terminal. It specifies the destination PTT to which the newly created terminal is linked. It must be a defined terminal and the checksum must be valid. The "node" field is not used. It is used for action ZcDSC_CREATE_LTT_ON_PTT only.

data.setterm.iftno

Interface card number (0, 1,...). It specifies to which interface card the new terminal is linked. This field is needed for actions ZcDSC_CREATE_LTT_PTT and ZcDSC_MOVE_TERM only.

data.setterm.portno

Port number in the interface card (0 to 7). It specifies to which port the new terminal is linked. This field is needed for actions ZcDSC_CREATE_LTT_PTT and ZcDSC_MOVE_TERM only.

data.setterm.subchno

Subchannel number on the port (0 to 31). It specifies the subchannel number the terminal will communicate over. Currently, only the Z7300A card supports subchannels. All other ACC interface card types must set this parameter to zero. This field is needed for actions ZcDSC_CREATE_LTT_PTT and ZcDSC_MOVE_TERM only.

data.setterm.dtype

Terminal device type. It is set up in the newly created terminal. This field is needed for actions ZcDSC_CREATE_LTT_PTT and ZcDSC_CREATE_LTT_ON_PTT only.

data.setterm.ltype

Logical terminal type. It is set up in the newly created terminal. This field is needed for actions ZcDSC_CREATE_LTT_PTT and ZcDSC_CREATE_LTT_ON_PTT only.

data.setterm.ltt

Logical terminal information. This contains the logical terminal information of the newly created terminal. Only the user maintainable fields (i.e. "ltaddr" and the following fields) are copied to the new logical terminal table. The other fields are ignored. This field is needed for actions ZcDSC_CREATE_LTT_PTT and ZcDSC_CREATE_LTT_ON_PTT only.

data.setterm.ptt

Physical terminal information. This contains the physical terminal information of the newly created terminal. Only the user maintainable fields (i.e. "ptpoll" and the following fields) are copied to the new physical terminal table. The other fields are ignored. In addition, the ptmx_term, subch, pendg_txreq, scfg_len, and spec_cfg fields are also ignored. This is used for action ZcDSC_CREATE_LTT_PTT only.

Response Data

data.termret.zaddr

This is the terminal ZLU which has been successfully created or modified. For actions ZcDSC_CREATE_LTT_PTT and ZcDSC_CREATE_LTT_ON_PTT, it is the newly created terminal ZLU with the correct checksum.

data.termret.error

This is the returned terminal configuration error:
0 - No error (successful)
< 0 - ZCOM error code
> 0 - zcntl() firmware status code

NOTES

  1. For port configuration, it is possible to change only one byte of the 32-bit configuration word, by using an appropriate value in action. In this case, the other bytes remain unaffected. Besides, actions 1-5 correspond to the functions supported by zport(3X), except that zport (3X) does not allow remote port configuration.

  2. The following is the zpconf_type data structure definition (from <zcom/zcomsys.h>) used in port configuration. This structure allows the cnfg data to be referenced by individual bit fields (zpconf_type.bits.<field>), by individual configuration bytes (zpconf_type.pconfig[<bytenum>]), or by its entire 32-bit value (zpconf_type.pcval).

    /*-- Port Configuration format --*/
    typedef union {
    struct {
    unsigned int ecode : 2; /* Encoding modes */
    unsigned int sync : 2; /* Sync mode select */
    unsigned int mode : 2; /* Operating mode */
    unsigned int parity : 2; /* Parity select */
    unsigned int xclock : 2; /* Clock multiplier */
    unsigned int sclock : 2; /* Clock source */
    unsigned int baud : 4; /* Baud rate value */
    unsigned int pmode : 2; /* Port mode select - original */

    unsigned int pmode2 : 2; /* Port mode select - extended */
    unsigned int baud2 : 4; /* Extended baud rate value */
    unsigned int spare : 8; /* Reserved, must be 0 */
    } bits;
    struct {
    unsigned int ecode : 2; /* Encoding modes */
    unsigned int frmode : 4; /* Framing mode */
    unsigned int set0_1 : 4; /* Reserved, must be 0 */
    unsigned int sclk : 2; /* Clock source */
    unsigned int set0_2 : 4; /* Reserved, must be 0 */
    unsigned int pmode : 4; /* Port mode */
    unsigned int set0_3 : 12; /* Reserved, must be 0 */
    } e1t1_bits;
    int32 pcval; /* Must be signed, -1 means bad config */
    uint8 pconfig[4]; /* 4 configuration bytes */ } zpconf_type;
  3. While clearing a terminal (Terminal Configuration action ZcDSC_CLEAR_TERM), the terminal unacknowledged transmit queue is also flushed. If the terminal has pending transactions to the interface card, it will cause write completion mismatch errors to be logged. It is not critical if caused by a terminal clear operation. The driver error messages complaining about write completion errors may be safely ignored.

RETURN VALUE

zconfig returns 0 if the configuration request is accepted. A non-zero ZCOM error is returned if there is a problem with the request. See /opt/acc/include/zcom/zcomsys.h for the list of ZCOM error codes and their meanings.

For immediate configuration requests, a zero return indicates the request is complete and rdata should be checked for any configuration problem. A non-zero return value means the request is rejected and no valid data is returned in rdata.

EXAMPLE

#include     <zcom/zcomsys.h>
#include <zcom/zcomcall.h>
int32 ierr;
zaddr_type zaddr;
uint32 node;
zconfig_type cdata;
zcfgret_type rdata;

cdata.header.config = ZCOM_ZCONFIG_PORT; cdata.header.action = ZcDSC_ALL_PARMS;
cdata.header.tag1 = 1; cdata.header.tag2 = 2; cdata.data.setport.iftno = 0;
cdata.data.setport.portno = 4; cdata.data.setport.rcode = 2;
cdata.data.setport.cnfg.pcval = 0x07178000;

if (ierr = \fBzconfig\fR (&zaddr, 0, node, &cdata, &rdata)) { /* error return code */ } else { /* good return code */ }

FILES

/opt/acc/include/zcom/zcomsys.h

ZCOM subsystem general include file, containing data types, data structures, constants, error codes, masks, etc. Note that this must be the first include file before any other ZCOM include files.

/opt/acc/include/zcom/zcomcall.h

ZCOM routine function prototypes (requires ANSI C compilation).

SEE ALSO

zsetql(3X), zcntl(3X).

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2000 Hewlett-Packard Development Company, L.P.