📄 espvar.h
字号:
#ident "@(#)espvar.h 1.1 92/07/30 SMI"/* * Copyright (c) 1988-1991 by Sun Microsystems, Inc. */#ifndef _scsi_adapters_espvar_h#define _scsi_adapters_espvar_h/* * Emulex ESP (Enhanced Scsi Processor) Definitions, * Software && Hardware. *//* * Compile options */#define ESPDEBUG /* turn on debugging code */#define ESP_TEST_FAST_SYNC /* turn on fast synch. test code *//* #define ESP_TEST_TIMEOUT /* turn on timeout test code *//* #define ESP_TEST_PARITY /* turn on parity test code *//* #define ESP_NEW_HW_DEBUG /* turn on debug code for new h/w *//* * General SCSI includes */#include <scsi/scsi.h>/* * Include hardware definitions for the ESP generation chips. */#include <scsi/adapters/espreg.h>/* * Software Definitions *//* * Data Structure for this Host Adapter. */struct esp { /* * Configuration information for this host adapter */ /* * This structure must be first. * * Each host adapter will export the address of this structure, * which defines function entry points, as well as a splx() cookie * needed to mask interrupts for this device, to the library. The * library will use the address of this structure to to form * SCSI device addresses- the address of this structure will * be encoded in the 'a_cookie' field of the SCSI device address. * * All requests are defined such that the SCSI address is either * a formal paramter, or contained within a formal parameter. * * Therefore, each function entry in the driver will know that * the 'a_cookie' field points to a transport structure, which * will then allow each function to retrieve a pointer to the * correct softc structure. */ struct scsi_transport e_tran; /* * Next in a linked list of host adapters */ struct esp *e_next; /* * Cross reference to autoconfig structures */#ifdef OPENPROMS struct dev_info *e_dev; /* reference to devinfo structure */#else /* OPENPROMS */ struct mb_driver *e_dev; /* reference to mb_driver structure */#endif /* OPENPROMS */ /* * Unit number */ u_char e_unit; /* * Type byte for this host adapter (53C90, 53C90A, ESP-236) */ u_char e_type; /* * value for configuration register 1. * Also contains Initiator Id. */ u_char e_espconf; /* * value for configuration register 2 (ESP100A) */ u_char e_espconf2; /* * value for configuration register 3 (ESP236) */ u_char e_espconf3[NTARGETS]; /* * differential bus flag */ u_char e_differential; /* * clock conversion register value for this host adapter. * clock cycle value * 1000 for this host adapter, * to retain 5 significant digits. */ u_char e_clock_conv; u_short e_clock_cycle; /* * selection timeout register value */ u_char e_stval; /* * State of the host adapter */ u_char e_state; /* state of the driver */ u_char e_laststate; /* last state of the driver */ u_char e_stat; /* soft copy of status register */ u_char e_intr; /* soft copy of interrupt register */ u_char e_step; /* soft copy of step register */ u_char e_sdtr; /* * Count of sync data negotiation messages: * zeroed for every selection attempt, * every reconnection, and every disconnect * interrupt. Each SYNCHRONOUS DATA TRANSFER * message, both coming from the target, and * sent to the target, causes this tag to be * incremented. This allows the received * message handling to determine whether * a received SYNCHRONOUS DATA TRANSFER * message is in response to one that we * sent. */ /* * Scratch Buffer, allocated out of iopbmap for commands * The same size as the ESP's fifo. */ u_char *e_cmdarea; /* * Message handling: enough space is reserved for the expected length * of all messages we could either send or receive. * * For sending, we expect to send only SYNCHRONOUS extended messages * (5 bytes). We keep a history of the last message sent, and in order * to control which message to send, an output message length is set * to indicate whether and how much of the message area is to be used * in sending a message. If a target shifts to message out phase * unexpectedly, the default action will be to send a MSG_NOP message. * * After the successful transmission of a message, the initial message * byte is moved to the e_last_msgout area for tracking what was the * last message sent. */#define OMSGSIZE 6 u_char e_cur_msgout[OMSGSIZE]; u_char e_last_msgout; u_char e_omsglen; /* * We expect, at, most, to receive a maximum of 7 bytes * of an incoming extended message (MODIFY DATA POINTER), * and thus reserve enough space for that. */#define IMSGSIZE 8 u_char e_imsgarea[IMSGSIZE];#define e_last_msgin e_imsgarea[0] /* * These are used to index how far we've * gone in receiving incoming messages. */ u_char e_imsglen; u_char e_imsgindex; /* * Target information * Synchronous SCSI Information, * Disconnect/reconnect capabilities * Noise Susceptibility */ u_char e_offset[NTARGETS]; /* synchronous offset */ u_char e_period[NTARGETS]; /* synchronous periods */ u_char e_backoff[NTARGETS]; /* synchronous period compensation */ u_char e_default_period; /* default sync period */ u_char e_req_ack_delay; /* req/ack delay on FAS SCSI */#define DEFAULT_REQ_ACK_DELAY_101 0x20 /* delay assert period 1 cycle */#define DEFAULT_REQ_ACK_DELAY_236 0x60 /* delay assert period 1 cycle */ /* * This u_char is a bit map for targets * whose SYNC capabilities are known. */ u_char e_sync_known; /* * This u_char is a bit map for targets who * don't appear to be able to disconnect. */ u_char e_nodisc; /* * This u_char is a bit map for targets * who seem to be susceptible to noise. */ u_char e_weak; /* * This u_char is a bit map for targets * that have been successfully probed * talked to before. */ u_char e_targets; /* * different platforms may support different sbus burst sizes */ u_char e_burstsizes; /* * Instrumentation */ u_long e_npolling; /* number of polling commands stored up */ u_long e_ncmds; /* number of commands stored here at present */ u_long e_ndisc; /* number of disconnected cmds at present */ u_long e_preempt; /* number of times a select was preempted */ u_long e_disconnects; /* number of disconnects */ u_long e_nlinked; /* number of linked commands */ u_long e_nsync; /* number of synchronous scsi data xfers */ /* * Hardware pointers */ /* * Pointer to mapped in ESP registers */ struct espreg *e_reg; /* * Pointer to mapped in DMA Gate Array registers */ struct dmaga *e_dma; u_long e_lastdma; /* last dma address */ u_long e_lastcount; /* last dma count */ /* * DMA base value for this host adapter. * Addresses passed in SCSI command offsets, * if less than mmu_ptob(dvmasize) are offsets * from the base of DVMA[]. The following base * value is or'd in with this to get the true * dma value. */ long e_dma_base; /* * Ugly, and space consumptive, but extremely unambiguous. * * If the slot is NULL, then the Host Adapter believes that * that Target/Lun can accept a command. * * Addressing for using the _slot tags is fixed by (target<<3)|lun. * The value ((short) -1) is reserved to undefine any _slot tag. * */ short e_last_slot; /* last active target/lun */ short e_cur_slot; /* current active target/lun */ /* * 'splx' interrupt mask for the specific target */ int e_spl; struct scsi_cmd * e_slots[NTARGETS*NLUNS_PER_TARGET];#define NPHASE 16#ifdef ESPDEBUG /* * SCSI analyzer function data structures. */ int e_xfer; /* size of current transfer */ short e_phase_index; /* next entry in table */ struct scsi_phases { /* SCSI analyzer structure */ short e_save_state; short e_save_stat; int e_val1, e_val2;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -