Initializes the provided data link configuration structure MTP3LinkCfg with default values and link number, link type, and destination point code.
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 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 value |
Description |
MTP3_SUCCESS |
|
MTP3_LNKTYPE |
Invalid link type. |
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:
The following table describes these high speed link bits:
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. |
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. |