📄 scs_info.c
字号:
* SMP: The SCA database is locked to postpone potential modifications * to the system-wide local port database while it is being * traversed. */u_longscs_info_lport( isb, lpib ) register ISB *isb; LPIB *lpib;{ register pccbq *qp; register PCCB *pccb; register u_long status = RET_NOLPORT; /* The steps involved in returning local port information are as follows: * * 1. Lock the SCA database. * 2. Search the system-wide local port database for the target local port. * 3. Retrieve the target local port's information. * 4. Unlock the SCA database. * 5. Return an appropriate status. */ Lock_scadb() for( qp = scs_lport_db.flink; qp != &scs_lport_db; qp = qp->flink ) { pccb = Pos_to_pccb( qp, flink ); if( isb->next_lport_name == 0 || pccb->lpinfo.name == isb->next_lport_name ) { if( lpib ) { *lpib = pccb->lpinfo; } isb->lport_name = pccb->lpinfo.name; if(( qp = qp->flink ) == &scs_lport_db ) { isb->next_lport_name = 0; } else { isb->next_lport_name = Pos_to_pccb( qp, flink )->lpinfo.name; } status = RET_SUCCESS; break; } } Unlock_scadb() return( status );}/* Name: scs_info_path - Return Path Information * * Abstract: This function returns information about a path to a locally * known system. * * Inputs: * * IPL_SCS - Interrupt processor level * isb - Information Service Block pointer * next_lport_name - Local port name of target path * ( 0 requests first path to system ) * next_rport_addr - Remote port address of target path * sysid - Identification number of system * lk_scadb - SCA database lock structure * scs_config_db - System-wide configuration database queue head * pib - Path Information Block pointer * * Outputs: * * IPL_SCS - Interrupt processor level * isb - Information Service Block pointer * lport_name - Local port name of found path * next_lport_name - Local port name of next path * ( 0 -> last path to system found ) * next_rport_addr - Remote port address of next path * rport_addr - Remote port address of found path * pib - Path Information Block pointer * INITIALIZED * * Return Values: * * RET_SUCCESS - Target path found * RET_NOSYSTEM - Specified system not known locally * RET_NOPATH - Target path not found * * SMP: The SCA database is locked to postpone potential modifications * to the system-wide configuration database while it is being * traversed. */u_longscs_info_path( isb, pib ) register ISB *isb; PIB *pib;{ register sbq *sb; register pbq *pb; register u_long status = RET_NOSYSTEM; /* The steps involved in returning path information are as follows: * * 1. Lock the SCA database. * 2. Search the system-wide configuration database for the target path. * 3. Retrieve the target path's information. * 4. Unlock the SCA database. * 5. Return an appropriate status. */ Lock_scadb() for( sb = scs_config_db.flink; sb != &scs_config_db; sb = sb->flink ) { if( Comp_scaaddr( isb->sysid, Sb->sinfo.sysid )) { for( pb = Sb->pbs.flink; pb != &Sb->pbs; pb = pb->flink ) { if( isb->next_lport_name == 0 || ( isb->next_lport_name == Pb->pinfo.lport_name && Comp_scaaddr( isb->next_rport_addr, Pb->pinfo.rport_addr ))) { if( pib ) { *pib = Pb->pinfo; } isb->lport_name = Pb->pinfo.lport_name; Move_scaaddr( Pb->pinfo.rport_addr, isb->rport_addr ); if(( pb = pb->flink ) == &Sb->pbs ) { isb->next_lport_name = 0; Zero_scaaddr( isb->next_rport_addr ) } else { isb->next_lport_name = Pb->pinfo.lport_name; Move_scaaddr( Pb->pinfo.rport_addr, isb->next_rport_addr ) } status = RET_SUCCESS; break; } } if( status == RET_NOSYSTEM ) { status = RET_NOPATH; } break; } } Unlock_scadb() return( status );}/* Name: scs_info_scs - Return SCS Information * * Abstract: This routine returns current SCS information. * * Inputs: * * IPL_SCS - Interrupt processor level * gvp_info - GVP routine to retrieve GVP information * lscs - Local system permanent information * lk_scadb - SCA database lock structure * scs_cbvtdb - CB vector table database pointer * scs_config_db - System-wide configuration database queue head * scs_cushion - SCS send credit cushion * scs_listeners - Listening SYSAP queue queue head * scs_lport_db - System-wide local port database queue head * scs_sanity - SCS sanity timer interval * scsib - SCS Information Block pointer * * Outputs: * * IPL_SCS - Interrupt processor level * scsib - SCS Information Block pointer * INITIALIZED * * SMP: The SCA database is locked to postpone potential modifications * while the following databases, queues, and lists are being * traversed: * * 1. The system-wide configuration database. * 2. The system-wide local port database. * 3. The queue of listening SYSAPs. * 4. The list of free CBVTEs. */voidscs_info_scs( scsib ) register SCSIB *scsib;{ register sbq *sb; register pbq *pb; register cbq *cb; register CBVTE *cbvte; register pccbq *pccb; register void ( *info )(); /* The steps involved in returning current SCS information are as follows: * * 1. Retrieve the local system permanent information. * 2. Retrieve the values of selected SCS configuration parameters. * 3. Lock the SCA database. * 4. Traverse the system-wide configuration database and determine the * current number of systems, paths, and connections. * 5. Traverse the the queue of listening SYSAPs and determine the current * number of listening SCS connections. * 6. Determine the current number of free CBVTEs. * 7. Traverse the system-wide local port database and determine the * current number of local ports. * 8. Unlock the SCA database. * 5. Invoke the GVP specific routine to obtain GVP related information( * provided this routine is provided ). */ if( scsib == NULL ) { return; } *scsib = lscs; scsib->cushion = scs_cushion; scsib->sanity = scs_sanity; Lock_scadb() for( sb = scs_config_db.flink, scsib->nconns = 0, scsib->npaths = 0, scsib->nsystems = 0; sb != &scs_config_db; sb = sb->flink, ++scsib->nsystems ) { for( pb = Sb->pbs.flink; pb != &Sb->pbs; pb = pb->flink, ++scsib->npaths ) { for( cb = Pb->cbs.flink; cb != &Pb->cbs; cb = cb->flink, ++scsib->nconns ) {} } } for( cb = scs_listeners.flink, scsib->nlisteners = 0; cb != &scs_listeners; cb = cb->flink, ++scsib->nlisteners ) {} for( cbvte = scs_cbvtdb->free_cbvte, scsib->free_cbvtes = 0; cbvte; cbvte = cbvte->ov1.cbvte ) { ++scsib->free_cbvtes; } for( pccb = scs_lport_db.flink, scsib->nlports = 0; pccb != &scs_lport_db; pccb = pccb->flink, ++scsib->nlports ) {} Unlock_scadb() if(( info = gvp_info )) { ( void )( *gvp_info )( scsib ); }}/* Name: scs_info_system - Return System Information * * Abstract: This function returns information about a locally known system. * * Inputs: * * IPL_SCS - Interrupt processor level * isb - Information Service Block pointer * next_sysid - Identification number of target system * ( 0 requests first system in database ) * lk_scadb - SCA database lock structure * scs_config_db - System-wide configuration database queue head * sib - System Information Block pointer * * Outputs: * * IPL_SCS - Interrupt processor level * isb - Information Service Block pointer * next_sysid - Identification number of next system * ( 0 -> last system found ) * sysid - Identification number of found system * sib - System Information Block pointer * INITIALIZED * * Return Values: * * RET_SUCCESS - Target system found * RET_NOSYSTEM - Target system not known locally * * SMP: The SCA database is locked to postpone potential modifications * to the system-wide configuration database while it is being * traversed. */u_longscs_info_system( isb, sib ) register ISB *isb; SIB *sib;{ register sbq *sb; register u_long status = RET_NOSYSTEM; /* The steps involved in returning system information are as follows: * * 1. Lock the SCA database. * 2. Search the system-wide configuration database for the target system. * 3. Retrieve the target system's information. * 4. Unlock the SCA database. * 5. Return an appropriate status. */ Lock_scadb() for( sb = scs_config_db.flink; sb != &scs_config_db; sb = sb->flink ) { if( Test_scaaddr( isb->next_sysid ) || Comp_scaaddr( isb->next_sysid, Sb->sinfo.sysid )) { if( sib ) { *sib = Sb->sinfo; } Move_scaaddr( Sb->sinfo.sysid, isb->sysid ); if(( sb = sb->flink ) == &scs_config_db ) { Zero_scaaddr( isb->next_sysid ) } else { Move_scaaddr( Sb->sinfo.sysid, isb->next_sysid ) } status = RET_SUCCESS; break; } } Unlock_scadb() return( status );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -