⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ci_lpmaint.c

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 C
📖 第 1 页 / 共 3 页
字号:
 *		system.  The remote system need NOT be known to be reset; *		however, the remote port must be in the appropriate maintenance *		state for it and the remote system to be reset. * *		Resetting is initiated by placing a SNDRST command packet onto *		the lowest priority port command queue and notifying the port *		when the queue was previously empty.  Execution of the SNDRST *		port command transmits a maintenance reset CI packet to the *		target port. * *		A CI command packet is used to contain the command.  It is *		allocated by this function and deallocated following command *		execution. * *		The port is crashed if the queue interlock can not be obtained. * *		Resetting of the remote port and system can optionally be *		forced; however, the port must in an appropriate maintenance *		state for this to occur. * *              NOTE: SCA port numbers are 6 bytes in size; however, maximum CI *                    port numbers only occupy 1 byte. * *   Inputs: * *   IPL_SCS			- Interrupt processor level *   force			- If set, force maintenance reset *   pccb			- Port Command and Control Block pointer *   rport_addr			- Station address of target remote port *   gvp_queue_retry		- Queuing failure retry count * *   Outputs: * *   IPL_SCS			- Interrupt processor level * *   Return Values: * *   RET_SUCCESS		- Transmission successfully initiated *   RET_ALLOCFAIL		- Failed to allocate command packet *   RET_INVLPSTATE		- Local port in invalid state *   RET_NOPATH			- Invalid remote port station address * *   SMP:       The PCCB is locked allowing exclusive access to PCCB contents. *              PCCB addresses are always valid because these data structures *              are never deleted once their corresponding ports have been *		initialized. * *              Access to port command queues is by means of memory *              interlocking queuing instructions. */u_longci_remote_reset( pccb, rport_addr, force )    register PCCB	*pccb;    scaaddr		*rport_addr;    u_long		force;{    register GVPH	*cibp;    register SNDRSTH	*bp;    register u_long	status = RET_SUCCESS;    /* The steps involved in resetting a remote port and system are:     *     * 1. Lock the PCCB.     * 2. Verify operational status of the local port and validity of the     *    target remote port address.     * 3. Allocate a CI port command packet to contain the SNDRST command.     * 4. Format the SNDRST specific portion of the command packet.     * 5. Format the generic Vaxport header.     * 6. Initiate resetting of the target remote port and system.     * 7. Unlock the PCCB.     *     * The port is crashed if command execution can not be successfully     * initiated.     */    Lock_pccb( pccb )    if( !pccb->Fsmstatus.online ) {	status = RET_INVLPSTATE;    } else if(  rport_addr->low > pccb->lpinfo.Max_port ) {	status = RET_NOPATH;    } else if(( cibp = ci_alloc_pkt( pccb ))) {	bp = ( SNDRSTH * )Pd_to_ppd( cibp, pccb );	bp->xctid.blockid = 0;	U_long( bp->xctid.lconnid ) = 0;	Format_gvph( pccb, cibp, SNDRST, rport_addr->low, DEALLOC_BUF )	if( force ) {	    Freset( cibp ) = 1;	}	Insqti_maintenance( cibp, pccb )    } else {	status = RET_ALLOCFAIL;    }    Unlock_pccb( pccb )    return( status );}/*   Name:	ci_remote_start	- Start Remote Port and System * *   Abstract:	This function initiates the starting of a remote port and *		system.  The remote system need NOT be known to be started; *		however, the local port must have previously reset the remote *		port for it to start it. * *		Starting is initiated by placing a SNDSTRT command packet onto *		the lowest priority port command queue and notifying the port *		when the queue was previously empty.  Execution of the SNDSTRT *		port command transmits a maintenance start CI packet to the *		target port. * *		A CI command packet is used to contain the command.  It is *		allocated by this function and deallocated following command *		execution. * *		The port is crashed if the queue interlock can not be obtained. * *		A start address can be optionally supplied; otherwise, the *		default start address is used. * *              NOTE: SCA port numbers are 6 bytes in size; however, maximum CI *                    port numbers only occupy 1 byte. * *   Inputs: * *   IPL_SCS			- Interrupt processor level *   pccb			- Port Command and Control Block pointer *   rport_addr			- Station address of target remote port *   gvp_queue_retry		- Queuing failure retry count *   start_addr			- Start address( OPTIONAL ) * *   Outputs: * *   IPL_SCS			- Interrupt processor level * *   Return Values: * *   RET_SUCCESS		- Transmission successfully initiated *   RET_ALLOCFAIL		- Failed to allocate command packet *   RET_INVLPSTATE		- Local port in invalid state *   RET_NOPATH			- Invalid remote port station address * *   SMP:       The PCCB is locked allowing exclusive access to PCCB contents. *              PCCB addresses are always valid because these data structures *              are never deleted once their corresponding ports have been *		initialized. * *              Access to port command queues is by means of memory *              interlocking queuing instructions. */u_longci_remote_start( pccb, rport_addr, start_addr )    register PCCB	*pccb;    scaaddr		*rport_addr;    u_long		start_addr;{    register GVPH	*cibp;    register SNDSTRTH	*bp;    register u_long	status = RET_SUCCESS;    /* The steps involved in starting a remote port and system are:     *     * 1. Lock the PCCB.     * 2. Verify operational status of the local port and validity of the     *    target remote port address.     * 3. Allocate a CI port command packet to contain the SNDSTRT command.     * 4. Format the SNDSTRT specific portion of the command packet.     * 5. Format the generic Vaxport header.     * 6. Initiate starting of the target remote port and system.     * 7. Unlock the PCCB.     *     * The port is crashed if command execution can not be successfully     * initiated.     */    Lock_pccb( pccb )    if( !pccb->Fsmstatus.online ) {	status = RET_INVLPSTATE;    } else if(  rport_addr->low > pccb->lpinfo.Max_port ) {	status = RET_NOPATH;    } else if(( cibp = ci_alloc_pkt( pccb ))) {	bp = ( SNDSTRTH * )Pd_to_ppd( cibp, pccb );	bp->xctid.blockid = 0;	U_long( bp->xctid.lconnid ) = 0;	bp->start_addr = start_addr;	Format_gvph( pccb, cibp, SNDSTRT, rport_addr->low, DEALLOC_BUF )	if( start_addr == 0 ) {	    Dstart( cibp ) = 1;	}	Insqti_maintenance( cibp, pccb )    } else {	status = RET_ALLOCFAIL;    }    Unlock_pccb( pccb )    return( status );}/*   Name:	ci_shutdown	- Inform Known Systems of Local Shutdown * *   Abstract:	This routine informs systems known through paths originating *		at a specific local CI port of local system shutdown.  This is *		accomplished through disabling of the specified port.  The *		remote system discovers the unavailability of the port either *		during CI PPD polling or during utilization of the virtual *		circuit.  At that time it terminates its path to the port and *		and thus to the local system. * *		NOTE: STOP CI PPD datagrams are not transmitted across all *		      formative and established paths.  This is because the *		      state of the port is unknown and may in fact preclude *		      datagram transmission. * *   Inputs: * *   IPL_POWER			- Interrupt processor level *   pccb			- Port Command and Control Block pointer * *   Outputs: * *   IPL_POWER			- Interrupt processor level *   pccb			- Port Command and Control Block pointer *	ppd.cippd		-  CI PPD specific PCCB fields *	    fsmstatus.broken	-   1 *	    fsmstatus.online	-   0 * *   SMP:       No locks are required.  This routine is only called( *		indirectly ) from panic() and it is invoked at maximum IPL. *		Only the processor executing this code is operational and this *              routine can not be interrupted on this processor.  This *              guarantees uncompromised access to the PCCB without locking it. */voidci_shutdown( pccb )    PCCB		*pccb;{    /* Local port disablement is accomplished through indirect invocation of     * the appropriate CI family specific local CI port disablement routine.     * The local port is marked broken prior to disablement to force unmapping     * of the local port adapter I/O space.     *     * Prior to disablement the local port is also taken explicitly offline.     * This aborts all CI PPD port polling on the local port.     *     * Only mapped local ports are disabled.  Unmapped local ports have already     * been completely disabled including unmapping of the local port adapter     * I/O space.     */    if( pccb->Lpstatus.mapped ) {	pccb->Fsmstatus.broken = 1;	pccb->Fsmstatus.online = 0;	( void )( *pccb->Disable_port )( pccb, PS_UNINIT );    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -