(Page 3 of 9 in this chapter) Version


Mtp2InitLinkCfg

Description

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

Prototype

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

board The TX board number on which the desired MTP 2 task resides. This value must be from 1 to MAXBOARD (currently 8).

pLinkCfg A pointer to the MTP2LinkCfg structure to be initialized.

linkNo The link number to assign to this data link. This value must be from 0 to the maximum number of links -1 (Depends on hardware configuration)

linkType The type of link. This is one of:

                               
                                       MTP2LNK_ANSI
                                       MTP2LNK_ANSI88
                                       MTP2LNK_CCITT

Return Values

Details

This function is provided as a quick way for an application to initialize an MTP2LinkCfg structure before calling Mtp2SetLinkCfg (see next section) to set the data link configuration parameters. This function sets the link number and link type as specified and initializes all other fields in the Mtp2SetLinkCfg structure to their defaults. Please refer to the MTP2LinkCfg structure below for more information about its fields and their default values.

The following structures are used for individual data link configuration in the MTP 2 task. Typically, a pointer to an MTP2LinkCfg structure is passed to Mtp2InitLinkCfg where default values are set. These defaults are specified below. If there is no default, either the field is unused or its value is passed as a parameter to Mtp2InitLinkCfg. In the latter case, the parameter name is specified below. After initialization, an application may override zero to all of these values and then pass the pointer to the Mtp2SetLinkCfg function, which actually sets the configuration.

Most of the default values provided by Mtp2InitLinkCfg will be adequate for most applications.

typedef struct _Mtp2SetLinkCfg
{
  MemoryId mem;         /* Reserved for internal use                   */
  S16      swtch;       /* protocol type                               */
  U8       priorDl;     /* Reserved for internal use                   */
  U8       routeDl;     /* Reserved for internal use                   */
  U8       selectorDl;  /* Reserved for internal use                   */
  U8       entMac;      /* Reserved for internal use                   */
  U8       instMac;     /* Reserved for internal use                   */
  U8       priorMac;    /* Reserved for internal use                   */
  U8       routeMac;    /* Reserved for internal use                   */
  U8       selectorMac; /* Reserved for internal use                   */
  MemoryId memMac;      /* Reserved for internal use                   */
  U8       maxOutsFrms; /* Reserved for internal use                   */
  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 congTmr;     /* congestion timer configuration structure    */
  U16      provEmrgcy;  /* emergency proving period                    */
  U16      provNormal;  /* normal proving period                       */
  U8       lssuLen;     /* one or two byte LSSU length                 */
  U8       align1;      /* alignment byte                              */
  U16      maxFrmLen;   /* max frame length for MSU                    */
  U8       cfmType;     /* Reserved for internal use                   */
  Bool     congDisc;    /* congestion discard TRUE or FALSE            */
  U16      sdD;         /* SUERM decrement rate                        */
  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          */
  S16     spIdSE;     /* Reserved for internal use                     */
  U16     dstProcId;  /* Reserved for internal use                     */

/* MTP level 1 parameters */

  S16     baud;         /* baud rate (4.8, 9.6, 19.2, 28.8, 
                         * 38.4, 56, 64)                               */
  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                              */
} MTP2LinkCfg;
Fields that do not appear in the following table are either unused or for internal use only. Those fields should not be modified by the user. Unless otherwise specified, the timer names correspond to the CCITT specification. Differences from the ANSI and/or CCITT specification are noted in parentheses in the description.
Field Name

Default

Range

Description

swtch

<linkType>
parameter

MTP2LNK_ANSI, MTP2LNK_ANSI88 or MTP2LNK_CCITT

Protocol type

maxOutsFrm

2

Maximum outstanding frames to layer MTP 1

errType

ERR_NRM

ERR_NRM or ERR_CYC

Normal or cyclical (for PCR, not fully supported) error checking

t1 (in tenths of a second)

130 (ANSI)
400 (ITU)

1 - 65535

t2 (in tenths of a second)

115 (ANSI)
100 (ITU)

1 - 65535

t3 (in tenths of a second)

115 (ANSI)
15 (ITU)

1 - 65535

t5 (in tenths of a second)

1

1 - 65535

t6 (in tenths of a second)

60

1 - 65535

t7 (in tenths of a second)

20

1 - 65535

congTmr (in tenths of a second)

1

1 - 65535

provNormal (in tenths of a second)

23 (ANSI)
82 (ITU)

1 - 65535

Normal proving period

provEmrgcy (in tenths of a second)

6 (ANSI)
5 (ITU)

1 - 65535

Emergency proving period

lssuLen

2

1 or 2

One or two byte LSSU length

maxFrmLen

272

64-1024

Max frame length for MSU

congDisc

FALSE

TRUE | FALSE

Congestion discard

sdT

64

1-255

SUERM error rate threshold

sdD

256

1-65535

SUERM decrement rate

sdTie

1

1-255

AERM emergency error rate threshold

sdTin

4

1-255

AERM normal error rate threshold

sdN1

30

1-255

Max # of MSUs for retransmission (when using PCR)

sdN2

220

1-65535

Max # of MSUs octets for retrans (when using PCR)

sdCp

5

1-255

Maximum # of proving failures

baud

BD_56000

BD_4800, BD_9600, BD_19200, BD_28800, BD_38400, BD_56000, BD_64000

Baud rate (4.8, 9.6, 19.2, 28.8, 38.4, 56, 64)

physIntType

INT_DTE

INT_DTE | INT_DCE

Physical interface type (DCE/DTE)

dataEncoding

DAT_NRZ

DAT_NRZ | DAT_NRZ1

Data encoding (NRZ/NRZI)

flgShare

FLAG_SHARE

FLAG_SHARE | NO_FLAG_SHARE

Share flags between frames

FlgIdle

FALSE

TRUE | FALSE

Use idles (True) or flags (False)

numFlg

0

0-15

Number of additional flag chars between frames



(Page 3 of 9 in this chapter) Version


tech_support@nmss.com
Copyright © 2000, Natural MicroSystems, Inc. All rights reserved.