📄 cippd_protocol.c
字号:
* * IPL_SCS - Interrupt processor level * cippdbp - Address of CI PPD header in datagram * pb - Path Block pointer * pccb - Port Command and Control Block pointer * * Outputs: * * IPL_SCS - Interrupt processor level * pb - Path Block pointer * sb - Address of formative System Block * pinfo.protocol - Remote systems CI PPD protocol version * pccb - Port Command and Control Block pointer * ppd.cippd - CI PPD specific PCCB fields * aflogmap - Path establishment insufficient mem log map * * Return Values: * * RET_SUCCESS - Formative System Block successfully built * RET_FAILURE - Failed to allocate a System Block * * SMP: The PCCB is locked( EXTERNALLY ) allowing exclusive access to * PCCB contents, postponing premature PB deletion, and as * required by cippd_log_path() in case logging becomes necessary. * * The PB is locked( EXTERNALLY ) postponing potential deletion * and allowing exclusive access to PB contents. */u_longcippd_build_sb( pccb, pb, cippdbp ) PCCB *pccb; PB *pb; GVPPPDH *cippdbp;{ register SB *sb; register u_long status = RET_SUCCESS; register CIPPD_START *bp = Cippd_start( Ppd_to_scs( cippdbp )); /* Insufficient memory for SB allocation aborts new path establishment. * Only the first such failure to establish a specific path is logged. * Logging of all subsequent failures is bypassed until after the CI PPD is * successful at allocating all required memory for establishment of the * specific path( see cippd_enab_path()). */ if(( sb = pb->sb = scs_alloc_sb(( SIB * )bp ))) { pb->pinfo.protocol = bp->protocol; sb->sinfo.npaths = 0; } else { if( !Test_map( Aflogmap, Scaaddr_low( pb->pinfo.rport_addr ))) { Set_map( Aflogmap, Scaaddr_low( pb->pinfo.rport_addr )) ( void )cippd_log_path( pccb, pb, cippdbp, E_ALLOCFAIL ); } status = RET_FAILURE; } return( status );}/* Name: cippd_comp_trys - Compute Number of Transmission Attempts * * Abstract: This action routine computes the maximum number of attempts * made by the finite state machine to transmit a CI PPD protocol * packet. The maximum number of attempts is computed as follows: * * tries = ( port contact frequency ) / ( port polling frequency ) * * The current port polling interval is used as the port polling * frequency. * * Inputs: * * IPL_SCS - Interrupt processor level * cippd_itime - CI PPD port timer interval * cippdbp - Address of CI PPD header in datagram * pb - Path Block pointer * pccb - Port Command and Control Block pointer * * Outputs: * * IPL_SCS - Interrupt processor level * pb - Path Block pointer * ppd.cippd - CI PPD specific PB fields * retry - Retry count * * SMP: The PCCB is locked( EXTERNALLY ) allowing exclusive access to * PCCB contents. * * The PB is locked( EXTERNALLY ) postponing potential deletion * and allowing exclusive access to PB contents. */voidcippd_comp_trys( pccb, pb, cippdbp ) PCCB *pccb; PB *pb; GVPPPDH *cippdbp;{ pb->Retry = ((( pccb->Contact >= cippd_itime ) ? pccb->Contact : cippd_itime ) / pccb->Poll_interval );}/* Name: cippd_disb_path - Disable CI PPD Path * * Abstract: This action routine directs the disablement of a CI PPD path. * * Inputs: * * IPL_SCS - Interrupt processor level * cippdbp - Address of CI PPD header in datagram/message * pb - Path Block pointer * pccb - Port Command and Control Block pointer * * Outputs: * * IPL_SCS - Interrupt processor level * pb - Path Block pointer * ppd.cippd - CI PPD specific PB fields * fsmpstatus - Finite State Machine path status flags * path_closed - 1 * * SMP: The PCCB is locked( EXTERNALLY ) as required by PD functions * which close virtual circuits. * * The PB is locked( EXTERNALLY ) postponing potential deletion, * allowing exclusive access to PB contents, and as required by * PD functions which close virtual circuits. */voidcippd_disb_path( pccb, pb, cippdbp ) PCCB *pccb; register PB *pb; GVPPPDH *cippdbp;{ /* Disable the path only if it has not already been disabled by the * appropriate port driver. */ if( !pb->Fsmpstatus.path_closed ) { ( void )( *pccb->Set_circuit )( pccb, pb, Scaaddr_low( pb->pinfo.rport_addr ), SET_VC_CLOSE ); pb->Fsmpstatus.path_closed = 1; }}/* Name: cippd_enab_path - Enable CI PPD Path * * Abstract: This action function directs the enablement of a CI PPD path. * * Inputs: * * IPL_SCS - Interrupt processor level * cippdbp - Address of CI PPD header in datagram * pb - Path Block pointer * ppd.cippd - CI PPD specific PB fields * fsmpstatus - Finite State Machine path status flags * path_closed - 1 * pccb - Port Command and Control Block pointer * * Outputs: * * IPL_SCS - Interrupt processor level * pb - Path Block pointer * ppd.cippd - CI PPD specific PB fields * fsmpstatus - Finite State Machine path status flags * path_closed - Path already closed by port status bit * pccb - Port Command and Control Block pointer * ppd.cippd - CI PPD specific PCCB fields * aflogmap - Path establishment insufficient mem log map * * Return Values: * * RET_SUCCESS - CI PPD path is enabled * RET_ALLOCFAIL - Unable to allocate port specific buffer * * SMP: The PCCB is locked( EXTERNALLY ) allowing exclusive access to * PCCB contents, postponing premature PB deletion, and as * required both by PD functions which open virtual circuits and * by cippd_log_path() in case logging becomes necessary. * * The PB is locked( EXTERNALLY ) postponing potential deletion, * allowing exclusive access to PB contents, and as required by * PD functions which open virtual circuits. */u_longcippd_enab_path( pccb, pb, cippdbp ) PCCB *pccb; register PB *pb; GVPPPDH *cippdbp;{ register u_long status; /* Insufficient memory for port specific buffer allocation is the only * reason for failure to enable a specific path. This failure aborts new * path establishment and is logged. Only the first such failure to * establish a specific path is logged. Logging of all subsequent failures * is bypassed until after the CI PPD is successful at allocating all * required memory for establishment of the specific path( which occurs * with successful invocation of this very function ). */ if( pb->Fsmpstatus.path_closed ) { status = ( *pccb->Set_circuit )( pccb, pb, Scaaddr_low( pb->pinfo.rport_addr ), SET_VC_OPEN ); if( status == RET_SUCCESS ) { pb->Fsmpstatus.path_closed = 0; Clear_map( Aflogmap, Scaaddr_low( pb->pinfo.rport_addr )) } else { if( !Test_map( Aflogmap, Scaaddr_low( pb->pinfo.rport_addr ))) { Set_map( Aflogmap, Scaaddr_low( pb->pinfo.rport_addr )) ( void )cippd_log_path( pccb, pb, NULL, E_ALLOCFAIL ); } } } else { ( void )panic( PPDPANIC_POPEN ); } return( status );}/* Name: cippd_enter_db - Enter Path Block into Databases * * Abstract: This action function enters the PB representing the formative * CI PPD path into the system-wide local port and configuration * databases. The formative SB is also entered into the * system-wide configuration database provided the system is not * currently known; otherwise, the formative SB is deallocated. * * Existence of the new path is event logged and brought to the * attention of SCS. * * NOTE: No action function invoked following the invocation of * this one may ever return a failure status. This is * because for all practical purposes the path is fully * established once this routine enters the PB into the * databases( see rule 4 at front of this module ). * * Inputs: * * IPL_SCS - Interrupt processor level * cippdbp - Address of CI PPD header in datagram * pb - Path Block pointer * pccb - Port Command and Control Block pointer * lk_scadb - SCA database lock structure * scs_config_db - System-wide configuration database queue head * * Outputs: * * IPL_SCS - Interrupt processor level * pb - Path Block pointer * flink - Database queuing pointers * sb - SB pointer * pccb - Port Command and Control Block pointer * lpinfo.ppd.cippd - CI PPD specific local port information * dbclogmap - Database conflict port logging bitmap * nform_paths - Current number of formative paths * npaths - Current number of paths * ppd.cippd - CI PPD specific PCCB fields * elogopt.dbcoll - Database collision error information * elogopt.protocol - CI PPD protocol information * elogopt.rswtype - Remote system software type * form_pb - Formative PB queue * open_pb - PS_OPEN PB vector table * tmologmap - Path establishment timeout log map * sb - System Block pointer * flink - Database queuing pointers * pbs - PB queue * sinfo.npaths - Current number of paths * scs_config_db - System-wide configuration database queue * * Return Values: * * RET_SUCCESS - Path Block entered into databases * RET_FAILURE - Conflict discovered within a database * * SMP: The SCA database is locked INTERNALLY whenever it was not * locked EXTERNALLY prior to function invocation. It is locked * for traversing the system-wide configuration database and * updating it with the formative PB and occasionally the * formative SB. It is also required by cippd_csyslev() in case * common system level event logging becomes necessary.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -