📄 msi_lpmaint.c
字号:
* involved in requesting resetting of a remote port and system are as * follows: * * 1. Lock the PCCB. * 2. Verify operational status of the local port and validity of the * target remote port station address. * 3. Allocate a MSI port command packet. * 4. Format the MSIB buffer. * 5. Insert the MSIB buffer onto the appropriate command queue. * 6. Request the XFP to process outgoing MSI packets. * 7. Unlock the PCCB. * * Requests to reset the local port and system are always satisfied without * transmitting an RST packet( Step 2 ) and without performing the actual * reset. Resets of the local port and system have no meaning in the * current context. * * Formatting the MSIB buffer( Step 4 ) consists of formatting the: * * MSIB buffer header - information needed by XFP for packet transmission * MSI port header - common MSI packet fields * MSI packet body - RST specific MSI packet fields * * RST specific MSI packet fields requiring formatting by this routine * include only the transaction identifier. This field is currently always * set to 0. Also, the appropriate bit is set in the MSI port header flags * field whenever resetting of the remote port and system is to be forced. * * MSIB buffers containing reset requests are always inserted onto the * appropriate low priority command queue( Step 5 ). The PCCB specific * COMQL is locked immediately prior to insertion and unlocked immediately * afterwards. This guarantees exclusive access to the queue. * * The XFP is requested to begin processing of outgoing MSI packets( Step * 6 ) by scheduling its asynchronous execution. This step is bypassed * whenever XFP execution has already been scheduled but has not yet * commenced. During XFP scheduling the PCCB lock guarantees the existence * of only 1 scheduled asynchronous XFP thread at any given moment. * * NOTE: It is possible for a XFP thread to be currently active. This * does not prevent scheduling of asynchronous XFP execution. * However, the new thread does not begin to process outgoing MSI * packets until the currently active thread completes. Also, no * other additional XFP threads are scheduled until the new thread * begins processing outgoing MSI packets. */ Lock_pccb( pccb ) if( !pccb->Fsmstatus.online ) { status = RET_INVLPSTATE; } else if( Scaaddr_lob( *rport ) > pccb->lpinfo.Max_port ) { status = RET_NOPATH; } else if( Scaaddr_lob( *rport ) != Scaaddr_lob( pccb->lpinfo.addr )){ if(( msibp = msi_alloc_pkt( pccb ))) { Format_msibh( msibp, rport->low, sizeof( MSI_RST ), DEALLOC_BUF ) Format_msih( msibp, RST ) msibp->Ph.flags.Freset = force; Format_rst( msibp ) Insert_comql( pccb, msibp ) Xstart_xfp( pccb ) } else { status = RET_ALLOCFAIL; } } Unlock_pccb( pccb ) return( status );}/* Name: msi_remote_strt - Start Remote Port and System * * Abstract: This function initiates the starting of a remote MSI 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. * * Initiating starting of a remote port and system is accomplished * by initiating transmission of a MSI port specific STRT packet * to the target remote port. A MSI port command packet is used * to contain the start request. It is allocated by this function * and deallocated following packet transmission. * * 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 * MSI port numbers only occupy 1 byte. * * NOTE: All attempts to transmit packets to the local ports own * station address are bypassed. The SII chip is not * capable of either internal loopback or simultaneous * transmission and reception; and, no need exists to * provide this function in software. * * Inputs: * * IPL_SCS - Interrupt processor level * pccb - Port Command and Control Block pointer * rport - Station address of target remote port * start_addr - Start address( OPTIONAL ) * * Outputs: * * IPL_SCS - Interrupt processor level * pccb - Port Command and Control Block pointer * pd.msi - MSI specific PCCB fields * comql - MSIB low priority command queue * lpstatus.xfork - 1 * xforkb - Transmit Fork Process fork block * * 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. * * The PCCB specific COMQL is locked allowing exclusive access to * the corresponding low priority command queue */u_longmsi_remote_strt( pccb, rport, start_addr ) register PCCB *pccb; scaaddr *rport; u_long start_addr;{ register MSIB *msibp; register u_long status = RET_SUCCESS; /* Only the Transmit Fork Process( XFP ) interfaces directly with the SII * chip for the purpose of processing outgoing MSI packets. All other * driver routines must interface with the XFP. Therefore the steps * involved in requesting starting of a remote port and system are as * follows: * * 1. Lock the PCCB. * 2. Verify operational status of the local port and validity of the * target remote port station address. * 3. Allocate a MSI port command packet. * 4. Format the MSIB buffer. * 5. Insert the MSIB buffer onto the appropriate port command queue. * 6. Request the XFP to process outgoing MSI packets. * 7. Unlock the PCCB. * * Requests to start the local port and system are always satisfied without * transmitting an STRT packet( Step 2 ) and without performing the actual * start. Starts of the local port and system have no meaning in the * current context. * * Formatting the MSIB buffer( Step 4 ) consists of formatting the: * * MSIB buffer header - information needed by XFP for packet transmission * MSI port header - common MSI packet fields * MSI packet body - STRT specific MSI packet fields * * STRT specific MSI packet fields requiring formatting by this routine * include the transaction identifier and the start address. The former is * currently always set to 0. Also, the appropriate bit is set in the MSI * port header flags field whenever the remote port and system is to be * started at its default start address. * * MSIB buffers containing start requests are always inserted onto the * appropriate low priority command queue( Step 5 ). The PCCB specific * COMQL is locked immediately prior to insertion and unlocked immediately * afterwards. This guarantees exclusive access to the queue. * * The XFP is requested to begin processing of outgoing MSI packets( Step * 6 ) by scheduling its asynchronous execution. This step is bypassed * whenever XFP execution has already been scheduled but has not yet * commenced. During XFP scheduling the PCCB lock guarantees the existence * of only 1 scheduled asynchronous XFP thread at any given moment. * * NOTE: It is possible for a XFP thread to be currently active. This * does not prevent scheduling of asynchronous XFP execution. * However, the new thread does not begin to process outgoing MSI * packets until the currently active thread completes. Also, no * other additional XFP threads are scheduled until the new thread * begins processing outgoing MSI packets. */ Lock_pccb( pccb ) if( !pccb->Fsmstatus.online ) { status = RET_INVLPSTATE; } else if( Scaaddr_lob( *rport ) > pccb->lpinfo.Max_port ) { status = RET_NOPATH; } else if( Scaaddr_lob( *rport ) != Scaaddr_lob( pccb->lpinfo.addr )){ if(( msibp = msi_alloc_pkt( pccb ))) { Format_msibh( msibp, rport->low, sizeof( MSI_STRT ), DEALLOC_BUF ) Format_msih( msibp, STRT ) msibp->Ph.flags.Dsa = (( start_addr == 0 ) ? 1: 0 ); Format_strt( msibp, start_addr ) Insert_comql( pccb, msibp ) Xstart_xfp( pccb ) } else { status = RET_ALLOCFAIL; } } Unlock_pccb( pccb ) return( status );}/* Name: msi_shutdown - Inform Known Systems of Local Shutdown * * Abstract: This routine informs systems known through paths originating * at a specific local MSI 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: * pccb - Port Command and Control Block pointer * ppd.cippd - CI PPD specific PCCB fields * fsmstatus.online - 0 * * IPL_POWER - Interrupt processor level * * 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. */voidmsi_shutdown( pccb ) PCCB *pccb;{ /* Local port disablement is accomplished through invocation of the * appropriate routine. The local port is taken explicitly offline prior * to disablement. This aborts all CI PPD port polling on the local port. */ pccb->Fsmstatus.online = 0; ( void )msi_disable( pccb );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -