Mtp2InitLinkCfg

Initializes the provided data link configuration structure with default values and the specified link number and link type.

Prototype

MTP2_STATUS Mtp2InitLinkCfg (U8 board, MTP2LinkCfg *pLinkCfg, S16 linkNo, U8 linkType)

Argument

Description

board

TX board number on which the desired MTP 2 task resides.

pLinkCfg

Pointer to the MTP2LinkCfg structure to be initialized:

typedef struct _MTP2LinkCfg /* MTP level 2 data link SAP configuration   */
{
   MemoryId mem;            /* memory region and pool id                 */
   MemoryId memMac;         /* memory region and pool id for MAC         */
   S16      swtch;          /* protocol type                             */
   U8       priorDl;        /* priority for data link layer              */
   U8       routeDl;        /* route for data link layer                 */
   U8       selectorDl;     /* upper interface selector                  */
   U8       entMac;         /* entity for MAC                            */
   U8       instMac;        /* instance for MAC                          */
   U8       priorMac;       /* priority for MAC layer                    */
   U8       routeMac;       /* route for MAC layer                       */
   U8       selectorMac;    /* lower interface selector                  */
   U8       maxOutsFrms;    /* maximum outstanding frames                */
   Bool     errType;        /* cyclical or normal error checking         */
   TimerCfg t1;             /* timer 1 configuration structure           */
   TimerCfg t2;             /* timer 2 configuration structure           */
   TimerCfg t3;             /* timer 3 configuration structure           */
   TimerCfg t5;             /* timer 5 configuration structure           */
   TimerCfg t6;             /* timer 6 configuration structure           */
   TimerCfg t7;             /* timer 7 configuration structure           */
   TimerCfg t10;            /* timer 10 configuration structure          */
   TimerCfg t11;            /* timer 11 configuration structure          */
   TimerCfg t12;            /* timer 12 configuration structure          */
   TimerCfg t13;            /* timer 13 configuration structure          */
   TimerCfg congTmr;        /* congestion timer configuration structure  */
   U16      provEmrgcy;     /* emergency proving period                  */
   U16      provNormal;     /* normal proving period                     */
   U8       lssuLen;        /* one or two byte LSSU length               */
   U8       hsBits;         /* High speed link bits defined above        */
   U16      maxFrmLen;      /* max frame length for MSU                  */
   U8       cfmType;        /* when to send connect confirm              */
   Bool     congDisc;       /* congestion discard TRUE or FALSE          */
   U16      sdD;            /* Error count decrement rate <JMP>          */
   U8       sdT;            /* SUERM error rate threshold                */
   U8       sdTie;          /* AERM emergency error rate threshold       */
   U8       sdTin;          /* AERM normal error rate threshold          */
   U8       sdN1;           /* maximum number of MSUs for retransmission */
   U16      sdN2;           /* maximum number of MSU octets for retrans  */
   U8       sdCp;           /* maximum number of alignment attempts      */
   U8       align2;         /* alignment byte                            */
   S16      spIdSE;         /* service provider id                       */
   U16      dstProcId;      /* processor id                              */
   U16      isoThresh;      /* Number of packets to queue before sending */
                            /* SIPOs                                     */
   U16      txqThresh1;     /* Threshold level one on MTP2's Tx Queue    */
   U16      txqThresh1Abate;/* Abatement threshold for level two on      */
                            /* MTP2's Tx Queue                           */
   U16      txqThresh2;     /* Threshold level two on MTP2's Tx Queue    */
   U16      txqThresh2Abate;/* Abatement threshold for level two on      */
                            /* MTP2's Tx Queue                           */
   U16      sapThresh;      /* Threshold level on MTP2's upward bound    */
                            /* SAP queue                                 */
   U16      sapThreshAbate; /* Abatement threshold level for MTP2's      */
                            /* SAP Queue                                 */
   /* MTP level 1 parameters <JMP>                                       */
   S16      baud;           /* baud rate (4.8, 9.6, 19.2, 28.8, 38.4,    */
                            /* 56, 64)                                   */
   U8       portNum;        /* port number                               */
   U8       portType;       /* port type                                 */
   S16      physIntType;    /* Physical interface type (DCE/DTE)         */
   U8       dataEncoding;   /* Data encoding (NRZ/NRZI)                  */
   U8       flgShare;       /* Share flags ?                             */
   U8       flgIdle;        /* Use idles (True) or flags (False)         */
   U8       numFlg;         /* Number of additional flag chars           */
                            /* between frames                            */
   U32  idleFreq;           /* Transmit frequency of FISU's when done by */
                            /* software (in ms). Done at config          */
   U32  rtFreq;             /* Retransmit frequency of other SU's when   */
                            /* done by software (in ms). Done at transmit*/

} MTP2LinkCfg;

See the Details section for field descriptions.

linkNo

Link number to assign to this data link. Valid range is 0 through the maximum number of links minus 1, depending on hardware configuration and whether high speed links are defined.

linkType

Type of link. Valid values are:

MTP2LNK_ANSI

MTP2LNK_ANSI88

MTP2LNK_CCITT


Return values

Return value

Description

MTP2_SUCCESS

 

MTP2_LNKTYPE

Invalid link type.


Details

This function enables an application to initialize an MTP2LinkCfg structure before calling Mtp2SetLinkCfg to set the data link configuration parameters. Mtp2InitLinkCfg sets the link number and link type as specified and initializes all other fields in the Mtp2SetLinkCfg structure to their defaults.

A pointer to an MTP2LinkCfg structure is passed to Mtp2InitLinkCfg where default values are set. After initialization, an application can override zero to all of these values and then pass the pointer to Mtp2SetLinkCfg, which sets the configuration. The default values provided by Mtp2InitLinkCfg are adequate for most applications.

The following table lists the MTP2LinkCfg fields that can be modified. Unless otherwise specified, the timer names correspond to the CCITT specification.

Note: All timer values are specified in tenths of a second.

Field

Description

swtch

Protocol type. Default is the linkType parameter. Valid values:

MTP2LNK_ANSI

MTP2LNK_ANSI88

MTP2LNK_CCITT

maxOutsFrm

Maximum outstanding frames to layer MTP 1. NMS recommends leaving the default at 2.

errType

Normal or cyclical (for PCR) error checking. Valid values:

ERR_NRM (default)

ERR_CYC

t1

Timer aligned and ready. Valid range is 1 through 65535. Default is 130 (ANSI) and 400 (ITU).

t2

Timer not aligned. Valid range is 1 through 65535. Default is 115 (ANSI) and 100 (ITU).

t3

Timer aligned. Valid range is 1 through 65535. Default is 115 (ANSI) and 15 (ITU).

t5

Timer sending SIBs (busy indications). Valid range is 1 through 65535. Default is 1.

t6

Timer remote congestion. Valid range is 1 through 65535. Default is 60.

t7

Timer excessive delay of acknowledgement. Valid range is 1 through 65535. Default is 20.

t10

Amount of time MTP 2 can be isolated from a remote MTP 3 before SIPO (sending processor outage). Valid range is 1 through 65535. Default is 30.

t11

Time to wait for a flow control acknowledgement from MTP 3 before sending another flow control indication. Valid range is 1 through 65535. Default is 20.

t12

Time to wait for a status confirmation from MTP 3 before sending another status indication. Valid range is 1 through 65535. Default is 20.

t13

Time to wait for a disconnect confirmation from MTP 3 before sending another disconnect indication. Valid range is 1 through 65535. Default is 20.

provNormal

Normal proving period. Valid range is 1 through 65535. Default is 23 (ANSI) and 82 (ITU).

provEmrgcy

Emergency proving period. Valid range is 1 through 65535. Default is 6 (ANSI) and 5 (ITU).

lssuLen

One or two byte LSSU length. Valid values:

1

2 (default)

hsBits

High speed link bits valid values:

Bit

Value

Description

HS_LINK

0x01

High speed link is in effect.

HS_EXT_SEQ

0x02

Extended sequence numbers are in effect.


The following table describes these high speed link bits:

HSL bit

Description

HS_LINK

Setting this bit to TRUE, notifies MTP that high speed links are in effect and automatically sets HS_EXT_SEQ to TRUE.

Set HS_EXT_SEQ to FALSE for high speed links with normal sequence numbers.

HS_EXT_SEQ

Setting this bit to TRUE, notifies MTP that extended sequence numbers are in effect and changes the size of:

  • FSN, BSN, and LI fields in MTP 2 packets

  • The last FSN field of COO and COA messages at layer 3

Sequence numbers increase from 7 to 12 bits and the length indicator increases from 6 to 8 bits.

Setting HS_EXT_SEQ to TRUE automatically sets HS_LINK to TRUE. Normal speed links with extended sequence numbers are not supported.


A combination of high and normal speed links is not supported.

maxFrmLen

Maximum frame length for MSU. Valid range is 64 through 1024. NMS recommends leaving the default at 272.

congDisc

Congestion discard. Valid values:

TRUE

FALSE (default)

sdT

SUERM error rate threshold. Valid range is 1 through 255. Default is 64.

sdD

SUERM decrement rate. Valid range is 1 through 65535. Default is 256.

sdTie

AERM emergency error rate threshold. Valid range is 1 (default) through 255.

sdTin

AERM normal error rate threshold. Valid range is 1 through 255. Default is 4.

sdN1

Maximum number of MSUs for retransmission (when using PCR). Valid range is 1 through 255. Default is 30.

sdN2

Maximum number of MSUs octets for retransmission (when using PCR). Valid range is 1 through 65535. Default is 220.

sdCp

Maximum number of proving failures. Valid range is 1 through 255. Default is 5.

baud

Baud rate. Valid values:

BD_4800

BD_9600

BD_19200

BD_28800

BD_38400

BD_48000

BD_56000 (default)

BD_64000

physIntType

Physical interface type (DCE/DTE) with or without modem signal detection. Modem signal usage is the only way to assure detection of connection loss and re-establishment. Valid values:

INT_DTE (default)

INT_DCE

INT_DTE_MODEM

INT_DCE_MODEM

 

Note: Modem signal detection requires an additional pod jumper on the DCE side connecting DSR and CD.

dataEncoding

Data encoding (NRZ/NRZI). Valid values:

DAT_NRZ (default)

DAT_NRZ1

flgShare

Share flags between frames. Valid values:

FLAG_SHARE (default)

NO_FLAG_SHARE

FlgIdle

Use idles (TRUE) or flags (FALSE). Default is FALSE.

numFlg

Number of additional flag characters between frames. Valid range is 0 (default) through 15.

isoThresh

Number of messages queued to MTP 3 while isolated that causes MTP 2 to begin SIPOs (processor outages). Valid range is 1 through 65535. Default is 1000.

txqThresh1

Transmission queue length at which the outbound flow control level is raised to one. Valid range is 1 through 65535. Default is 50.

txqThresh1Abate

Transmission queue length at which the outbound flow control level is lowered to zero. Valid range is 1 through 65535. Default is 20.

txqThresh2

Transmission queue length at which the outbound flow control level is raised to two. The subsequent indication causes MTP 3 to cease all transmission to MTP 2 until the flow control level returns to one or zero. Valid range is 1 through 65535. Default is 200.

txqThresh2Abate

Transmission queue length at which the outbound flow control level is lowered to one. Valid range is 1 through 65535. Default is 100.

sapThresh

Number of messages queued to MTP 3 while inbound flow control is in effect that causes MTP 2 to send SIBs (busy indications). Valid range is 1 through 65535. Default is 500.

sapThreshAbate

Number of messages queued to MTP 3 while inbound flow control is in effect that causes MTP 2 to stop sending SIBs (busy indications). Valid range is 1 through 65535. Default is 100.

idleFreq

Frequency at which FISUs are sent by the software (in ms). 0 (default) indicates that hardware constantly retransmits duplicate FISUs.

Non-zero frequencies can be used by switches that process all FISUs (including duplicate FISUs) in the software. Valid range is 1 through 65535.

rtFreq

Frequency at which other retransmitted SUs (LSSUs) are sent by the software (in ms). 0 (default) indicates that hardware constantly retransmits duplicate LSSUs.

Non zero frequencies can be used by switches that process all LSSUs (including duplicate LSSUs) in the software. Valid range is 1 through 65535.


See also

Mtp2SetLinkCfg