📄 msiport.h
字号:
/* Event Logging Macros */#define Clog_ftab( tab, event ) \ ( tab[ Eseverity( event )][ Esubclass( event )].ftable + Ecode( event) - 1)#define Clog_maxcode( tab, event ) \ ( tab[ Eseverity( event )][ Esubclass( event )].max_code )#define Clog_tabcode( tab, event ) ( Clog_ftab( tab, event )->fcode )#define Clog_tabmsg( tab, event ) ( Clog_ftab( tab, event )->msg )#define Elmsicmdblk( p ) (( struct msi_cmdblk * )p )#define Elmsicommon( elp ) ( &elp->el_body.elmsi.msicommon )#define Elmsidattn( elp ) \ ( &elp->el_body.elmsi.msitypes.msidattn )#define Elmsilcommon( elp ) \ ( &elp->el_body.elmsi.msitypes.msilpkt.msilcommon )#define Elmsiregs( p ) (( struct msi_regs * )p ) /* Initialization Macros */#define Init_lpdinfo( pccb ) { \ U_long( pccb->Lpidinfo.port_type[ 0 ]) = HPT_SII; \ U_long( pccb->Lpidinfo.portinfo.port_fcn[ 0 ]) = PORT_FCN_MASK; \ pccb->Lpidinfo.portinfo.sys_state.reset_port \ = Scaaddr_lob( pccb->lpinfo.addr ); \ pccb->Lpidinfo.portinfo.sys_state.port_state = PS_ENAB; \ pccb->Lpidinfo.portinfo.port_fcn_ext.maxbodylen \ = sizeof( struct _msipacket ); \}#define Init_portinfo( tpi ) { \ Flushq( tpi->xretryq ) \ tpi->xretrys = 0; \ tpi->xretry_timer = 0; \ tpi->xseqno = 0; \ tpi->rseqno = 0; \ tpi->rpstatus.dip = 0; \ tpi->rpstatus.path = 0; \ tpi->rpstatus.vc = 0; \} /* Local Port Status Bit Macros */#define Lpstatus_active( pccb ) (*( u_long * )&pccb->Lpstatus & MSI_ACTIVE )#define Lpstatus_rfork( pccb ) (*( u_long * )&pccb->Lpstatus & MSI_RFORK )#define Lpstatus_xfork( pccb ) (*( u_long * )&pccb->Lpstatus & MSI_XFORK )#define Clear_rfork( pccb ) { \ *( u_long * )&pccb->Lpstatus &= ~MSI_RFORK; \}#define Clear_xfork( pccb ) { \ *( u_long * )&pccb->Lpstatus &= ~MSI_XFORK; \}#define Set_rfork( pccb ) { \ *( u_long * )&pccb->Lpstatus |= MSI_RFORK; \}#define Set_xfork( pccb ) { \ *( u_long * )&pccb->Lpstatus |= MSI_XFORK; \} /* MSIB Field Macros */#define Dealloc_msib( msibp ) ( msibp->Opt & MSI_BM_DBUF )#define Free_msib( msibp ) ( Dealloc_msib( msibp ) == 0 )#define Vc_msib( msibp ) ( msibp->Opt & MSI_BM_VC )#define Set_discard( msibp ) { \ msibp->Opt |= MSI_BM_DBUF; \}#define Scaaddr_lob( addr ) (*( u_char * )&addr )#define Set_vc( msibp ) { \ msibp->Opt |= MSI_BM_VC; \} /* MSIB Header Formating Macros */#define Format_cnf( msibp, xid ) { \ Move_xctid( xid, msibp->Cnf.xctid ) \}#define Format_id( msibp, xid ) { \ Move_xctid( xid, msibp->Id.xctid ) \ msibp->Id.id = pccb->Lpidinfo; \}#define Format_idreq( msibp ) { \ Zero_xctid( msibp->Idreq.xctid ) \}#define Format_msib( msibp, size, type ) { \ U_long( msibp->Size ) = ( u_long )( size ); \ msibp->Type = ( u_char )( type ); \ U_long( msibp->Msibhpad ) = 0; \}#define Format_msibh( msibp, rport, framelength, flags ) { \ U_long( msibp->Size ) |= ( u_long )( flags ); \ msibp->Rport_addr = ( u_char )( rport ); \ msibp->Framelength = ( framelength ); \}#define Format_msih( msibp, opc ) { \ U_short( msibp->Ph.opcode ) = ( u_short )( opc ); \}#define Format_msippdh( msibp, ppdtype ) { \ (( CIPPDH * )&msibp->Ph )->mtype = ppdtype; \}#define Format_rst( msibp ) { \ Zero_xctid( msibp->Rst.xctid ) \}#define Format_strt( msibp, saddr ) { \ Zero_xctid( msibp->Strt.xctid ) \ Copy_long( &saddr, &msibp->Strt.strt_addr[ 0 ]) \}#define Move_xctid( from, to ) { \ U_short( to[ 0 ]) = U_short( from[ 0 ]); \ U_long( to[ 1 ]) = U_long( from[ 1 ]); \ U_short( to[ 3 ]) = U_short( from[ 3 ]); \}#define Reset_msib( msibp ) { \ msibp->Opt = 0; \ U_long( msibp->Msibhpad ) = 0; \}#define Zero_xctid( xctid ) { \ U_short( xctid[ 0 ]) = 0; \ U_long( xctid[ 1 ]) = 0; \ U_short( xctid[ 3 ]) = 0; \} /* MSIB Header Positioning Macros */#define Ppd_to_pd( pccb, cippdbp ) \ (( MSIB * )(( u_char * )cippdbp - pccb->lpinfo.Ppd_ovhd ))#define Scs_to_pd( pccb, scsbp ) \ (( MSIB * )(( u_char * )scsbp - pccb->lpinfo.Pd_ovhd )) /* MSIB Queue Manipulation Macros *//* SMP: If the specified queue requires locking it must be locked EXTERNAL * to macro invocation. */#define Flushq( q ) { \ register msibq *msibp; \ while(( msibp = q.flink ) != &q ) { \ Remove_msib( Msibp ) \ ( void )msi_dealloc_pkt( Msibp ); \ } \}/* SMP: The PCCB specific COMQH is locked allowing exclusive access to the * corresponding high priority command queue. */#define Flush_comqh( pccb ) { \ Lock_comqh( pccb ) \ Flushq( pccb->Comqh ) \ Unlock_comqh( pccb ) \}/* SMP: The PCCB specific COMQL is locked allowing exclusive access to the * corresponding low priority command queue. */#define Flush_comql( pccb ) { \ Lock_comql( pccb ) \ Flushq( pccb->Comql ) \ Unlock_comql( pccb ) \}/* SMP: The PCCB specific DFREEQ is locked allowing exclusive access to the * corresponding datagram free queue. */#define Flush_dfreeq( pccb ) { \ Lock_dfreeq( pccb ) \ Flushq( pccb->Dfreeq ) \ Unlock_dfreeq( pccb ) \}/* SMP: The PCCB specific MFREEQ is locked allowing exclusive access to the * corresponding message free queue. */#define Flush_mfreeq( pccb ) { \ Lock_mfreeq( pccb ) \ Flushq( pccb->Mfreeq ) \ Unlock_mfreeq( pccb ) \}/* SMP: If the specified queue requires locking it must be locked EXTERNAL * to macro invocation. */#define Insert_msib( msibp, q ) { \ Insert_entry((( msibq * )msibp )->flink, q ) \}/* SMP: The PCCB specific COMQH is locked allowing exclusive access to the * corresponding high priority command queue. */#define Insert_comqh( pccb, msibp ) { \ Lock_comqh( pccb ) \ Insert_msib( msibp, pccb->Comqh ) \ Unlock_comqh( pccb ) \}/* SMP: The PCCB specific COMQL is locked allowing exclusive access to the * corresponding low priority command queue. */#define Insert_comql( pccb, msibp ) { \ Lock_comql( pccb ) \ Insert_msib( msibp, pccb->Comql ) \ Unlock_comql( pccb ) \}/* SMP: The PCCB specific DFREEQ is locked allowing exclusive access to the * corresponding datagram free queue. */#define Insert_dfreeq( pccb, msibp ) { \ Lock_dfreeq( pccb ) \ Insert_msib( msibp, pccb->Dfreeq ) \ Unlock_dfreeq( pccb ) \}/* SMP: The PCCB specific MFREEQ is locked allowing exclusive access to the * corresponding message free queue. */#define Insert_mfreeq( pccb, msibp ) { \ Lock_mfreeq( pccb ) \ Insert_msib( msibp, pccb->Mfreeq ) \ Unlock_mfreeq( pccb ) \}/* SMP: If the queue on which the MSIB is located requires locking it must be * locked EXTERNAL to macro invocation. */#define Remove_msib( msibp ) { \ Remove_entry((( msibq * )msibp )->flink ) \}/* SMP: */#define Remove_comqh( pccb, msibp ) { \ if( pccb->Comqh.flink != &pccb->Comqh ) { \ Lock_comqh( pccb ) \ msibp = pccb->Comqh.flink; \ Remove_msib( Msibp ) \ Unlock_comqh( pccb ) \ } else { \ msibp = NULL; \ } \}/* SMP: */#define Remove_comql( pccb, msibp ) { \ if( pccb->Comql.flink != &pccb->Comql ) { \ Lock_comql( pccb ) \ msibp = pccb->Comql.flink; \ Remove_msib( Msibp ) \ Unlock_comql( pccb ) \ } else { \ msibp = NULL; \ } \}/* SMP: */#define Remove_dfreeq( pccb, msibp ) { \ if( pccb->Dfreeq.flink != &pccb->Dfreeq ) { \ Lock_dfreeq( pccb ) \ msibp = pccb->Dfreeq.flink; \ Remove_msib( Msibp ) \ Unlock_dfreeq( pccb ) \ } else { \ msibp = NULL; \ } \}/* SMP: */#define Remove_mfreeq( pccb, msibp ) { \ if( pccb->Mfreeq.flink != &pccb->Mfreeq ) { \ Lock_mfreeq( pccb ) \ msibp = pccb->Mfreeq.flink; \ Remove_msib( Msibp ) \ Unlock_mfreeq( pccb ) \ } else { \ msibp = NULL; \ } \} /* MSIH Field Macros */#define Lp_msih( ph ) (*( u_long * )&ph & MSIH_LP )#define M_msih( ph ) ((*( u_long * )&ph & MSIH_M ) >> MSIH_M_OFFSET )#define Ns_msih( ph ) (*( u_long * )&ph & MSIH_NS )#define Set_lp( ph ) { \ *( u_long * )&ph |= MSIH_LP; \} /* Miscellaneous Macros */#define Copy_long( from, to ) { \ *( u_short * )to = *( u_short * )from; \ *(( u_short * )to + 1 ) = *(( u_short * )from + 1 ); \}#define Incr_seqno( sn ) { \ if(( sn = ( long )sn + SEQNO_INCR ) & SEQNO_OVERFLOW ) { \ sn = 0; \ } \}#define Quad_align( p ) ((( u_long )p + 0x00000007 ) & ~0x00000007 ) /* Remote Port Status Bit Macros */#define Rpstatus_dip( ppi ) (*( u_long * )&ppi->rpstatus & MSI_RPDIP )#define Rpstatus_path( ppi ) (*( u_long * )&ppi->rpstatus & MSI_RPPATH )#define Rpstatus_vc( ppi ) (*( u_long * )&ppi->rpstatus & MSI_RPVC )#define Clear_rpdip( ppi ) { \ *( u_long * )&ppi->rpstatus &= ~MSI_RPDIP; \}#define Set_rpdip( ppi ) { \ *( u_long * )&ppi->rpstatus |= MSI_RPDIP; \}#define Set_rppath( ppi ) { \ *( u_long * )&ppi->rpstatus |= MSI_RPPATH; \} /* Shorthand Notations */#define Msibp (( MSIB * )msibp )#define Siibp (( SIIBUF * )siibp )#define Comqh pd.msi.comqh#define Comqh_lk pd.msi.comqh_lk#define Comql pd.msi.comql#define Comql_lk pd.msi.comql_lk#define Dfreeq pd.msi.dfreeq#define Dfreeq_lk pd.msi.dfreeq_lk#define Dg_ovhd pd.msi.dg_ovhd#define Dg_size pd.msi.dg_size#define Errlogopt pd.msi.errlogopt#define Lpcinfo pd.msi.lpcinfo#define Lpidinfo pd.msi.lpidinfo#define Lpstatus pd.msi.lpstatus#define Lretdat_cssize pd.msi.lretdat_cssize#define Max_datreq_size pd.msi.max_datreq_size#define Max_dg_size pd.msi.max_dg_size#define Max_id_size pd.msi.max_id_size#define Max_idreq_size pd.msi.max_idreq_size#define Max_msg_size pd.msi.max_msg_size#define Max_sntdat_size pd.msi.max_sntdat_size#define Mfreeq pd.msi.mfreeq#define Mfreeq_lk pd.msi.mfreeq_lk#define Min_datreq_size pd.msi.min_datreq_size#define Min_dg_size pd.msi.min_dg_size#define Min_id_size pd.msi.min_id_size#define Min_idreq_size pd.msi.min_idreq_size#define Min_msg_size pd.msi.min_msg_size#define Min_sntdat_size pd.msi.min_sntdat_size#define Msg_ovhd pd.msi.msg_ovhd#define Msg_size pd.msi.msg_size#define Msicomm Siiregptrs.msicomm#define Msicsr Siiregptrs.msicsr#define Msidcr Siiregptrs.msidcr#define Msidscr Siiregptrs.msidscr#define Msidssr Siiregptrs.msidssr#define Msidstat Siiregptrs.msidstat#define Msiisr3 Siiregptrs.msiisr3 #define Msiidr Siiregptrs.msiidr#define Msiilp Siiregptrs.msiilp#define Msitr Siiregptrs.msitr#define Msitlp Siiregptrs.msitlp#define Pd_ovhd pd.msi.pd_ovhd#define Perport pd.msi.perport#define Pkt_size pd.msi.pkt_size#define Ppd_ovhd pd.msi.ppd_ovhd#define Randomseed pd.msi.randomseed
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -