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

📄 msi_error.c

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 C
📖 第 1 页 / 共 3 页
字号:
#ifndef	lintstatic char *sccsid = "@(#)msi_error.c	4.2	(ULTRIX)	11/13/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 ) error processing routines and functions. * *   Creator:	Todd M. Katz	Creation Date:	December 17, 1988 * *   Function/Routines: * *   msi_clean_port		Clean up Local MSI Port *   msi_console_log		Log MSI Events to Console Terminal *   msi_disable		Disable Local MSI Port *   msi_log_badport		Log Bad Port Numbers in MSI Packets *   msi_log_devattn		Log MSI Device Attention Events *   msi_log_initerr		Log MSI Port Initialization Fatal Errors *   msi_log_packet		Log MSI Packet Related Events * *   Modification History: * *   13-Nov-1990	Pete Keilty *	Change PF_ERROR reason to PF_PORTERROR in msi_clean_port *	because of SCS resource fix. * *   25-Sep-1989	Pete Keilty *	Add Splscs() to msi_clean_port raise ipl to IPL_SCS. * *   14-Jun-1989	Pete Keilty *	Add include file smp_lock.h * *   27-Mar-1989	Todd M. Katz		TMK0001 *	All local port specific MSI fatal errors are currently fully logged by *	msi_log_initerr().  Modify msi_console_log() appropriately. *//* 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"#include		"../machine/pte.h"#include		"../io/uba/ubareg.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/ci/cippd.h"#include		"../io/msi/msiport.h"/* External Variables and Routines. */extern	SCSIB		lscs;extern	struct el_rec	*ealloc();extern	u_short		msi_severity;extern  scaaddr         scs_system_id;extern  u_char          scs_node_name[];extern	CLSTAB		msi_cltab[ ES_FE + 1 ][ ESC_PPD + 1 ];extern	void		cippd_stop(),			msi_console_log(),			msi_log_packet();/*   Name:	msi_clean_port	- Clean up Local MSI Port * *   Abstract:	This routine directs the second stage of local MSI port clean *		up.  It is always invoked by forking to it. * *		Failed local MSI ports are cleaned up in two stages.  The first *		stage consists of those actions which should be performed *		immediately following port disablement and are insensitive to *		processor state.  The second stage consists of those activities *		which need not be performed immediately following port *		disablement and should be executed within a constant *		well-defined processor state.  This routine direct this second *		stage of port clean up and the constant environment necessary *		for its proper execution is provided by always forking to it. * *   Inputs: * *   IPL_SCS			- Interrupt processor level *   pccb			- Port Command and Control Block pointer *	lpinfo.reason		-  Reason for port failure *	ppd.cippd		-  CI PPD specific PCCB fields *	    fsmstatus.cleanup	-   1 *	    fsmstatus.fkip	-   1 *	    fsmstatus.online	-   0 * *   Outputs: * *   IPL_SCS			- Interrupt processor level *   pccb			- Port Command and Control Block pointer *	ppd.cippd		-  CI PPD specific PCCB fields *	    fsmstatus.fkip	-   0 * *   SMP:	The PCCB is locked to synchronize access.  PCCB locking is *		probably unnecessary because of lack of conflict for the PCCB *		due to single threading of port clean up and re-initialization. *		It is done anyway to guarantee unrestricted access and because *		the CI PPD interval timer may still be active.  PCCB addresses *		are always valid because these data structures are never *		deleted once their corresponding ports have been initialized. */voidmsi_clean_port( pccb )    register PCCB	*pccb;{    register u_long	save_ipl = Splscs();    /* The steps involved in the second stage of local port clean up include:     *     * 1. Locking the PCCB.     * 2. Unlocking the PCCB.     * 3. Notifying the CI PPD of failure of the local port.     *     * The CI PPD completes the clean up of its portion of the local port     * including the failure and clean up all paths, both formative and fully     * established, originating at the port( Step 3 ).  Clean up of the last     * path triggers scheduling of port re-initialization by the CI PPD.  The     * PCCB lock is released( Step 4 ) prior to notifying the CI PPD of local     * port failure instead of after it as required by the SCA architecture.     */    Lock_pccb( pccb )    Pccb_fork_done( pccb, PANIC_PCCBFB )    Unlock_pccb( pccb )    ( void )cippd_stop( pccb, PF_PORTERROR );    ( void )splx( save_ipl );}/*   Name:	msi_console_log	- Log MSI Events to Console Terminal * *   Abstract:	This routine logs MSI events to the console terminal.  The *		event is always one of the following types: * *		PATH_EVENT	- Path specific event *		RPORT_EVENT	- Remote port specific event *		LPORT_EVENT	- Local port specific event * *		Explicit formatting information must be provided for each *		event.  This requires updating of the following tables each *		time a new event is defined: * *		1. The appropriate entry within the MSI console logging table( *		   msi_cltab[][] ) must be updated to reflect the new maximum *		   code represented within the associated format table. * *		2. The associated format table itself( msi_cli[], msi_clw[], *		   msi_clre[], msi_cle[], msi_clse[], msi_clfe[], *		   msi_clppdse[] ) must be updated with both the class of *		   variable information and exact text to be displayed. *		   However, the appropriate table should be updated with a NULL *		   entry whenever the MSI port driver is specifically NOT to *		   log a new event.  This applies only to msi_clppdse[] when a *		   new CI PPD severe error event is to be specifically logged *		   only by the CI PPD and not by appropriate port drivers such *		   as the MSI port driver. * *		NOTE: Console logging of events is bypassed whenever the event *		      severity does not warrant console logging according to *		      the current MSI severity level( msi_severity ).  Such *		      bypassing is overridden when the ECLAWAYS bit is set in *		      the event code indicating that the event is always to be *		      logged regardless of the current severity level. * *		NOTE: This routine does NOT log events arising external to the *		      MSI port driver with the exception of those CI PPD severe *		      error events which are candidates for application of the *		      local port crash severity modifier( ESM_LPC ). * *   Inputs: * *   IPL_SCS			- Interrupt processor level *   msi_cltab			- MSI console logging table *   msi_severity		- MSI console logging severity level *   msicmdblkp			- Address of MSI command block( OPTIONAL ) *   msipp			- Address of MSI packet( OPTIONAL ) *   event			- Event code *   event_type			- PATH_EVENT, LPORT_EVENT, RPORT_EVENT *   pb				- Path Block pointer( OPTIONAL ) *   pccb			- Port Command and Control Block pointer *	pd.msi			-  MSI specific PCCB fields *	    errlogopt.portnum	-   Remote port station address *				     ( required ONLY when PB not provided ) * *   Outputs: * *   IPL_SCS			- Interrupt processor level * *   SMP:	The PCCB is locked( EXTERNALLY ) to synchronize access and *		prevent premature PB deletion when a PB is provided. * *		PBs do NOT require locking when provided because only static *		fields are accessed.  SBs NEVER require locking. */voidmsi_console_log( pccb, pb, msicmdblkp, msipp, event, event_type )    register PCCB	*pccb;    register PB		*pb;    register MSICMDBLK	*msicmdblkp;    MSIPACKET		*msipp;    register u_long	event;    u_long		event_type;{    register u_long	fcode, severity = Eseverity( event );    /* Events are logged according to their type and the class of variable     * information they display.  Console messages for path specific events(     * PATH_EVENT ) display the local and remote port station addresses and     * remote system name by default when the event is of severity level error(     * ES_E ) or severe error( ES_SE ).  Console messages for local port     * specific events( LPORT_EVENT ) display the local port station address by     * default when they are of severity level error( ES_E ) or higher.     * Console messages for remote port specific events( RPORT_EVENT ) do not     * display any information by default.     *          * The following classes of variable information currently exist:     *     * 1. Remote MSI port station address.     * 2. Local MSI port station address.     * 3. MSI port registers.     * 4. MSI packet fields.     *     * Certain events may also be logged without displaying any variable     * information.     *     * Logging of MSI packet fields( Class 4 ) may also include logging of     * selected SIIBUF command block fields in the case of certain specific     * events.     *     * A panic occurs whenever the MSI port driver is not prepared to log the     * event due to detection of any of the following circumstances:     *     * 1. The event type is unknown.     * 2. The event is a SCS specific event.     * 3. The severity level of the event is invalid.     * 4. The code of the event exceeds the current maximum known code for the     *	  class( MSI or CI PPD ) and severity level of the event.     * 5. The event is not represented within the appropriate console logging     *    formatting table( indicating that the MSI port driver should never     *	  have been asked to log it in the first place ).     * 6. The class of variable information associated with the event is     *	  unknown.     *     * None of these circumstances should ever occur.     *     * NOTE: Events represented within console logging format tables by NULL     *	     entries are events which are NOT to be logged by the MSI port     *	     driver.  This routine should never be invoked to console log such     *	     events.  Currently, only certain path specific CI PPD severe error     *	     events fall into this category.     *     * NOTE: All local port specific MSI fatal errors are currently fully     *	     logged by msi_log_initerr().  This routine is never invoked either     *	     to validate such events or to optionally log them to the console.     */    if(( event_type < PATH_EVENT || event_type > LPORT_EVENT ) ||	 Test_scs_event( event )			       ||	 severity > ES_SE				       ||	 Ecode( event ) > Clog_maxcode( msi_cltab, event )     ||	 Clog_tabmsg( msi_cltab, event ) == NULL ) {	( void )panic( PANIC_UNKCODE );    } else if(( fcode = Clog_tabcode( msi_cltab, event )) &&	      ( fcode < CF_RPORT || fcode > CF_PKT2 )) {	( void )panic( PANIC_UNKCF );    } else if( msi_severity > severity && !Test_cloverride( event )) {	return;    }    ( void )cprintf( "%4s\t- ", &pccb->lpinfo.name );    switch( event_type ) {	case PATH_EVENT:	    if( severity == ES_E || severity == ES_SE ) {		if( severity == ES_E ) {		    ( void )cprintf( "error on path" );		} else {		    ( void )cprintf( "severe error on path" );		}

⌨️ 快捷键说明

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