📄 ci_error.c
字号:
} } else { Unlock_cidevice( pccb ) Elcixmiregs( celp )->xdev = EL_UNDEF; Elcixmiregs( celp )->xbe = EL_UNDEF; Elcixmiregs( celp )->xfadrl = EL_UNDEF; Elcixmiregs( celp )->xfadrh = EL_UNDEF; Elcixmiregs( celp )->pidr = EL_UNDEF; Elcixmiregs( celp )->pvr = EL_UNDEF; } celp += sizeof( struct cixmi_regs ); break; default: ( void )panic( PANIC_IC ); } } switch( Mask_esevmod( event )) { case I_LPORT_REINIT: case I_LPORT_INIT: case W_UCODE_WARN: case FE_BADUCODE: Elcicommon( elp )->ci_optfmask1 |= CI_REVLEV; *Elcirevlev( celp ) = pccb->Devattn.cirevlev; break; case E_UCODE_LOAD: Elcicommon( elp )->ci_optfmask1 |= CI_UCODE; *Elciucode( celp ) = pccb->Devattn.ciucode; break; case FE_CPU: Elcicommon( elp )->ci_optfmask1 |= CI_CPUREVLEV; *Elcicpurevlev( celp ) = pccb->Devattn.cicpurevlev; break; } EVALID( elp )}/* Name: ci_log_initerr - Log CI Port Initialization Fatal Errors * * Abstract: This routine logs a special type of CI device attention event: * software errors detected during probing of local CI ports. * These fatal error events are logged as device attentions * because they pertain to a specific local CI port. However, * they are considered special because they pre-date allocation of * a PCCB for the local port, and therefore, may not make use of * it for event logging purposes. The following special events * are currently defined: * * 1. FE_INIT_NOMEM - Insufficient dynamic memory * 2. FE_INIT_ZEROID - Uninitialized system identification num * 3. FE_INIT_NOUCODE - CI microcode absent * 4. FE_INIT_UNKHPT - Unknown hardware port type * 5. FE_INIT_MISMTCH - Mismatched CI Port ucode & hw port types * * All such events represent fatal errors. None ever have the * local port crash severity modified( ESM_LPC ) applied. * * The occurrence of an port initialization fatal event is also * automatically logged to the console, but without variable * information. * * Explicit formatting information must be provided for each * event. This requires updating of the following tables each * time a new CI fatal error event is defined: * * 1. The CI fatal error event table( ci_clfe[]) must be updated * with the exact text to be displayed and the console logging * format code CF_NONE( CI fatal error events discovered during * port probing currently never display variable information ). * * 2. The fatal error event entry within the CI console logging * table( ci_cltab[][] ) must be updated to reflect the new * maximum fatal error event code. * * Inputs: * * IPL_SCS - Interrupt processor level * ci_cltab - CI console logging table * cinum - CI adapter number * event - Fatal error event code * hpt - Hardware port type * interconnect - Interconnect type * scs_node_name - SCS node name * scs_system_id - SCS system identification number * * Outputs: * * IPL_SCS - Interrupt processor level * * SMP: No locks are required. */voidci_log_initerr( cinum, interconnect, hpt, event ) u_long cinum; u_long interconnect; u_long hpt; register u_long event;{ register struct el_rec *elp; /* Logging of fatal errors detected during CI port probings proceeds as * follows: * * 1. The fatal error is validated. * 2. The fatal error event and a local port permanently offline message * are both printed on the console. * 3. An event log record is allocated and the record's sub id packet * fields are initialized. * 4. The portion of record common to all CI events is initialized. * 5. The event log record is validated. * * This routine panics if validation of the fatal error event( Step 1 ) * fails indicating inability of the CI port driver to log the reported * event. * * Event logging is bypassed on failures to allocate an event log record( * Step 3 ). * * Note that no other CI specific information common to device attention * events is logged and that no variable information is displayed within * logged console messages. */ switch( event ) { case FE_INIT_NOMEM: case FE_INIT_ZEROID: case FE_INIT_NOUCODE: case FE_INIT_UNKHPT: case FE_INIT_MISMTCH: break; default: ( void )panic( PANIC_UNKCODE ); } ( void )cprintf( "ci%u\t- fatal error( local port ? )\n\t- %s\n", cinum, Clog_tabmsg( ci_cltab, event )); ( void )cprintf( "ci%u\t- permanently offline( local port ? )\n", cinum ); if(( elp = ealloc( sizeof( struct ci_common ), EL_PRIHIGH )) == EL_FULL ) { LSUBID( elp, ELCT_DCNTL, ELCI_ATTN, hpt, cinum, EL_UNDEF, event ) Elcicommon( elp )->ci_optfmask1 = 0; Elcicommon( elp )->ci_optfmask2 = 0; Elcicommon( elp )->ci_evpktver = CI_EVPKTVER; U_long( *Elcicommon( elp )->ci_lpname ) = Ctrl_from_num( "ci ",cinum); Move_node( scs_node_name, Elcicommon( elp )->ci_lname ) Move_scaaddr( scs_system_id, *Elcicommon( elp )->ci_lsysid ) U_short( Elcicommon( elp )->ci_lsaddr[ 0 ]) = EL_UNDEF; U_short( Elcicommon( elp )->ci_lsaddr[ 2 ]) = EL_UNDEF; U_short( Elcicommon( elp )->ci_lsaddr[ 4 ]) = EL_UNDEF; Elcicommon( elp )->ci_nerrs = 1; Elcicommon( elp )->ci_nreinits = 0; EVALID( elp ) }}/* Name: ci_log_packet - Log CI Packet Related Events * * Abstract: This routine logs CI packet related events. Such events are * ascertained indirectly from a CI port packet as opposed to * those events detected directly from a specific local CI port. * The event is also optionally logged to the console. * * Five classes of events are currently logged by this routine: * * 1. Hardware detected errors during port command processing. * 2. Software detected invalid remote port states. * 3. Sofware detected invalid CI packet port numbers. * 4. All changes in cable states. * 5. Reception of packets over software non-existent paths. * * Many of these events represent serious errors and are logged to * save relevant information before drastic steps are attempted to * resolve them. Others are less serious and are logged only to * give a warning or for informational purposes only. * * NOTE: While all events logged therein arise indirectly from CI * port packets, the logging of each event does not * necessarily involve logging of the packet itself. * * NOTE: This routine does NOT log events arising external to the * CI port driver with the exception of those CI PPD events * which are candidates for application of the local port * crash severity modifier( ESM_LPC ). * * Inputs: * * IPL_SCS - Interrupt processor level * cibp - Address of CI port header( OPTIONAL ) * event - Event code * event_type - PATH_EVENT, LPORT_EVENT, RPORT_EVENT * lscs - Local system permanent information * pb - Path Block pointer( OPTIONAL ) * pccb - Port Command and Control Block pointer * * Outputs: * * IPL_SCS - Interrupt processor level * pccb - Port Command and Control Block pointer * lpinfo.nerrs - Number of errors on port * * SMP: The PCCB is locked( EXTERNALLY ) to synchronize access, to * prevent premature PB deletion when a PB is provided, and as * required by ci_console_log(), the routine responsible for * logging events to the console terminal. * * PBs do NOT require locking when provided because only static * fields are accessed. SBs NEVER require locking. */voidci_log_packet( pccb, pb, cibp, event, event_type ) register PCCB *pccb; register PB *pb; GVPH *cibp; register u_long event; u_long event_type;{ register struct el_rec *elp; register u_long opt_size; register u_long severity = Eseverity( event ); /* The steps involved in logging packet related events include: * * 1. Logging the event to the console. * 2. Incrementing the counter of local port errors. * 3. Computing the size of the application portion of the event log * record. * 4. Allocating an event log record and initializing the record's sub id * packet fields. * 5. Initializing the portion of the record common to all CI events. * 6. Initializing the portion of the record common to all CI packet * related events. * 7. Moving any optional logged packet information into the record. * 8. Validating the event log record. * * The ability of this routine to log the event is validated during console * logging( Step 1 ). A panic occurs whenever the CI port driver is not * prepared to log the reported event. * * Not all events increment the counter of errors which have occurred on * the specified local port( Step 2 ). Only those events with severity * level equal to or greater than error( ES_E ) increment the counter. * * This routine immediately terminates on failure to allocate an event log * record( Step 4 ). * * The size of the application portion of each event log record( Step 3 ) * is dependent upon the presence or absence of optional information to be * included within the record( Step 7 ). The following types of mutually * exclusive optional information may be logged: * * 1. The CI port packet responsible for the logged packet related event. * * Optional CI port packets are associated with many different events and * vary widely in size based upon their port operation codes. Such packets * require truncation whenever logging their full size would exceed the * maximum size of an event log record. */ ( void )ci_console_log( pccb, pb, cibp, event, event_type ); if( Eseverity( event ) >= ES_E ) { Event_counter( pccb->lpinfo.nerrs ) } if( ci_errlog > severity && !Test_cloverride( event ) && ci_errlog < SCA_ERRLOG3 ) { return; } { register u_long size = sizeof( struct ci_common ) + sizeof( struct ci_lcommon ); if( cibp ) { opt_size = sizeof( struct ci_packet ); switch( cibp->opcode & 0x3f ) { case SNDDG: case SNDMSG: case DGREC: case MSGREC: opt_size += ( sizeof( GVPPPDH ) + Appl_size( Pd_to_ppd( cibp, pccb ))); break; case SNDDAT: case REQDAT1: case REQDAT0: case REQDAT2: case RETDAT: opt_size += sizeof( SNDDATH ); break; case RETCNF: case CNFREC: case DATREC: case REQID: case SNDRST: opt_size += sizeof( REQIDH ); break; case IDREC: opt_size += sizeof( IDRECH ); break; case SETCKT: opt_size += sizeof( SETCKTH ); break; case SNDSTRT: opt_size += sizeof( SNDSTRTH ); break; case SNDLB: opt_size += sizeof( SNDLBH ); break; case LBREC: opt_size += sizeof( LBRECH ); break; case INVTC: break; default: opt_size += ( sizeof( IDRECH ) - pccb->lpinfo.Ovhd_pd ); break; } if(( size += opt_size ) > EL_MAXAPPSIZE ) { opt_size += ( EL_MAXAPPSIZE - size ); size = EL_MAXAPPSIZE; } } if(( elp = ealloc( size, EL_PRIHIGH )) == EL_FULL ) { return; } LSUBID( elp, ELCT_DCNTL, ELCI_LPKT, pccb->lpinfo.type.hwtype, Ctrl_from_name( p
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -