📄 msi_error.c
字号:
( void )cprintf( "( local/remote port: %u/%u, remote ", Scaaddr_lob( pccb->lpinfo.addr ), (( pb ) ? Scaaddr_lob( pb->pinfo.rport_addr ) : pccb->Errlogopt.portnum )); if( pb && pb->sb ) { ( void )cprintf( "system: %8s )\n\t- ", pb->sb->sinfo.node_name ); } else { ( void )cprintf( "system: ? )\n\t- " ); } } break; case LPORT_EVENT: if( severity >= ES_E ) { if( Test_lpc_event( event )) { ( void )cprintf( "port failing, " ); } switch( severity ) { case ES_E: ( void )cprintf( "error( local port %u )\n\t- ", Scaaddr_lob( pccb->lpinfo.addr )); break; case ES_SE: ( void )cprintf( "severe error( local port %u )\n\t- ", Scaaddr_lob( pccb->lpinfo.addr )); break; case ES_FE: ( void )cprintf( "fatal error( local port %u )\n\t- ", Scaaddr_lob( pccb->lpinfo.addr )); break; } } break; } ( void )cprintf( "%s", Clog_tabmsg( msi_cltab, event )); switch( fcode ) { case CF_NONE: ( void )cprintf( "\n" ); break; case CF_RPORT: ( void )cprintf( "( remote port: %u )\n", (( pb ) ? Scaaddr_lob( pb->pinfo.rport_addr ) : pccb->Errlogopt.portnum )); break; case CF_LPORT: ( void )cprintf( "( local port %u )\n", Scaaddr_lob( pccb->lpinfo.addr )); break; case CF_REGS: ( void )cprintf( "\n\t- dscr/dssr/dstat: 0x%04x/0x%04x/0x%04x\n", ( u_long )*pccb->Msidscr, ( u_long )*pccb->Msidssr, ( u_long )*pccb->Msidstat ); break; case CF_PKT: ( void )cprintf( "\n\t- opcode/flags: "); if( msipp ) { ( void )cprintf( "0x%02x/0x%02x\n", ( u_long )msipp->ph.opcode, ( u_long )*( u_char * )&msipp->ph.flags ); } else { ( void )cprintf( "0x??/0x??\n" ); } break; case CF_PKT2: ( void )cprintf( "\n\t- status/dst/src/opcode/flags: "); if( msicmdblkp ) { ( void )cprintf( "0x%04x/0x%02x/0x%02x/", ( u_long )msicmdblkp->status, ( u_long )msicmdblkp->dst, ( u_long )msicmdblkp->src ); } else { ( void )cprintf( "0x????/0x??/0x??/" ); } if( msipp ) { ( void )cprintf( "0x%02x/0x%02x\n", ( u_long )msipp->ph.opcode, ( u_long )*( u_char * )&msipp->ph.flags ); } else { ( void )cprintf( "0x??/0x??\n" ); } break; }}/* Name: msi_disable - Disable Local MSI Port * * Abstract: This routine completely disables a local MSI port. There are * three occasions when this routine is invoked: * * 1. Prior to the initial initialization of a local MSI port. * 2. During crashing of a local MSI port. * 3. During disablement of a local MSI port as part of system * shutdown. * * Inputs: * * IPL_SCS - Interrupt processor level * pccb - Port Command and Control Block pointer * ppd.cippd - CI PPD specific PCCB fields * fsmstatus.online - 0 * * Outputs: * * IPL_SCS - Interrupt processor level * pccb - Port Command and Control Block pointer * pd.msi - MSI specific PCCB fields * lpstatus.active - 0 * siiregptrs - MSI register pointers * msicomm - SII command register * * SMP: No locks are required. However exclusive access to * lpstatus.active, a MSI specific PCCB field, must be guaranteed * EXTERNALLY. It may be guaranteed by locking the PCCB specific * XFP and RFP or by guaranteeing that only the processor * executing this routine has access to it. */voidmsi_disable( pccb ) register PCCB *pccb;{ /* The steps involved in disabling a local MSI port are as follows: * * 1. Reset the SII chip. * 2. Mark the local MSI port inactive. * * Resetting the SII chip( Step 1 ) stops any operation in progress, * disconnects the chip from the DSSI bus, returns all registers to their * default values, and inhibits all access to the SII RAM buffer. Marking * the local MSI port inactive( Step 2 ) disables all future processing by * scheduled XFP, RFP and XFP_TIMER threads. The end result of both these * steps is to drive the local MSI port into a completely quiescent state * allowing for full clean up and eventual local port re-initialization( * except of course in the case where disablement was requested during * system shutdown ). */ *pccb->Msicomm = SIICOM_SIIRESET; pccb->Lpstatus.active = 0;}/* Name: msi_log_badport - Log Bad Port Numbers in MSI Packets * * Abstract: This routine logs bad port numbers in MSI packets. For a port * number within a packet to be considered bad it must exceed the * hardware maximum port number of the specified local port. * * NOTE: This is a mandatory PD routine( Log_badportnum ) for use * by the CI PPD. * * Inputs: * * IPL_SCS - Interrupt processor level * cippdbp - Address of CI PPD header * pccb - Port Command and Control Block pointer * * Outputs: * * IPL_SCS - Interrupt processor level * pccb - Port Command and Control Block pointer * pd.msi - MSI specific PCCB fields * errlogopt.portnum - Remote port station address * * SMP: The PCCB is locked( EXTERNALLY ) as required by * msi_log_packet(), the routine which performs the actual event * logging. */voidmsi_log_badport( pccb, cippdbp ) PCCB *pccb; CIPPDH *cippdbp;{ register MSIB *msibp = Ppd_to_pd( pccb, cippdbp ); pccb->Errlogopt.portnum = msibp->Rport_addr; ( void )msi_log_packet( pccb, NULL, NULL, &msibp->Ph, msibp->Framelength, SE_BADPORTNUM, LPORT_EVENT );}/* Name: msi_log_devattn - Log MSI Device Attention Events * * Abstract: This routine logs MSI device attention events. Such events are * detected directly from a specific local MSI port as opposed to * those events ascertained indirectly from a MSI port packet. * The event is also optionally logged to the console. * * Two classes of events are currently logged by this routine: * * 1. Explicit hardware errors. * 2. Local port initializations. * * 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: This routine does NOT log events arising external to the * MSI port driver. It currently does NOT even log those CI * PPD events which are candidates for application of the * local port crash severity modifier( ESM_LPC ). * * Inputs: * * IPL_SCS - Interrupt processor level * event - Event code * lscs - Local system permanent information * pccb - Port Command and Control Block pointer * pd.msi - MSI specific PCCB fields * save_dssr - Cached DSSI status register contents * save_dstat - Cached data transfer status reg contents * regs - LOG_REGS or LOG_NOREGS * * 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 and as * required by msi_console_log(), the routine responsible for * logging events to the console terminal. */voidmsi_log_devattn( pccb, event, regs ) register PCCB *pccb; register u_long event; u_long regs;{ register u_long size; register u_char *celp; register struct el_rec *elp; register struct sii_regs *siiregs = ( struct sii_regs * )pccb->Siiregs; /* The steps involved in logging device attention 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 MSI events. * 6. Initializing the portion of the record reserved for register * contents. * 7. 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 MSI 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 ). * * Not all device attention events request logging of device registers( * Step 6 ). Sufficient space is reserved within the event log record for * register contents only for those that do. */ ( void )msi_console_log( pccb, NULL, NULL, NULL, event, LPORT_EVENT ); if( Eseverity( event ) >= ES_E ) { Event_counter( pccb->lpinfo.nerrs ) } size = sizeof( struct msi_common ); if( regs == LOG_REGS ) { size += sizeof( struct msi_regs ); } if(( elp = ealloc( size, EL_PRIHIGH )) == EL_FULL ) { return; } LSUBID( elp, ELCT_DCNTL, ELMSI_ATTN, pccb->lpinfo.type.hwtype, Ctrl_from_name( pccb->lpinfo.name ), EL_UNDEF, event ) Elmsicommon( elp )->msi_optfmask1 = 0; Elmsicommon( elp )->msi_optfmask2 = 0; Elmsicommon( elp )->msi_evpktver = MSI_EVPKTVER; U_long( *Elmsicommon( elp )->msi_lpname ) = pccb->lpinfo.name; Move_node( lscs.system.node_name, Elmsicommon( elp )->msi_lname ) Move_scaaddr( lscs.system.sysid, *Elmsicommon( elp )->msi_lsysid ) Move_scaaddr( pccb->lpinfo.addr, *Elmsicommon( elp )->msi_lsaddr ) Elmsicommon( elp )->msi_nerrs = pccb->lpinfo.nerrs; Elmsicommon( elp )->msi_nreinits = pccb->lpinfo.nreinits; if( regs == LOG_REGS ) { celp = ( u_char * )Elmsidattn( elp ); Elmsicommon( elp )->msi_optfmask1 |= MSI_REGS; Elmsiregs( celp )->msi_csr = *pccb->Msicsr; Elmsiregs( celp )->msi_idr = *pccb->Msiidr; Elmsiregs( celp )->msi_slcs = ( u_short )siiregs->sii_msislcs; Elmsiregs( celp )->msi_destat = ( u_short )siiregs->sii_msidestat; Elmsiregs( celp )->msi_tr = *pccb->Msitr; Elmsiregs( celp )->msi_dmctlr = ( u_short )siiregs->sii_msidmctlr; Elmsiregs( celp )->msi_dmlotc = ( u_short )siiregs->sii_msidmlotc; Elmsiregs( celp )->msi_dmaaddrl = ( u_short )siiregs->sii_msidmaddrl; Elmsiregs( celp )->msi_dmaaddrh = ( u_short )siiregs->sii_msidmaddrh; Elmsiregs( celp )->msi_stlp = ( u_short )siiregs->sii_msistlp; Elmsiregs( celp )->msi_tlp = *pccb->Msitlp; Elmsiregs( celp )->msi_ilp = *pccb->Msiilp; Elmsiregs( celp )->msi_dscr = *pccb->Msidscr;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -