📄 ci_error.c
字号:
#ifndef lintstatic char *sccsid = "@(#)ci_error.c 4.3 (ULTRIX) 10/16/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 ) * error processing routines and functions. * * Creator: Todd M. Katz Creation Date: November 12, 1985 * * Function/Routines: * * ci_cleanup_port Clean up Local CI Port * ci_console_log Log CI Events to Console Terminal * ci_log_badport Log Bad Port Numbers in CI Packets * ci_log_dev_attn Log CI Device Attention Events * ci_log_initerr Log CI Port Initialization Fatal Errors * ci_log_packet Log CI Packet Related Events * ci_map_port Map Local CI Port * ci_unmap_port Unmap Local CI Port * ci7b_disable Disable a Local CI7B Family Port * cibx_disable Disable a Local CIBX Family Port * * Modification History: * * 16-Oct-1990 Pete Keilty * 1. Changed smp_lock cidevice locking to use new macros define in * ciscs.h. Also added DELAY( 1000 ) before and after register * writes on initialization because of CIXCD XMOV bug for back to * register writes, needed on 9000/6000 systems. * 2. Changed failure reason in ci_cleanup_port from PF_ERROR to * PF_PORTERROR SCS would give back resources on none port errors. * * 16-Jul-1990 Pete Keilty * Add smp_lock lk_cidevice in the cibx_disable routine for CIXCD, * software workaround for XMOV hardware bug of back to back register * accesses the first one a read the second a write to a software * register. * * 15-Jun-1990 Pete Keilty * Added check for explicit address packet in ci_log_packet() and * set new ci packet flag CI_EXPADRS for uerf decode. * * 06-Jun-1990 Pete Keilty * 1. Added printout of pfar register to console logging. * 2. Added preliminary support for CIKMF ( dash ) * * 06-Feb-1990 Pete Keilty * 1. Added a check in the cibx_disable() if the adapter is all * ready in the uninitialized state don't set port disable. * This is because CIXCD pdr register is not availible in the * uninitialized state. * 2. Pass in the starting address of the node space to xmisst(). * * 08-Dec-1989 Pete Keilty * 1. Use new macro Get_pgrp() to get the port node number. This * will be used until full subnode addressing is done. * 2. The pidr & pvr are not set in cibx_disable() the port * has to be in the uninitialized state to set. Pidr & pvr * are set in cibx_start(). * * 09-Nov-1989 David E. Eiche DEE0080 * Rename all references to interconnects from IC_xxx to * ICT_xxx to match the new definitions in sysap.h. * * 19-Sep-1989 Pete Keilty * Added pccb to macro Format_gvph, Ppd_to_pd & Pd_to_ppd. * Added XCD support, removed XCB. * * 24-May-89 darrell * Changed the #include for cpuconf.h to find it in it's new home -- * sys/machine/common/cpuconf.h * * 20-May-1989 Pete Keilty * Added support for mips risc cpu's * Add include file ../io/scs/scamachmac.h this file has machine * depend items. * * 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. Some hardware platforms require field alignments and access types * to match( ie- only longword aligned entities may be longword * accessed ). Structure fields of type c_scaaddr present a potential * problem because they are 6 bytes long but are often treated as * contigious longword and word. Such fields have been longword * aligned whenever possible. However, it is not feasible to align * certain fields with this format within the CI error log event packet * for compatibility reasons. Therefore, what has been changed for * these fields is how they are accessed. They are now accessed as * three contigious words instead of as contigious longword and word. * 3. Modify ci_log_initerr() to obtain system identification number and * node name from the appropriate configuration variables instead of * from local system permanent information. The latter might NOT have * been initialized at the time this routine is invoked to log a fatal * local CI port initialization error. * 4. Modify ci_log_dev_attn(), ci__log_initerr(), and ci_log_packet() to * always initialize the CI error log packet field ci_optfmask2 to 0. * 5. Include header file ../vaxmsi/msisysap.h. * 6. Use the ../machine link to refer to machine specific header files. * * 21-Aug-1988 Todd M. Katz TMK0004 * 1. The interface to cippd_stop() has been changed so that the routine * no longer has to map specific local port crash reasons to generic * path failure reasons. This mapping must now be accomplished within * the individual port drivers. Modify ci_cleanup_port() * appropriately. * 2. Refer to error logging as event logging. * 3. SCA event codes have been completely revised. * 4. The following informational events( ES_I ) have been redefined as * warning events( ES_W ): UCODE_WARN. * 5. The following informational events( ES_I ) have been redefined as * error events( ES_E ): UCODE_LOAD. * 6. The following informational events( ES_I ) have been redefined as * fatal error events( ES_FE ): INIT_NOMEM, INIT_ZEROID, INIT_NOCODE, * INIT_UNKHPT, INIT_MISMTCH, BADUCODE. * 7. Rename the informational event( ES_IC ) mnemonic from IE -> I. * 8. Modifications to ci_console_log(): * 1) All event code verification checks have been redone. * 2) Logging of certain specific events now occurs regardless of * the current CI severity level. * 3) Define a new arguement to the routine, event_type( type of * event being console logged ). The optional arguement * cippdbp( address of CI PPD header ) has been changed to * cibp( address of CI port header ). * 4) The general format of all messages has been redesigned. * Path specific information is always displayed by default if * the event being logged is a path specific event( * PATH_EVENT ). The local port station address is always * displayed by default if the event being logged is a local * port specific event( LPORT_EVENT ) and of severity level * greater than or equal to error event( ES_E ). * 5) CPU revision level( CF_CPU ), local port station address( * CF_LPORT ), and initial local port initialization * information( CF_INIT ) have been added as classes of * variable information displayed. * 6) Modify the microcode revision level class of variable * information( CF_UCODE ) to display both current and * supported microcode revision levels. Also, display the * local port station address when the event is of severity * level less than error event( ES_E ). * 9. Modifications to ci_log_dev_attn(): * 1) Increment the number of errors associated with the * appropriate local port only when the severity of the current * event is error( ES_E ) or higher. * 2) Initialize the new CI event logging packet field * ci_evpktver. * 3) Add CPU microcode revision levels as a class of optional * information logged. * 4) Add logging of CI microcode revision levels for the * following informational events: LPORT_INIT, LPORT_REINIT. * 5) Initialize event log record fields correspond to unused or * inaccessible registers to EL_DEF instead of zeroing them. * 6) The device attention specific portion of a CI event log * record was not being correctly initialized for the majority * of instances when logging of optional information was * required by the specific event code being logged. This * problem was due to incorrect assumptions about the layout of * the device attention specific portion of the record. One * additional consequence of these incorrect assumptions was * the potential for writing into event log buffer space beyond * the current record being initialized. This problem has been * fully resolved. * 10. Modifications to ci_log_initerr(): * 1) Initialize the new CI event logging packet field * ci_evpktver. * 2) Change the format of the console messages printed by this * routine. * 11. Modifications to ci_log_packet(): * 1) Define a new arguement to the routine, event_type( type of * event being console logged ). The optional arguement * cippdbp( address of CI PPD header ) has been changed to * cibp( address of CI port header ). * 2) Increment the number of errors associated with the * appropriate local port only when the severity of the current * event is error( ES_E ) or higher. * 3) Initialize the new CI event logging packet field * ci_evpktver. * 12. Add the new routine ci_log_badport(), Log Bad Port Numbers in CI * Packets, for use by the CI PPD. * 13. Modify ci7b_disable() and cibx_disable() to log all decisions to * mark local ports broken and force their permanent shutdown with the * exception of those involving local ports undergoing their initial * local port initialization. * * 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: * 1) Modifying ci_console_log to utilize the new PCCB fields * max_fn_level and max_rom_level when displaying current * microcode revision levels. * 2) Splitting ci_disable_port() into ci7b_disable(), a routine * responsible for disabling CI7B family ports; and, into * cibx_disable(), a routine responsible for disabling CIBX * family ports. * 2. Add support for the CIXCB hardware port type by: * 1) Modifying ci_console_log() and ci_log_dev_attn() to log the * appropriate registers for this hardware port type. * 2) Modifying cibx_disable() to disable XMI based CI ports. * 3) Adding include file ../vaxxmi/xmireg.h. * 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 * change requires: * 1) Appropriate modifications to the comments of routines * ci_map_port(), ci_unmap_port(), ci7b_disable(), and * cibx_disable(). * 2) Modifying ci7b_disable() and cibx_disable() to unmap local * ports only when appropriate conditions are met( loss of * power or marked broken ). * 3) Moving PCCB hardware port type validation from ci_map_port() * -> ci_test_port() so that such validations are performed as * part of every initialization of every local port. * 4. Add use of macros Ci7b_wait_mif() and Cibx_wait_mif(). * 5. Add hardware port type and remove adapter I/O space virtual address * as arguments to ci_log_initerr() and modify the routine * appropriately. * 6. Remove IE_INIT_CPU as an event logged by ci_log_initerr(). * 7. Eliminate all references to the BIIC error interrupt control * register including: * 1) All logging of the register within ci_log_dev_attn(). * 2) All clearing of the register within ci7b_disable() and * cibx_disable() which should never have been done anyway. * The CI port driver never initializes this register because it never * requests to be notified of soft errors; therefore, there is no * longer a need to reference it. * 8. Rename CF_PORT -> CF_RPORT. * 9. Minimize the use of BADADDRs since they are currently expensive and * can not completely protect against machine checks. This requires * modifications to the routines ci7b_disable(), cibx_disable() and * ci_log_dev_attn(). Add an explanation as to why and when register * accesses require protection. * 10. Modify ci_cleanup_port() to no longer zero log maps( rsplogmap ) * during CI specific PCCB clean up. * 11. Update the format in which ci_console_log() displays path crash * error events. * 12. Modify ci_log_dev_attn(), ci_log_initerr(), and ci_log_packet() to * appropriately initialize the new CI event log packet field * ci_optfmask according to the information being logged. This field * is a bit mask with a unique bit assigned for each field optionally * present within a CI event log packet. Also change the routine * ci_log_dev_attn() so that it no longer always allocates full size * device attention event log packets. Packet sizes are now always * tailored to the exact information to be saved for each event * logged. * * 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. Fix a problem with ci_cleanup_port(). Currently, this routine * expects two parameters although it may only have one because is it * only invoked through forking. Delete the second parameter( reason * - the reason for port failure ) and obtain its value from the PCCB * where it was stored before routine execution was scheduled. * 3. Add use of Elcicommon(), Ctrl_from_num(), and Pccb_fork_done() * macros. * 4. The fields ci_lsaddr, ci_lsysid, and ci_lname have been moved from * structure ci_lcommon to structure elci_common in the definition of * a CI event packet. Modify ci_log_dev_attn(), ci_log_initerr(), and * ci_log_packet() to initialize these fields for every event logged. * * 16-Mar-1988 Jaw * Bug fix in ci_disable_port routine. The badaddr probe of the * bierr register was using the register content as the address. This * caused BI machines with CI's to panic with a segmentation fault. * * 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. *//* Protecting Register Accesses Against Machine Checks * * Machine checks are relatively rare events which may occur for many reasons. * The vast majority have absolutely no CI involvement; however, a few result * from CI port driver attempts to access inaccessible addresses in CI adapter * I/O space. It is these machine checks the CI port driver is specifically * concerned about and wants to protect against. * * The only CI adapter I/O space addresses the CI port driver directly accesses * are those corresponding to adapter local port registers. These registers * are accessed by the driver during the following events: * * 1. Local CI port initialization. * 2. Local CI port notification of command and free datagram/message buffer * availability. * 3. Processing of local CI port interrupts. * 4. Local CI port notification of the continued functioning of host software. * 5. Logging of certain local CI port errors. * 6. Error recovery following failure of a local CI port. *
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -