Mtp3InitLinkCfg

Initializes the provided data link configuration structure MTP3LinkCfg with default values and link number, link type, and destination point code.

Prototype

MTP3_STATUS Mtp3InitLinkCfg ( U8 board, MTP3LinkCfg *pLinkCfg, S16 linkNo, U8 linkType, U32 dpc)

Argument

Description

board

TX board number on which the desired MTP 3 task resides. Valid range is 1 through maxboard (currently 8).

pLinkCfg

Pointer to the MTP3LinkCfg structure to be initialized:

typedef struct _MTP3LinkCfg
{
  U16 lnkSetId;           /* Link set ID                                */
  U16 lnkId;              /* Signalling link identity                   */
  U32 opc;                /* Originating point code                     */
  U32 adjDpc;             /* Adjacent Destination Point Code            */
  U8  lnkPrior;           /* Link priority within the link set          */
  U8  usePrior;           /* Use message priority, or force zero for    */
                          /*  all priorities                            */
  U16 msgSize;            /* Maximum message length                     */
  U8  msgPrior;           /* Management message priority                */
  U8  lnkType;            /* Link type ANSI or CCITT                    */
  U8  maxSLTtry;          /* Maximum times to retry SLTM                */
  U8  hsbit;              /* Alignment formerly spare1                  */
  S16 p0QLen;             /* Size of the priority 0 Q                   */
  S16 p1QLen;             /* Size of the priority 1 Q                   */
  S16 p2QLen;             /* Size of the priority 2 Q                   */
  S16 p3QLen;             /* Size of the priority 3 Q                   */
  U8  discPrior;          /* Discard priority                           */
  U8  ssf;                /* Sub service field                          */
  U8  lnkTstSLC;          /* Link selection code for link test          */
  U8  tstLen;             /* Link test pattern length                   */
  U8  tst[MTP3LNKTSTMAX]; /* Link test pattern                          */
  MTP3LinkTimerCfg tmr;   /* Timer configuration                        */
  U16 dstProcId;          /* Destination processor id                   */
  U8  dstEnt;             /* Entity                                     */
  U8  dstInst;            /* Instance                                   */
  U8  prior;              /* Priority                                   */
  U8  route;              /* Route                                      */
  U8  selector;           /* Lower layer selector                       */
  U8  spare2;             /* Alignment                                  */
  MemoryId mem;           /* Memory region and pool id                  */
  U8  dpcLen;             /* dpc or opc length                          */
  U8  lnkIndex;           /* Index into link array.  0 to n-1 in order  */
                          /*  defined in config                         */
  S16 spId;               /* Service provider id                        */
  U8 dis;                 /* Initial link state (enabled/disabled) JMK  */
  U8 portType;            /* Port type - T1/E1 or Serial - TEK          */
  U8 traceData;           /* Trace data flag                            */
  U8 spare3;              /* End structure on even 4-byte boundardy     */
} MTP3LinkCfg;

Refer to 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 (configured with Mtp3SetGenCfg).

linkType

Type of link. Valid values are:

MTP3LNK_ANSI

MTP3LNK_ANSI88

MTP3LNK_CCITT

MTP3LNK_JNTT

MTP3LNK_JTTC

dpc

Point code of the remote end point of this link.


Return values

Return value

Description

MTP3_SUCCESS

 

MTP3_LNKTYPE

Invalid link type.


Details

This function enables an application to initialize an MTP3LinkCfg structure before calling Mtp3SetLinkCfg to set the data link configuration parameters. Mtp3InitLinkCfg sets the link number, link type, and destination point code as specified, and initializes all other fields in the MTP3LinkCfg structure to their defaults.

Typically a pointer to an MTP3LinkCfg structure is passed to Mtp3InitLinkCfg where default values are set. After initialization, an application can override zero to all of these values and then pass the pointer to Mtp3SetLinkCfg, which sets configuration parameters. The default values provided by Mtp3InitLinkCfg are adequate for most applications.

For each link, a single transmit queue delivers data to the next lower layer (MTP 2). This queue builds up if the application is sending faster than MTP 2 can transmit data over the link. The pxQlen fields represent the queue length thresholds at which the internal transmit congestion priority is raised to the next level. For example, the default for p1Qlen is 32. This value means that when the transmit queue size reaches 32 messages, the internal transmit congestion priority is raised from 0 to 1. 0 is the lowest priority; 3 is the highest. The congestion priority in combination with the discard priority (discPrior field) are used to determine what to do with new messages from an application when the stack is backed up. If a new message has a priority less than the congestion priority and less than the discard priority, the message is discarded. Otherwise, MTP 3 attempts to queue the message for transmission to MTP 2, assuming buffer space exists. A discard priority of 0 means that all messages attempt to be queued regardless of the internal congestion priority.

The following table lists the MTP3LinkCfg fields that can be modified. A field name in bold indicates that subsequent calls to Mtp3SetLinkCfg with the same linkNo can update the field. Fields that do not appear in the following table are either unused or for internal use, and must not be modified.

Field

Description

lnkSetId

Linkset number of which this link is a member. Valid range is 1 through 32. Default is 1.

opc

Originating point code. This point code can be set for multiple OPC emulation. By default, it is set to zero and indicates to the MTP task that the general OPC must be used instead.

adjDpc

Adjacent destination point code. Must be specified with the dpc parameter.

lnkPrior

Link priority within the linkset.

It is crucial that priorities are not skipped. A single link must always be zero. Two links in the same linkset can be assigned priorities 0 and 0 or 0 and 1 but not 0 and 2 or 1 and 2.  Default value is 0, the highest priority.

msgSize

Maximum message length across this link. Default value is 272 octets (recommended).

msgPrior

Management message priority on this link. Default value is 3 (highest).

lnkType

Protocol variant used on this link. Must be specified with the linkType parameter.

maxSLTtry

Maximum times to retry the SLT message before disabling the link. Default value is 2. Set this to 0 for infinite SLT retries.

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.

p0Qlen

Transmit queue length threshold at which the congestion priority is raised to 0. Default value is 16.

p1Qlen

Transmit queue length threshold at which the congestion priority is raised to 1. Default value is 32.

p2Qlen

Transmit queue length threshold at which the congestion priority is raised to 2. Default value is 64.

p3Qlen

Transmit queue length threshold at which the congestion priority is raised to 3.

discPrior

Discard priority. Default value is 0. Refer to the Details section for more information.

lnkTstSLC

Link selection code for link test. This code must match the configured value at the adjacent SP. Default value is spId (linkNo) minus1.

tstLen

Link test pattern length. Default value is 3.

tst

Link test pattern.

ssf

Subservice field. Default based on lnkType:

MTP3SSF_NAT = LNK_ANSI or LNK_ANSI88.

MTP3SSF_INTL = LNK_CCITT, LNK_JNTT, or LNK_JTTC.

MTP3SSF_RESERVE = Never defaults to this value.

MTP3SSF_SPARE = Never defaults to this value.

tmr

Timer configuration structure. Refer to the MTP3LinkTimerCfg structure.

dpcLen

DPC and OPC length. Defaults based on lnkType:

24 = LNK_ANSI or LNK_ANSI88.

14 = LNK_CCITT.

16 = LNK_JNTT or LNK_JTTC.

dis

Initial link state. Non-zero is disabled, zero is enabled. If disabled, the link will not attempt to align after the board loads and therefore manual enabling will be required. Default value is 0 (enabled).

portType

Physical port type. Valid values are:

PORT_TYPE_REMOTE = Link is physically present on the redundant board

PORT_TYPE_TDM = T1/E1/H.100/H.110 links

traceData

TRUE starts tracing of all data between MTP 2 and MTP 3 on this link. Default value is FALSE.


MTP3LinkTimerCfg structure

typedef struct _MTP3LinkTimerCfg
{
  TimerCfg t1;   /* t1 - delay to avoid missequencing on      */
                 /* changeover                                */
  TimerCfg t2;   /* t2 - waiting for changeover ack           */
  TimerCfg t3;   /* t3 - delay to avoid missequencing on      */
                 /* changeback                                */
  TimerCfg t4;   /* t4 - waiting for first changeback ack     */
  TimerCfg t5;   /* t5 - waiting for second changeback ack    */
  TimerCfg t6;   /* t6 - delay to avoid missequencing on      */
                 /* rerouting                                 */
  TimerCfg t7;   /* t7 - waiting for link connection ack      */
  TimerCfg t11;  /* t11 - transfer restricted timer           */
  TimerCfg t12;  /* t12 - waiting for uninhibit ack           */
  TimerCfg t13;  /* t13 - waiting for forced uninhibit        */
  TimerCfg t14;  /* t14 - waiting for inhibition ack          */
  TimerCfg t17;  /* t17 - delay to avoid oscillation of       */
                 /* initial alignment failure                 */
  TimerCfg t22;  /* t22 - local inhibit test timer            */
  TimerCfg t23;  /* t23 - remote inhibit test timer           */
  TimerCfg t24;  /* t24 - stabilizing timer                   */
  TimerCfg t31;  /* t31 - BSN requested timer                 */
  TimerCfg t32;  /* t32 - SLT timer                           */
  TimerCfg t33;  /* t33 - connecting timer                    */
  TimerCfg t34;  /* t34 - periodic signalling link test timer */
  TimerCfg t40;  /* Redundancy bind timer                     */
  TimerCfg t41;  /* Redundancy disconnect request timer       */
  TimerCfg t42;  /* Redundancy flow control request timer     */
  TimerCfg t43;  /* Redundancy local processor status timer   */
  TimerCfg t44;  /* Redundancy unbind timer                   */
} MTP3LinkTimerCfg;

The following table lists the MTP3LinkTimerCfg fields that can be modified. Unless otherwise specified, the timer names correspond to the CCITT specification. Subsequent calls to Mtp3SetLinkCfg with the same linkNo can update any field in this table. Valid values for all fields in this table range from 1 through 65535 tenths of a second.

Field

Description

t1

Delay to avoid an out-of-sequence condition on changeover. Default value is 10.

t2

Waiting for changeover acknowledgement. Default value is 10.

t3

Time controlled diversion: delay to avoid an out-of-sequence condition on changeback. Default value is 10.

t4

Waiting for first changeback acknowledgement. Default value is 10.

t5

Waiting for second changeback acknowledgement. Default value is 10.

t6

Delay to avoid an out-of-sequence condition on controlled rerouting. Default value is 10.

t7

Waiting for data link connection acknowledgement. Default value is 20.

t11

Transfer restricted timer. Default value is 600.

t12

Waiting for uninhibit acknowledgement. Default value is 12.

t13

Waiting for forced uninhibit. Default value is 10.

t14

Waiting for inhibition acknowledgement. Default value is 30.

t17

Delay to avoid oscillation of initial alignment failure. Default value is 10.

t22

Local inhibit test timer (ANSI timer T20). Default value is 1100.

t23

Remote inhibit test timer (ANSI timer T21). Default value is 1100.

t24

Stabilizing timer (ANSI timer not available). Default value is 40.

t31

BSN requested timer (internal timer, not applicable to ANSI or CCITT specifications). Default value is 50.

t32

SLT timer (internal timer, not applicable to ANSI or CCITT specifications). Default value is 100.

t33

Connecting timer (internal timer, not applicable to ANSI or CCITT specifications). Default value is 200.

t34

Periodic signaling link test timer (internal timer, not applicable to ANSI or CCITT specifications). Default value is 600.

t40

Time to wait for a bind confirm from MTP 2 before sending another bind request. Default value is 30.

t41

Time to wait for a disconnect confirm from MTP 2 before sending another disconnect request. Default value is 30.

t42

Time to wait for a flow control confirm from MTP 2 before sending another flow control request. Default value is 30.

t43

Time to wait for a status confirm from MTP 2 before sending another status request. Default value is 30.

t44

Time to wait for an unbind confirm from MTP 2 before sending another unbind request. Default value is 30.


See also

Mtp3MgmtInit, Mtp3SetGenCfg, Mtp3SetLinkCfg