PREV TOC HOME INDEX NEXT


1.7.10. Set the Logical Data Link State

The GCIS_EXID_SETDLINKSTATE extension ID is supported when using DM3 and Springware boards.

The GCIS_EXID_SETDLINKSTATE extension ID asks the firmware to set the logical data link state to support specific events in your application.

Upon successful completion, the request to change the state of the logical link is accepted by the firmware. For DM3 boards in asynchronous mode, a GCEV_EXTENSION event is also received. Subsequently, when the logical data link state changes, an unsolicited GCEV_D_CHAN_STATUS event is received, indicating that the state has changed.

The following table provides the parameter inputs for the gc_Extension( ) function.

Parameter

Input

target_type GCTGT_GCLIB_CHAN
target_id line device handle (linedev) of the board device
ext_id GCIS_EXID_SETDLINKSTATE
parmblkp the pstruct member of parmblkp should point to the DLINK (Data Link Information Block) data structure followed by int. See Section 5.5, DLINK, for a definition of the DLINK structure; see the example code for details.

set_id - GCIS_SET_DLINK

parm_id - GCIS_PARM_DLINK_CES(Springware boards only)


values -

    • 0 for PRI
    • 1-8 for BRI when used as a network-side terminal.

value_type - char


parm_id - GCIS_PARM_DLINK_SAPI(Springware boards only)


values -

    • 0 for BRI and PRI
    • 16 for X.25 packets over D-channel

value_type - char

parm_id - GCIS_PARM_DLINK_STATE(DM3 and Springware boards)


values -

    • DATA_LINK_DISABLED - Channel layer 2 was disabled and cannot be reestablished. The firmware attempts to release the logical link if it is currently established. The firmware does not allow the network side to establish the logical link if requested.
    • DATA_LINK_DOWN - Not supported by DM3 boards. Channel layer 2 is not operational. The firmware attempts to release the logical link if it is currently established. The firmware allows the network side to establish the logical link if requested.
    • DATA_LINK_UP - Channel layer 2 is operational. The firmware attempts to activate the logical link if it is not already activated and allows the network side to establish the logical link if requested.

value_type - int

mode EV_ASYNC (DM3 boards only), EV_SYNC (DM3 and Springware boards)

Notes:
1. There needs to be a sufficient amount of time between bringing down the data link layer and bringing it up. This is necessary to allow time for the network side to release its resources and declare the data link down before the network side tries to reestablish the connection.
2. Although GCIS_EXID_SETDLINKSTATE can be used for PRI, it is somewhat limited in scope. In PRI, after Layer 2 is brought down (DATA_LINK_DOWN state), the firmware will try to reestablish the link after the timer expires.
3. For DM3 boards, if the gc_Extension( ) function is called before the previous transaction finished, the function will terminate with an EGC_ILLSTATE error that corresponds to "Invalid state".

Example

Note: The following example applies to Springware boards only.
int extSetDLinkState (LINEDEV handle) 
{
    GC_PARM_BLKP parm_blkp = NULL, ret_blkp = NULL;
    unsigned long mode;
    int ret_val = 0;
    GC_INFO  t_Info;
    char sapi, ces;
    int state; 
    sapi = 0;
    gc_util_insert_parm_ref( &parm_blkp, GCIS_SET_DLINK, GCIS_PARM_DLINK_SAPI,
                             sizeof( char ), &sapi);
    ces = 1;
    gc_util_insert_parm_ref( &parm_blkp, GCIS_SET_DLINK, GCIS_PARM_DLINK_CES,
                             sizeof( char ), &ces);
    state = DATA_LINK_UP;
    gc_util_insert_parm_ref( &parm_blkp, GCIS_SET_DLINK, 
                            GCIS_PARM_DLINK_STATE, sizeof( int ), &state); 
    mode = EV_SYNC; 
    ret_val = gc_Extension(GCTGT_GCLIB_CHAN, handle,
                   GCIS_EXID_SETDLINKSTATE, parm_blkp, &ret_blkp, mode);
    if ( ret_val )
    {
           ret_val = gc_ErrorInfo(&t_Info);
           if (ret_val == GC_SUCCESS) {
                    printf("gc_ErrorInfo() successfully called\n");
                    PrintGC_INFO(&t_Info);
           } else {
                    printf("gc_ErrorInfo() call failed\n");
           }
    }  
   	 	gc_util_delete_parm_blk( ret_blkp );
    gc_util_delete_parm_blk( parm_blkp );
    return ret_val;
} 

PREV TOC HOME INDEX NEXT

Click here to contact Telecom Support Resources

Copyright 2003, Intel Corporation
All rights reserved
This page generated January, 2003