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

📄 msi_lpmaint.c

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 C
📖 第 1 页 / 共 3 页
字号:
#ifndef	lintstatic char *sccsid = "@(#)msi_lpmaint.c	4.1	(ULTRIX)	7/2/90";#endif	lint/************************************************************************ *                                                                      * *                      Copyright (c) 1989                              * *              Digital Equipment Corporation, Maynard, MA              * *                      All rights reserved.                            * *                                                                      * *   This software is furnished under a license and may be used and     * *   copied  only  in accordance with the terms of such license and     * *   with the  inclusion  of  the  above  copyright  notice.   This     * *   software  or  any  other copies thereof may not be provided or     * *   otherwise made available to any other person.  No title to and     * *   ownership of the software is hereby transferred.                   * *                                                                      * *   The information in this software is subject to change  without     * *   notice  and should not be construed as a commitment by Digital     * *   Equipment Corporation.                                             * *                                                                      * *   Digital assumes no responsibility for the use  or  reliability     * *   of its software on equipment which is not supplied by Digital.     * *                                                                      * ************************************************************************ * * *   Facility:	Systems Communication Architecture *		Mayfair Storage Interconnect Port Driver * *   Abstract:	This module contains Mayfair Storage Interconnect Port *		Driver( MSI ) local port maintenance service functions. * *   Creator:   Todd M. Katz    Creation Date:  December 17, 1988 * *   Function/Routines: * *   msi_crash_lport		Crash Local MSI Port *   msi_remote_rst		Reset Remote Port and System *   msi_remote_strt		Start Remote Port and System *   msi_shutdown		Inform Known Systems of Local Shutdown * *   Modification History: * *   14-Jun-1989	Pete Keilty *	Add include file smp_lock.h *//* Libraries and Include Files. */#include		"../h/types.h"#include		"../h/param.h"#include		"../h/time.h"#include		"../h/kmalloc.h"#include		"../h/ksched.h"#include		"../h/errlog.h"#include		"../h/smp_lock.h"#ifdef mips#include		"../h/systm.h"#include		"../h/vmmac.h"#endif#include		"../io/scs/sca.h"#include		"../io/scs/scaparam.h"#include		"../io/ci/cippdsysap.h"#include		"../io/ci/cisysap.h"#include		"../io/msi/msisysap.h"#include		"../io/bi/bvpsysap.h"#include		"../io/gvp/gvpsysap.h"#include		"../io/uba/uqsysap.h"#include		"../io/sysap/sysap.h"#include		"../io/ci/cippdscs.h"#include		"../io/ci/ciscs.h"#include		"../io/msi/msiscs.h"#include		"../io/bi/bvpscs.h"#include		"../io/gvp/gvpscs.h"#include		"../io/uba/uqscs.h"#include		"../io/scs/scs.h"#include		"../io/ci/cippd.h"#include		"../io/msi/msiport.h"/* External Variables and Routines. */extern	PB		*cippd_get_pb();extern	u_short		msi_lpc_panic;extern	MSIB		*msi_alloc_pkt();extern	void		msi_clean_port(),			msi_dealloc_pkt(),			msi_disable(),			msi_log_devattn(),			msi_log_packet(),			msi_xfp();/*   Name:	msi_crash_lport	- Crash MSI Local Port * *   Abstract:	This routine crashes a specific local MSI port and initiates *		the process by which it is disabled, cleaned up, and *		re-initialized.  It may be sequentially invoked any number of *		times to crash a specific port; however, only its first *		invocation actually results in crashing of the port.  All *		subsequent invocations only log crash requests.  This situation *		persists until after the next incarnation of the port begins *		following completion of port clean up and re-initialization. * *		NOTE: This routine may NEVER be invoked with the address of the *		      SCS header in an optional MSIB buffer.  The CI PPD *		      currently never makes use of this routine parameter and *		      the MSI port driver caches the address, size, and remote *		      port station address of any optional MSI packet it wishes *		      logged. * *		NOTE: All error recovery is bypassed in favor of immediately *		      panicing the system whenever the MSI configuration *		      variable flag msi_lpc_panic is set.  Normally, this flag *		      is 0 and error recovery is the default action taken.  It *		      is set only when special debugging activity is required. * *		NOTE: The MSI port driver NEVER requires sanity checks to be *		      made on its local ports.  It always initializes the PCCB *		      specific finite state machine status bit "nosanity_chk" *		      so that the CI PPD skips such checks.  Therefore, the CI *		      PPD must NEVER to invoke this routine to crash a local *		      MSI port because of a failed sanity check( reason == *		      SE_PPDSANITY ). * *   Inputs: * *   IPL_SCS			- Interrupt processor level *   msi_lpc_panic		- MSI local port crash panic flag *   pccb			- Port Command and Control Block pointer *	pd.msi			-  MSI specific PCCB fields *	    lpcinfo		-   Optional local port crash information *		pkth		-    Address of MSI packet *		pktsize		-    Size of msi packet *		pport_addr	-    Packet remote port station address *	    lpstatus.optlpcinfo -   Optional local port crash information flag *	    save_dssr		-   Cached DSSI status register contents *	    save_dstat		-   Cached data transfer status reg contents *   reason			- Reason for crashing local MSI port *   scsbp			- NULL !!!! * *   Outputs: * *   IPL_SCS			- Interrupt processor level *   pccb			- Port Command and Control Block pointer *	forkb			-  PCCB fork block *	lpinfo.reason		-  Reason for port failure *	pd.msi			-  MSI specific PCCB fields *	    errlogopt.portnum	-   Remote port station address *	ppd.cippd		-  CI PPD specific PCCB fields *	    fsmstatus.cleanup	-   1 *	    fsmstatus.fkip	-   1 *	    fsmstatus.online	-   0 * *   SMP:	The PCCB is locked INTERNALLY whenever it was not locked *		EXTERNALLY prior to routine invocation.  Locking the PCCB *		allows exclusive access to PCCB contents, prevents PB deletion, *		and is required by both msi_log_packet() and msi_log_devattn(), *		the routines responsible for logging local port crash requests. *		PCCB addresses are always valid because these data structures *		are never deleted once their corresponding ports have been *		initialized. * *   		The PCCB specific XFP and RFP are locked INTERNALLY whenever *		they were not locked EXTERNALLY prior to routine invocation. *		Their locking is required by msi_disable(), the routine *		responsible for disabling the local MSI port. * *		The PCCB specific XFP and RFP are not only locked but the *		respective fork processes are synchronized to as well.  This *		synchronization is necessary because occassions exist when *		active fork processes must protect against crashing of the *		local port while temporarily releasing their locks. *		Synchronization to the fork processes by means of their *		in-progress SIIBUF pointers is the mechanism chosen to provide *		this protection. */voidmsi_crash_lport( pccb, reason, scsbp )    register PCCB	*pccb;    register u_long	reason;    SCSH		*scsbp;{    register PB		*pb;    u_long		unlock_pccb,			unlock_rfp,			unlock_xfp;    /* Crashing a local MSI port consists of a number of distinct steps:     *     * 1. The crash request is pre-processed.     * 2. The local port is disabled.     * 3. The local port is cleaned up.     * 4. The local port is re-initialized.     *     * The first step is executed each time this routine is invoked.  It is the     * latter three steps which constitute crashing the port and are executed     * only once per port incarnation.  The major benefits of this single      * threading of port crashing are the assumptions made during port clean up     * and re-initialization which follow directly from it.  These assumptions     * greatly reduce code complexity and allow extension of the MSI port     * driver to an SMP environment with a minimum of pain.  They are pointed     * out as they occur.     *     * Pre-processing of crash requests includes:     *     * 1. Locking the PCCB whenever it was not locked EXTERNALLY.     * 2. Retrieving the appropriate PB whenever an optional MSI packet was     *	  cached within the PCCB.     * 3. Applying the local port crash severity modifier( ESM_LPC ) to the     *    local port crash reason code.     * 4. Logging the crash request according to the provided crash reason.     * 5. Optionally panicing the system.     *     * The presence of an optional MSI packet is indicated by the status of the     * "optlpcinfo" local port status flag.  This flag is set when optional     * local port crash information is cached within the PCCB, cleared     * otherwise.     *     * The local port crash severity modifier is applied( Step 3 ) ONLY if the     * local port is not already in the process of being crashed.       *     * Panicing of the system( Step 5 ) immediately terminates all further     * processing of the crash request.  Such panicing is OPTIONAL.  It is     * requested only when the MSI configuration variable flag msi_lpc_panic is     * set.  This flag is set only when special debugging activity is required.     *     * Following pre-processing this routine ascertains whether or not the port     * has already been crashed but not yet re-initialized.  If this is indeed     * the case, as indicated by a PCCB clean up in progress status flag, then     * the current request is dismissed after the PCCB is unlocked( provided it     * was unlocked within this routine ).  Otherwise, actual crashing of the     * port commences with disablement of the local port including:     *     * 1. Setting the port clean up in progress flag to prohibit additional     *    crashings of the port until it has been re-initialized.     * 2. Taking the port offline.     * 3. Locking the PCCB specific RFP and XFP.     * 4. Synchronizing to any active Transmit and Receive Fork Processes.     * 5. Flushing the SIIBUF transmit-in-progress circular queue by     *	  deallocating all associated MSIB packets.     * 6. Resetting the SII chip.     * 7. Marking the local MSI port inactive.     * 8. Unlocking the PCCB specific RFP and XFP.     *     * The first five steps of local port disablement( Steps 1-5 ) and Step 8     * are executed by this routine.  The remaining two steps( Steps 6-7 ) are     * accomplished through invocation of msi_disable(), the routine     * responsible for disabling local MSI ports.

⌨️ 快捷键说明

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