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

📄 ci_lpmaint.c

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 C
📖 第 1 页 / 共 3 页
字号:
#ifndef	lintstatic char *sccsid = "@(#)ci_lpmaint.c	4.1	(ULTRIX)	7/2/90";#endif	lint/************************************************************************ *                                                                      * *                      Copyright (c) 1988 - 1989 by                    * *              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 *		Computer Interconnect Port Driver * *   Abstract:	This module contains Computer Interconnect Port Driver( CI ) *		local port maintenance service functions. * *   Creator:   Todd M. Katz    Creation Date:  May 6, 1985 * *   Function/Routines: * *   ci_crash_lport		Crash Local CI Port *   ci_remote_reset		Reset Remote Port and System *   ci_remote_start		Start Remote Port and System *   ci_shutdown		Inform Known Systems of Local Shutdown * *   Modification History: * *   06-Jun-1990	Pete Keilty *	Added six new error cases to ci_crash_lport that the CIXCD  *	can generate. They are SE_INVPA, SE_INVSN, SE_INVDDL, SE_IRESVCD, *	SE_IRESEQ, SE_DISCVCPKT. * *   19-Sep-1989	Pete Keilty *	1. Add pccb to macro Format_gvph & Pd_to_ppd. *	2. Add XCD removed XCB. * *   06-Apr-1989	Pete Keilty *	Added include file smp_lock.h * *   17-Jan-1989	Todd M. Katz		TMK0005 *	1. The macro Scaaddr_lol() has been renamed to Scaaddr_low().  It now *	   accesses only the low order word( instead of low order longword ) of *	   a SCA system address. *	2. Include header file ../vaxmsi/msisysap.h. * *   18-Aug-1988	Todd M. Katz		TMK0004 *	1. SCA event codes have been completed revised.  All former local port *	   crash codes are now defined as either severe or fatal error events. *	2. LPC_BROKEN has been renamed -> SE_PPDSANITY.  This event is now *	   logged by ci_log_packet() instead of by ci_log_dev_attn(). *	3. Modify ci_crash_lport() to apply the local port crash severity *	   modifier( ESM_LPC ) to the local port crash reason code whenever *	   the local port is not in the process of being cleaned up from a *	   previous crash. *	4. Modify ci_shutdown() to explicitly take offline the local CI port it *	   is shutting down.  This action effectively disables all CI PPD port *	   polling on the local CI port. *	5. Refer to error logging as event logging. * *   03-Jun-1988	Todd M. Katz		TMK0003 *	1. Create a single unified hierarchical set of naming conventions for *	   use within the CI port driver and describe them within ciport.h. *	   Apply these conventions to all names( routine, macro, constant, and *	   data structure ) used within the driver.  Restructure the driver to *	   segregate most CI family and port type specific code into separate *	   routines.  Such restructuring requires ci_crash_lport() and *	   ci_shutdown() to indirectly invoke appropriate CI family specific *	   local CI port disablement routines instead of directly invoking *	   ci_disable_port() as was previously done. *	2. Modify ci_crash_lport() to correctly ascertain local port state when *	   processing exhausted message free queue local port crash reasons( *	   LPC_MFQE ).  The incorrect assumption was being made that ports are *	   not in the Enabled port state when they report this error. *	3. Modify the circumstances under which local ports are unmapped. *	   Unmapping is now done only when the local port adapter itself loses *	   power( CI750/CI780/CIBCI only ) or the port is marked broken and is *	   permanently shutdown.  Formerly, unmapping was done whenever a local *	   port was crashed, but before its re-initialization commenced; and *	   just immediately prior to its initial initialization.  This changes *	   requires appropriate modifications to the comments of the routine *	   ci_crash_port(). *	4. The process under which the CI7b family of CI ports undergoes power *	   failure recovery has drastically changed.  Modify the comments to *	   ci_crash_port() to reflect this change and add comments describing *	   how broken ports are crashed. *	5. CI device attention event packets used to reserve space for fields *	   initialized only in the case of certain events.  This has changed. *	   All CI event packets are now tailered exactly to the event being *	   logged.  Therefore, there is no longer any need to initialize the *	   PCCB optional device attention information structure ( using the *	   macro Init_dattnopt()) since this structure is no longer blindly *	   copied into each and every device attention event log packet. *	   ci_crash_lport() has been changed appropriately. *	6. Modify ci_shutdown() to mark each local CI port broken prior to *	   disablement.  This forces complete disablement of the local port *	   including unmapping of the local port adapter I/O space. * *   02-Jun-1988	Ricky S. Palmer *      Removed inclusion of header file ../vaxmsi/msisysap.h * *   09-Apr-1988	Todd M. Katz		TMK0002 *	1. Add support for the CIBCA-BA hardware port type.  Differentiate *	   CIBCA-BA from CIBCA-AA hardware ports when necessary; otherwise, *	   refer to both types as just CIBCA ports. *	2. Add use of Pccb_fork() macro in place of straight-line code. *	3. Modify ci_crash_lport() to optionally panic on requests to crash *	   local ports.  Error recovery is the default action taken; however, *	   panicing occurs whenever the CI configuration variable ci_lpc_panic *	   has been set. * *   08-Jan-1988	Todd M. Katz		TMK0001 *	Formated module, revised comments, increased generality and *	robustness, made CI PPD and GVP completely independent from underlying *	port drivers, restructured code paths, and added SMP support. *//* Libraries and Include Files. */#include		"../h/types.h"#include		"../h/param.h"#include		"../h/ksched.h"#include		"../h/time.h"#include		"../h/errlog.h"#include		"../h/smp_lock.h"#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/gvp/gvp.h"#include		"../io/ci/cippd.h"#include		"../io/ci/ciport.h"/* External Variables and Routines. */extern	u_long		gvp_queue_retry;extern	u_short		ci_lpc_panic, ci_max_reinits;extern	GVPH		*ci_alloc_pkt();extern	PB		*cippd_get_pb();extern	void		ci_cleanup_port(), ci_dealloc_pkt(), ci_log_dev_attn(),			ci_log_packet();/*   Name:	ci_crash_lport	- Crash CI Local Port * *   Abstract:	This routine crashes a specific local CI 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 and dispose of *		optional buffers.  This situation persists until after the next *		incarnation of the port begins following completion of port *		clean up and re-initialization. * *		Power failure recovery of the CI7B family of CI ports( CI750, *		CI780, and CIBCI ) deserves special mentioning because of the *		potential of the ports themselves to power fail independently *		of the rest of the system.  An independent loss of power is *		detected by the port, triggers an interrupt, and results in *		crashing of the port( reason code == SE_POWER ) by the *		appropriate interrupt service routine.  The local port is *		disabled and cleaned up as it would be for any other event. *		Unfortunately, the local port can not be re-initialized while *		there is no power. * *		Restoration of power to the port may occur at either of the *		following two times: * *		1. Before port disablement and clean up completes. *		2. Sometime after port disablement and clean up completes. * *		At both times it is a special routine( ci_unmapped_isr()) which *		services the interrupt triggered by detection of power *		restoration by the local port.  This special routine is in *		position to handle the interrupt instead of the routine *		normally employed by the local port because at the time the *		local port was disabled it was also unmapped as protection *		against extraneous machine checks.  This unmapping included *		switching the interrupt service handler for the local port to *		this special routine. * *		When the special routine is invoked it re-maps the local port. *		This action switches the interrupt service hander for the local *		port back to the routine appropriate for the local port's *		hardware port type.  The special routine also marks the local *		port as having power.  What it does next is dependent upon when *		power was restored to the local port.  It does nothing more if *		port disablement and clean up are still in progress.  Port *		re-initialization occurs immediately following port clean up *		as it would for any other event.  However, if port clean up has *		completed then the special routine explicitly schedules port *		re-initialization before dismissing the interrupt.  The end *		result is the same regardless of when local port power is *		restored, successful recovery from independent failure through *		re-initialization of the local port. * *		The CIBX family of CI ports( CIBCA, CIXCD ) is not subject to *		such Byzantine recovery scenarios.  This is because such ports *		are unable to detect independent losses of power; and thus, may *		not power fail independently of the rest of the system. * *		An additional explanation is also warranted for those instances *		when this routine is invoked to crash a local port and take it *		permanently offline.  Such instances are indicated by the local *		port marked broken.  The specific fatal event maybe any one of *		a number of codes.  The actions taken are the same as for any *		other event, the local port is disabled, cleaned up, and the *		initialization routine is scheduled.  However, the local port *		initialization routine detects that the local port is marked *		broken, aborts port re-initialization, and takes the local port *		permanently offline.  Furthermore, when the local port was *		disabled it was also unmapped because it was marked broken at *		the time.  This act of unmapping included switching the *		interrupt service handler for the broken port to a special *		routine, ci_unmapped_isr().  Note that this is the same routine *		used as the interrupt service handler during power failure *		recovery of the CI7B family of CI ports. * *		NOTE: All error recovery is bypassed in favor of immediately *		      panicing the system whenever the CI configuration *		      variable flag ci_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. *

⌨️ 快捷键说明

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