📄 cippd.h
字号:
* console formatting code( CF ). */#define E_TALKDOWN ( PPDE | 0x01 ) /* PPD refuses to talk down */#define E_ALLOCFAIL ( PPDE | 0x02 ) /* Insufficient mem to establish path*/#define E_NORETRIES ( PPDE | 0x03 ) /* Transmission retries exhausted */#define E_PD ( PPDE | 0x04 ) /* Port driver requested path failure*/#define E_RHOST ( PPDE | 0x05 ) /* Remote host requested path failure*/#define E_RRESTARTPATH ( PPDE | 0x06 ) /* Rem CI PPD req path re-establish */#define E_MAX_PPD E_RRESTARTPATH /* Maximum CI PPD error event code */ /* CI PPD Severe Error Event Codes *//* CI PPD severe error events are either local port or path specific. There * are currently no remote port or system specific CI PPD severe error events. * cippd_conlog(), cippd_clse[], cippd_cltab[][], and cippd_map_spc[] must be * updated to reflect new additions. cippd_log_path() must be updated when a * new path specific CI PPD severe error event is added. PD logging data * structures may also require updating even though path specific CI PPD severe * error events are only logged by the CI PPD. The need for such updating is * local port specific. All PD logging routines and data structures must be * updated when a new local port specific CI PPD severe error event is added. * This is because CI PPD local port specific events are never logged by the CI * PPD. They are always logged within the port driver appropriate to the * specific local port. PD local port crashing routines may also require * updating when new local port specific CI PPD severe events are added. The * need for such updating is local port specific. * * The following CI PPD severe error events are local port specific and may * have the local port crash severity modifier( ESM_LPC ) applied by the * appropriate port driver specific routine: * * NOPATH, PPDSANITY * * The following CI PPD severe error events are path specific and may have the * path crash severity modifier( ESM_PC ) applied: * * PD, BADPPDMTYPE * * The following CI PPD severe error events are path specific but may NOT have * the path crash severity modifier( ESM_PC ) applied: * * PPDPROTOCOL * * Path specific information is always displayed by default during console of * logging of path specific CI PPD severe error events. The local port station * address is always displayed by default during console logging of local port * specific CI PPD severe error events by the appropriate port drivers. * * NOTE: Not all path specific CI PPD severe error events are candidates for * application of the path crash severity modifier( ESM_PC ). Local port * specific CI PPD severe error events are ( currently ) always * candidates for application of the local port crash severity modifier( * ESM_LPC ). * * NOTE: Update cippd_map_spc[] with a NULL entry whenever a new CI PPD severe * error event is local port specific and can never have the path crash * severity modifier( ESM_PC ) applied; or, is path specific but is not a * candidate for application of this severity modifier. * * NOTE: Update cippd_clse[] with a NULL entry whenever a new CI PPD severe * error event is local port specific. Such events are only logged on * behalf of the CI PPD by port drivers. They are never directly logged * by the CI PPD. Likewise, update PD console logging format tables with * NULL entries whenever a new CI PPD severe error event is path * specific. Such events are always directly logged by the CI PPD and * are never logged by individual port drivers. * * NOTE: The CI PPD may NOT directly request PD logging of local port specific * CI PPD severe error events. It can only indirectly request their * logging by attempting to crash the specific local port through * invocation of the appropriate PD specific local port crashing routine( * Crash_lport ). * * NOTE: When updating cippd_clse[] with a new CI PPD severe error event bear * in mind the information displayed by default when choosing an * appropriate console formatting code( CF ). */#define SE_PPDPROTOCOL ( PPDSE | 0x01 ) /* PPD protocol violation occurred */#define SE_PD ( PPDSE | 0x02 ) /* Port driver requested path failure*/#define SE_NOPATH ( PPDSE | 0x03 ) /* Attempted crash nonexistent path */#define SE_PPDSANITY ( PPDSE | 0x04 ) /* CI PPD sanity check failed */#define SE_BADPPDMTYPE ( PPDSE | 0x05 ) /* Unsupported CI PPD message type */#define SE_MAX_PPD SE_BADPPDMTYPE /* Max CI PPD severe error event code*/ /* CI PPD Fatal Error Event Codes *//* No codes are defined because the CI PPD currently never defines any fatal * error events. */ /* Common Sys Level Logging Options */#define CLEAR 0 /* Clear system level logging bit */#define SET 1 /* Test-Set system level logging bit *//* CI PPD Data Structures. */typedef struct _cippd_atab { /* CI PPD Action Function Sets */ u_long flags; /* Action function flags */#define CIPPD_NOSTATUS 0 /* Action function NOT return value */#define CIPPD_STATUS 1 /* Action function returns u_long */ u_long ( *action )(); /* Action function address */} CIPPD_ATAB;typedef struct _cippd_slibq { /* CIPPD_SLIB Queue Pointers */ struct _cippd_slibq *flink; /* Forward queue link */ struct _cippd_slibq *blink; /* Backward queue link */} cippd_slibq; /* CI PPD System Level Event Logging */typedef struct _cippd_slib { /* Information Block */ struct _cippd_slibq *flink; /* CI PPD system level logging event */ struct _cippd_slibq *blink; /* information database queue ptrs */ u_short size; /* Size of data structure */ u_char type; /* Structure type */ u_char : 8; u_long log_flags; /* Event logging flags */#define SWTYPE 0x00000001 /* Log unsupported rem sys sw type */#define TALKUP 0x00000002 /* Log attempt to talk up */#define TALKDOWN 0x00000004 /* Log refusal to talk down */ u_char node_name[ NODENAME_SIZE ];/* SCA node name */} CIPPD_SLIB; /* CI PPD State Transition Table */typedef struct _cippd_stab { /* Entry */ struct _cippd_atab *actions; /* Action function set pointer */ u_long fstate; /* New path state on success */} CIPPD_STAB;/* CI PPD Message Definitions. */typedef struct _cippdh { /* CI PPD Buffer Header */ u_short length; /* Length of message/datagram */ u_short mtype; /* PPD message type */} CIPPDH;typedef struct { /* START and STACK Datagrams */ c_scaaddr sysid; /* System identification number */ u_short protocol; /* Protocol version */#define CIPPD_VERSION 1 /* CI PPD protocol version */ u_short max_dg; /* Maximum size of application dg */ u_short max_msg; /* Maximum size of application msg */ u_long swtype; /* Software type */ u_long swver; /* Software version */ u_quad swincrn; /* Software incarnation number */ u_long hwtype; /* Hardware type */ u_dodec hwver; /* Hardware version */ u_char nodename[ 8 ]; /* SCA node name */ u_quad cur_time; /* Current system time */} CIPPD_START, CIPPD_STACK;/* CI PPD Macros. */ /* Mandatory PD Functions for CI PPD */#define Get_port pdt->opt1 /* Retrieve Port Number from Buffer */#define Init_port pdt->opt2 /* Initialize/Re-initialize a Port */#define Log_badportnum pdt->opt3 /* Log PD Originating Bad Port Num */#define Send_reqid pdt->opt4 /* Request Remote Port Identification*/#define Set_circuit pdt->opt5 /* Set Virtual Circuit State - On/Off*/ /* Optional PD Functions for CI PPD */#define Alloc_buf pdt->opt6 /* Allocate Emergency Command Packets*/#define Dealloc_buf pdt->opt7 /* Deallocate Emergency Command Pkts */#define Init_pb pdt->opt8 /* Initialize a Path Block */#define Inv_cache pdt->opt9 /* Invalidate Port Translation Cache */#define Notify_port pdt->opt10 /* Notify Port of CI PPD Activity */#define Test_lportconn pdt->opt11 /* Test Local Port Connectivity */#define Update_ptype pdt->opt12 /* Update Hardware Port Type */ /* Action Function Sets Macros */#define Fn_nostatus( fn ) { CIPPD_NOSTATUS, ( u_long (*)() )fn }#define Fn_status( fn ) { CIPPD_STATUS, ( u_long (*)() )fn }#define End_fnset() { 0, ( u_long (*)() )NULL } /* Bitmap Manipulation Macros *//* SMP: The PCCB must be locked PRIOR to invocation. */#define Mapbyte( map, port ) ( pccb->map[( port / 8 )])#define Mapbit( port ) ( 1 << ( port % 8 ))#define Clear_lpinfomap( map, port ) { \ Mapbyte( lpinfo.map, ( long )port ) &= ~Mapbit(( long )port ); \}#define Clear_map( map, port ) { \ Mapbyte( map, ( long )port ) &= ~Mapbit(( long )port ); \}#define Set_lpinfomap( map, port ) { \ Mapbyte( lpinfo.map, ( long )port ) |= Mapbit(( long )port ); \}#define Set_map( map, port ) { \ Mapbyte( map, ( long )port ) |= Mapbit(( long )port ); \}#define Test_lpinfomap( map, port ) \ ( Mapbyte( lpinfo.map, ( long )port ) & Mapbit(( long )port ))#define Test_map( map, port ) \ ( Mapbyte( map, ( long )port ) & Mapbit(( long )port )) /* CI PPD Datagram Macros */#define Cippd_stack( bp ) (( CIPPD_STACK * )bp )#define Cippd_start( bp ) (( CIPPD_START * )bp ) /* CI PPD Event Logging Macros */#define Cippd_clmaxcode( tab, event ) \ ( tab[ Eseverity( event )][ Eclass( event )].max_code )#define Cippd_clftab( tab, event ) \ ( tab[ Eseverity( event )][ Eclass( event )].ftable + Ecode( event ) - 1 )#define Cippd_cltabmsg( tab, event ) ( Cippd_clftab( tab, event )->msg )#define Cippd_cltabcode( tab, event ) ( Cippd_clftab( tab, event )->fcode )#define Elcippdcommon( elp ) ( &elp->el_body.elcippd.cippdcommon )#define Elcippddbcoll( elp ) \ ( &elp->el_body.elcippd.cippdtypes.cippdpath.cippdpathopt.cippddbcoll )#define Elcippdnewpath( elp ) \ ( &elp->el_body.elcippd.cippdtypes.cippdpath.cippdpathopt.cippdnewpath )#define Elcippdpcommon( elp ) \ ( &elp->el_body.elcippd.cippdtypes.cippdpath.cippdpcommon )#define Elcippdppacket( elp ) \ ( &elp->el_body.elcippd.cippdtypes.cippdpath.cippdpathopt.cippdppacket )#define Elcippdprotocol( elp ) \ (&elp->el_body.elcippd.cippdtypes.cippdsystem.cippdsystemopt.cippdprotocol)#define Elcippdscommon( elp ) \ ( &elp->el_body.elcippd.cippdtypes.cippdsystem.cippdscommon )#define Elcippdspacket( elp ) \ ( &elp->el_body.elcippd.cippdtypes.cippdsystem.cippdsystemopt.cippdspacket)#define Elcippdsysapnam( elp ) \ ( &elp->el_body.elcippd.cippdtypes.cippdpath.cippdpathopt.cippd_sysap[ 0 ])/* SMP: TEMP */ /* CI PPD SMP Locking Macros */#define Fetch_time( to, from ) { \ to = from; \}/* PBs must be locked whenever their semaphores are accessed. */#define Decr_pb_sem( pb ) { \ ++pb->Dbiip; \}#define Incr_pb_sem( pb ) { \ --pb->Dbiip; \}#define Test_pb_sem( pb ) ( U_long( pb->Dbiip ) & 0xffff ) /* Scheduling Macros */#define Pb_fork( pb, routine, panstr ) { \ if( !Pb->Fsmpstatus.fkip ) { \ Pb->Fsmpstatus.fkip = 1; \ Kfork( &pb->Forkb, routine, pb ) \ } else { \ ( void )panic( panstr ); \ } \}#define Pb_fork_done( pb, panstr ) { \ if( pb->Fsmpstatus.fkip ) { \ pb->Fsmpstatus.fkip = 0; \ } else { \ ( void )panic( panstr ); \ } \}#define Pccb_fork( pccb, routine, panstr ) { \ if( !pccb->Fsmstatus.fkip ) { \ pccb->Fsmstatus.fkip = 1; \ Kfork( &pccb->forkb, routine, pccb ) \ } else { \ ( void )panic( panstr ); \ } \}#define Pccb_fork_done( pccb, panstr ) { \ if( pccb->Fsmstatus.fkip ) { \ pccb->Fsmstatus.fkip = 0; \ } else { \ ( void )panic( panstr ); \ } \} /* Shorthand Notations */#define Aflogmap ppd.cippd.aflogmap#define Burst ppd.cippd.burst#define Contact ppd.cippd.contact#define Dbclogmap ppd.cippd.dbclogmap#define Dbiip ppd.cippd.dbiip#define Due_time ppd.cippd.due_time#define Elogopt ppd.cippd.elogopt#define Forkb ppd.cippd.forkb#define Fsmpstatus ppd.cippd.fsmpstatus#define Fsmstatus ppd.cippd.fsmstatus#define Form_pb ppd.cippd.form_pb#define Max_cables ppd.cippd.max_cables#define Max_port ppd.cippd.max_port#define Next_port ppd.cippd.next_port#define Nform_paths ppd.cippd.nform_paths#define Npaths ppd.cippd.npaths#define Open_pb ppd.cippd.open_pb#define Poll_due ppd.cippd.poll_due#define Poll_interval ppd.cippd.poll_interval#define Poll_cable ppd.cippd.poll_cable#define Ppddgs ppd.cippd.ppddgs#define Protocol ppd.cippd.protocol#define Retry ppd.cippd.retry#define Sanity_port ppd.cippd.sanity_port#define Slib (( CIPPD_SLIB * )slib )#define Timer_interval ppd.cippd.timer_interval#define Tmologmap ppd.cippd.tmologmap /* Miscellaneous Macros */#define Maxport( pccb ) \ (( cippd_max_port < pccb->lpinfo.Max_port ) \ ? cippd_max_port : pccb->lpinfo.Max_port )#define Pinterval( pccb ) \ ((( pccb->Contact > cippd_itime ) ? pccb->Contact : cippd_itime ) * \ (( pccb->Burst <= ( Maxport( pccb ) + 1 )) \ ? pccb->Burst : ( Maxport( pccb ) + 1 )) / \ ( Maxport( pccb ) + 1 ))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -