📄 msiport.h
字号:
/* @(#)msiport.h 4.3 (ULTRIX) 9/4/90 *//************************************************************************ * * * Copyright (c) 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 * Mayfair Storage Interconnect Port Driver * * Abstract: This module contains Mayfair Storage Interconnect Port * Driver( MSI ) constants; data structure, port command, * and register definitions; and macros. * * Creator: Todd M. Katz Creation Date: December 06, 1988 * * Modification History: * * 05-Jul-1990 Pete Keilty * Changed ST_NACK_IS_ACK from 0x8080 to 0x8008 false NACK indicator. * * 29 May 90 -- chet * Changed Setup_dmap macro to allow unmapped io addresses * * 06-Feb-1990 Pete Keilty * Changed Rreceive_abort check to only look for the low two bits of * the REQ/ACK field as described by DSSI spec. * * 11-Jul-1989 Pete Keilty * Added new macro Xsii_busy( pccb ) for checking DSCR_OUT and * Msiisr3 state bits. * * 9-Jul-1989 Stephen W. Bailey SWBXXXX * Added bit definitions and reference macro for Msiisr3 (the SII Main * Control Diagnostic Register) necessary to fix race conditions with ILP, * TLP and packet STATUS word for packets in the IL. * * 16-Jun-1989 Pete Keilty * Add the new system smp locking primitives. * * 10-Jun-1989 Pete Keilty * Add IPL raising to Xfp_started and Rfp_started macro's. * * 13-May-1989 Todd M. Katz TMK0002 * Synchronize GVPBDDB( GVP Buffer Descriptor Database Header ) template * to the updated structure definition required for full SMP support. * * 16-Mar-1989 Todd M. Katz TMK0001 * 1. It is not necessary to specially mark MSIB buffers being * re-transmitted. Therefore, eliminate the constants MSI_BM_RETRY and * MSI_RETRY; the macros Retry_msib() and Set_retry(); and use of * Set_retry() within the macro Xretry_xmt(). * 2. Modify the macro Xdelay_xmts() to reset the framelength of all local * RETDAT packets to the size of just the overhead portion of a RETDAT * packet. This is the value which must be within this field when the * packet is not actually being transmitted. * 3. Modify the macro Xfp_timer_started() to appropriately set the IPL. *//* MSI Constants. */ /* Console Logging Format Codes */ /* 0 - No optional information logged*/ /* 1 - CI PPD special format code */ /* 2 - CI PPD special format code */ /* 3 - CI PPD special format code */ /* 4 - CI PPD special format code */ /* 5 - Rem port station addr logged */#ifdef KERNEL#include "../h/ansi_compat.h"#else#include <ansi_compat.h>#endif#define CF_LPORT 6 /* Local port station address logged */#define CF_REGS 7 /* Port registers logged */#define CF_PKT 8 /* MSI packet fields logged */#define CF_PKT2 9 /* MSI packet/cmdblock fields logged */ /* Device Attention Logging Modifiers*/#define LOG_NOREGS 0 /* Do not log device registers */#define LOG_REGS 1 /* Log device registers */ /* MSI Informational Event Codes *//* MSI informational events are always local port specific. There are * currently no remote port or path specific MSI informational events. * msi_log_devattn(), msi_console_log(), msl_cli[], and msi_cltab[][] must be * updated to reflect new additions. * * The following MSI informational events are local port specific but may NOT * have the local port crash severity modifier( ESM_LPC ) applied: * * LPORT_INIT, LPORT_REINIT * * NOTE: Local port specific MSI informational events are never candidates for * application of the local port crash severity modifier( ESM_LPC ). * * NOTE: Choose an appropriate console formatting code( CF ) which includes * displaying of the local port station address when updating msi_cli[] * with a new local port specific CI informational event. */#define I_LPORT_INIT ( PDI | 0x01 ) /* Initial local port initialization */#define I_LPORT_REINIT ( PDI | 0x02 ) /* Local MSI port initialization */ /* MSI Warning Event Codes *//* No codes are defined because MSI currently never defines any warning events. */ /* MSI Remote Error Event Codes *//* MSI remote error events are always remote port specific. There are * currently no local port or path specific MSI remote error events. * msi_console_log(), msi_log_packet(), msi_clre[], and msi_cltab[][] must be * updated to reflect new additions. * * The following MSI remote error events are remote port specific: * * RPORTSTATE * * NOTE: Choose an appropriate console formatting code( CF ) which includes * displaying of the remote port station address when updating msi_clre[] * with a new MSI remote error event. */#define RE_RPORTSTATE ( PDRE | 0x01 ) /* Remote port in invalid state */ /* MSI Error Event Codes *//* MSI error events are either local port or path specific. There are * currently no remote port specific MSI error events. msi_log_packet(), * msi_console_log(), msi_cle[], and msi_cltab[][] must be updated to reflect * new additions. * * The following MSI error events are local port specific but may NOT have the * local port crash severity modifier( ESM_LPC ) applied: * * INVSRCADDR * * The following MSI error events are path specific but may NOT have the path * crash severity modifier( ESM_PC ) applied: * * NOPATH, RPORTSTATE * * Path specific information is always displayed by default during console * logging of path specific MSI error events. The local port station address * is always displayed by default during console logging of local port specific * MSI error events. * * NOTE: Path and local port specific MSI error events are NEVER candidates for * application of the path( ESM_PC ) or local port( ESM_LPC ) crash * severity modifiers. * * NOTE: When updating msi_cle[] with a new MSI error event bear in mind the * information displayed by default when choosing an appropriate console * formatting code( CF ). */#define E_NOPATH ( PDE | 0x01 ) /* Closing vc due to exhausted retrys*/#define E_RPORTSTATE ( PDE | 0x02 ) /* Remote port in invalid state */#define E_INVSRCADDR ( PDE | 0x03 ) /* Invalid source port station addr */ /* MSI Severe Error Event Codes *//* MSI severe error events are either local port or path specific. There are * currently no remote port specific MSI severe error events. * msi_console_log(), msi_clse[], and msi_cltab[][] must be updated to reflect * new additions. Either msi_log_devattn() or msi_log_packet() must be updated * when a new local port specific MSI severe error event is added, depending * upon the nature of the event. msi_log_packet() must be updated when a new * path specific MSI severe error event is added. msi_crash_lport() also * requires updating when the new addition is a candidate for application of * the local port crash severity modifier( ESM_LPC ). * * The following MSI severe error events are local port specific and may have * the local port crash severity modifier( ESM_LPC ) applied: * * MFQE, INVBNAME, INVBSIZE, BUSERROR, SWA, IMODE, TMODE * * The following MSI severe error events are local port specific but may NOT * have the local port crash severity modifier( ESM_LPC ) applied: * * BADPORTNUM * * The following MSI severe error events are path specific but may NOT have the * path crash severity modifier( ESM_PC ) applied: * * UNKOPCODE, INVOPCODE, INVRPKTSIZE, OSEQMSG * * Path specific information is always displayed by default during console * logging of path specific MSI severe error events. The local port station * address is always displayed by default during console logging of local port * specific MSI severe error events. * * NOTE: Path specific MSI severe error events are NEVER candidates for * application of the path crash severity modifier( ESM_PC ). Not all * local port specific MSI severe error events are candidates for * application of the local port crash severity modifier( ESM_LPC ). * * NOTE: When updating msi_clse[] with a new MSI severe error event bear in * mind the information displayed by default when choosing an appropriate * console formatting code( CF ). */#define SE_BADPORTNUM ( PDSE | 0x01 ) /* Invalid port number encountered */#define SE_UNKOPCODE ( PDSE | 0x02 ) /* Unknown opcode in packet */#define SE_INVOPCODE ( PDSE | 0x03 ) /* Invalid opcode in packet */#define SE_INVRPKTSIZE ( PDSE | 0x04 ) /* received invalid sized packet */#define SE_OSEQMSG ( PDSE | 0x05 ) /* Out-of-sequenced message received */#define SE_MFQE ( PDSE | 0x06 ) /* Message free queue exhausted */#define SE_INVBNAME ( PDSE | 0x07 ) /* Invalid local buffer name */#define SE_INVBSIZE ( PDSE | 0x08 ) /* Local buffer length violation */#define SE_BUSERROR ( PDSE | 0x09 ) /* DSSI bus error reported */#define SE_SWA ( PDSE | 0x0A ) /* SII chip selected with attention */#define SE_IMODE ( PDSE | 0x0B ) /* SII chip selected non-DSSI device */#define SE_TMODE ( PDSE | 0x0C ) /* SII chip selected by non-DSSI dev */ /* MSI Fatal Error Event Codes *//* MSI fatal error events are always local port specific. There are currently * no path or remote port specific MSI fatal error events. msi_log_initerr(), * msi_clfe[], and msi_cltab[][] must be updated to reflect new additions. * * The following NSI fatal error events are local port specific but may NOT * have the local port crash severity modifier( ESM_LPC ) applied: * * INIT_ZEROID, INIT_NOMEM, INIT_NOPTES * * The local port station address is displayed by default during console * logging of all MSI fatal error events. * * NOTE: Local port specific MSI fatal error events may occur only during * initial probing of local MSI ports. * * NOTE: Local port specific MSI fatal error events are never candidates for * application of the local port crash severity modifier( ESM_LPC ). * * NOTE: Local port specific MSI fatal error events are always assigned the * console logging format code CF_NONE. They never display variable * information. This is because currently all such events are fully * logged by msi_log_initerr(). msi_console_log() is never invoked to * log them to the console. */#define FE_INIT_ZEROID ( PDFE | 0x01 ) /* Init - zero system id number */#define FE_INIT_NOMEM ( PDFE | 0x02 ) /* Init - insufficient memory */#define FE_INIT_NOPTES ( PDFE | 0x03 ) /* Init - insufficient ptes */ /* Port Driver Panic Strings */#define PANIC_PCCBFB "msi\t- invalid pccb fork block\n"#define PANIC_REQLPC "msi\t- panic requested on all local port failures\n"#define PANIC_RETDAT "msi\t- invalid transmit fork process retdat packet\n"#define PANIC_RFPFB "msi\t- invalid receive fork process fork block\n"#define PANIC_UNKCF "msi\t- unknown console logging formatting code\n"#define PANIC_UNKCODE "msi\t- unknown/invalid event code\n"#define PANIC_UNKLPC "msi\t- unknown/invalid local port crash reason\n"#define PANIC_XFPFB "msi\t- invalid transmit fork process fork block\n"#define PANIC_XFP_TIMER "msi\t- broken transmit fork process timer\n" /* Timer/Random Number Generator */ /* Constants */#define RANDOM_BASE 69069 /* Random retry delay timer base num */#define TIMER_UNITS 1 /* XFP_TIMER is 10 msec intrval timer*/ /* Transmit retry constants */#define IMMED_RETRYS 8 /* Maximum number immediate retries */#define MAX_RETRYS 512 /* Maximum number retries *//* MSI Port Specific Constants. */ /* Functionality Bit Mask */ /* Supported port states */#define STATE_ENABLED 0x80000000 /* Enabled port state */ /* Send - Receive supported pkts */#define MSG_MSG 0x02000000 /* MSG MSG */#define CNF_SNTDAT 0x00800000 /* CNF SNTDAT */#define RETDAT_DATREQ0 0x00080000 /* RETDAT DATREQ0 */#define RETDAT_DATREQ1 0x00040000 /* RETDAT DATREQ1 */#define RETDAT_DATREQ2 0x00020000 /* RETDAT DATREQ2 */#define IDREQ_ID 0x00010000 /* IDREQ ID */#define SND_RST 0x00000800 /* RST */#define SND_STRT 0x00000400 /* STRT */#define PORT_FCN_MASK 0x828F0C00 /* Full bit mask */ /* Miscellaneous Constants */#define ADDR_SHIFT 2 /* Nbits to >> when comp thread addrs*/#define MAX_CABLES 1 /* Maximum cable number */ /* Packet Field Size Constants */ /* ( Quadword sized entities ) */#define MAX_DATA_SIZE 4096 /* Maximum size of transfered data */#define MAX_DG_SIZE 4096 /* Max size of datagram text( 4089 ) */#define MAX_MSG_SIZE 4096 /* Max size of seq msg text( 4089 ) */ /* Sequence Number Constants */ /* ( Sequence nums occupy bits: 9-11)*/#define SEQNO_INCR 0x00000200 /* Sequence number incrementor */#define SEQNO_OVERFLOW 0x00001000 /* Sequence number overflow bit *//* MSI Register Definitions. */struct sii_regs{ u_long sii_msidr0; /* MSI Diag. Register 0 */ u_long sii_msidr1; /* MSI Diag. Register 1 */ u_long sii_msidr2; /* MSI Diag. Register 2 */ u_long sii_msicsr; /* MSI Control and Status register. */ u_long sii_msiid; /* MSI ID register. */ u_long sii_msislcs; /* MSI Selector control/status */ u_long sii_msidestat; /* MSI Selection detection status */ u_long sii_msitr; /* MSI Timeout Register. */ u_long sii_msidata; /* MSI Data register */ u_long sii_msidmctlr; /* MSI DMA control register */ u_long sii_msidmlotc; /* MSI DMA length to xfer */ u_long sii_msidmaddrl; /* MSI DMA address pointer */ u_long sii_msidmaddrh; /* MSI DMA address pointer */ u_long sii_msidmabyte; /* MSI DMA initial byte */ u_long sii_msistlp; /* MSI Short Target List Pointer */ u_long sii_msiltlp; /* MSI Long Target List Pointer */ u_long sii_msiilp; /* MSI Initiator List Pointer */ u_long sii_msicr; /* MSI (DSSI) Controll Register */ u_long sii_msisr; /* MSI (DSSI) Status Register */ u_long sii_msidstat; /* Data interupt control Register */ u_long sii_msicomm; /* MSI Command Register */ u_long sii_msidcr; /* MSI Diag. Control Register */ u_long sii_mscccr; /* MSI Clock Control Register */ u_long sii_msiisr0; /* MSI Internal State Register 0 */ u_long sii_msiisr1; /* MSI Internal State Register 1 */ u_long sii_msiisr2; /* MSI Internal State Register 2 */ u_long sii_msiisr3; /* MSI Internal State Register 3 */};struct siibuf{ u_long siibuf_msirb[32768]; /* MSI Buffer RAM */}; /* Control/Status Register Mask Bits */#define MSICSR_IE 0x00000001 /* Enable interrupts */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -