ZCOM C I/F Library Routines

ZPORT (3X)

NOTES

1.

Notice that it is possible to change only one byte of the configuration

 

 

word by using an appropriate ‘action’ parameter value. In this case,

 

 

the other bytes remain unaffected. The new parameters remain in

 

 

force until changed by another call or until the ZCOM subsystem is

 

 

reinitialized. Normally, an application program should not be

 

 

required to change the port configuration.

 

2. To configure the timeslot and subchannel specification information

 

 

on the ACC E1/T1 card, use the zconfig() function.

 

3. The following is the zpconf_type data structure definition (from

 

 

<zcom/zcomsys.h>). This shows how the cnfg data can be referenced

 

 

by individual bit fields (zpconf_type.bits.<field>), by individual bytes

 

 

(zpconf_type.pconfig[<bytenum>]), or by its entire 32-bit value

 

 

(zpconf_type.pcval).

/*-- Port Configuration format --*/

typedef union {

 

 

 

 

struct {

/* Port config for all non-E1/T1 cards. */

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 {

/* E1/T1 port configuration (Z7300A) */

unsigned int ecode

: 2;

/* Encoding modes */

unsigned int frmode

: 4;

/* Framing mode */

unsigned int set0_1

: 4;

/* Unused */

unsigned int sclk

: 2;

/* Clock source */

unsigned int set0_2

: 4;

/* Unused */

unsigned int pmode

: 4;

/* Port Mode */

unsigned int set0_3

: 12; /* Unused */

} e1t1_bits;

 

 

 

 

int32 pcval;

 

/* Must be signed, -1 means bad config */

uint8 pconfig[4];

/* 4

configuration bytes */

} zpconf_type;

 

 

 

 

RETURN VALUE Routine zport returns 0 if successful. Otherwise, a non-zeroerror code is returned. See /opt/acc/include/zcom/zcomsys.h for the list of ZCOM error codes and their meanings.

284

Chapter 4