linux/drivers/scsi/a100u2w.h

/*
 * Initio A100 device driver for Linux.
 *
 * Copyright (c) 1994-1998 Initio Corporation
 * All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; see the file COPYING.  If not, write to
 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * Revision History:
 * 06/18/98 HL, Initial production Version 1.02
 * 12/19/98 bv, Use spinlocks for 2.1.95 and up
 * 06/25/02 Doug Ledford <[email protected]>
 *	 - This and the i60uscsi.h file are almost identical,
 *	   merged them into a single header used by both .c files.
 * 14/06/07 Alan Cox <[email protected]>
 *	 - Grand cleanup and Linuxisation
 */

#define inia100_REVID

#if 1
#define ORC_MAXQUEUE
#define ORC_MAXTAGS
#else
#define ORC_MAXQUEUE
#define ORC_MAXTAGS
#endif

#define TOTAL_SG_ENTRY
#define MAX_TARGETS
#define IMAX_CDB
#define SENSE_SIZE

/************************************************************************/
/*              Scatter-Gather Element Structure                        */
/************************************************************************/
struct orc_sgent {};

/* SCSI related definition                                              */
#define DISC_NOT_ALLOW
#define DISC_ALLOW


#define ORC_OFFSET_SCB
#define ORC_MAX_SCBS
#define MAX_CHANNELS
#define MAX_ESCB_ELE
#define TCF_DRV_255_63

/********************************************************/
/*      Orchid Host Command Set                         */
/********************************************************/
#define ORC_CMD_NOP
#define ORC_CMD_VERSION
#define ORC_CMD_ECHO
#define ORC_CMD_SET_NVM
#define ORC_CMD_GET_NVM
#define ORC_CMD_GET_BUS_STATUS
#define ORC_CMD_ABORT_SCB
#define ORC_CMD_ISSUE_SCB

/********************************************************/
/*              Orchid Register Set                     */
/********************************************************/
#define ORC_GINTS
#define QINT
#define ORC_GIMSK
#define MQINT
#define ORC_GCFG
#define EEPRG
#define ORC_GSTAT
#define WIDEBUS
#define ORC_HDATA
#define ORC_HCTRL
#define SCSIRST
#define HDO
#define HOSTSTOP
#define DEVRST
#define ORC_HSTUS
#define HDI
#define RREADY
#define ORC_NVRAM
#define SE2CS
#define SE2CLK
#define SE2DO
#define SE2DI
#define ORC_PQUEUE
#define ORC_PQCNT
#define ORC_RQUEUE
#define ORC_RQUEUECNT
#define ORC_FWBASEADR

#define ORC_EBIOSADR0
#define ORC_EBIOSADR1
#define ORC_EBIOSADR2
#define ORC_EBIOSDATA

#define ORC_SCBSIZE
#define ORC_SCBBASE0
#define ORC_SCBBASE1

#define ORC_RISCCTL
#define PRGMRST
#define DOWNLOAD
#define ORC_PRGMCTR0
#define ORC_PRGMCTR1
#define ORC_RISCRAM

struct orc_extended_scb {};

/***********************************************************************
		SCSI Control Block

		0x40 bytes long, the last 8 are user bytes
************************************************************************/
struct orc_scb {};

/* Opcodes of ORCSCB_Opcode */
#define ORC_EXECSCSI
#define ORC_BUSDEVRST

/* Status of ORCSCB_Status */
#define ORCSCB_COMPLETE
#define ORCSCB_POST

/* Bit Definition for ORCSCB_Flags */
#define SCF_DISINT
#define SCF_DIR
#define SCF_NO_DCHK
#define SCF_DIN
#define SCF_DOUT
#define SCF_NO_XF
#define SCF_POLL

/* Error Codes for ORCSCB_HaStat */
#define HOST_SEL_TOUT
#define HOST_DO_DU
#define HOST_BUS_FREE
#define HOST_BAD_PHAS
#define HOST_INV_CMD
#define HOST_SCSI_RST
#define HOST_DEV_RST


/* Error Codes for ORCSCB_TaStat */
#define TARGET_CHK_COND
#define TARGET_BUSY
#define TARGET_TAG_FULL


/***********************************************************************
		Target Device Control Structure
**********************************************************************/

struct orc_target {};

/* Bit Definition for TCF_DrvFlags */
#define TCS_DF_NODASD_SUPT
#define TCS_DF_NOSCSI_SUPT


/***********************************************************************
              Host Adapter Control Structure
************************************************************************/
struct orc_host {};

/* Bit Definition for HCS_Flags */

#define HCF_SCSI_RESET
#define HCF_PARITY
#define HCF_LVDS

/* Bit Definition for TargetFlag */

#define TCF_EN_255
#define TCF_EN_TAG
#define TCF_BUSY
#define TCF_DISCONNECT
#define TCF_SPIN_UP

/* Bit Definition for HCS_AFlags */
#define HCS_AF_IGNORE
#define HCS_AF_DISABLE_RESET
#define HCS_AF_DISABLE_ADPT

struct orc_nvram {};

/* Bios Configuration for nvram->BIOSConfig1                            */
#define NBC_BIOSENABLE
#define NBC_CDROM
#define NBC_REMOVABLE

/* Bios Configuration for nvram->BIOSConfig2                            */
#define NBB_TARGET_MASK
#define NBB_CHANL_MASK

/* Bit definition for nvram->SCSIConfig                                 */
#define NCC_BUSRESET
#define NCC_PARITYCHK
#define NCC_LVDS
#define NCC_ACTTERM1
#define NCC_ACTTERM2
#define NCC_AUTOTERM

/* Bit definition for nvram->TargetxConfig                              */
#define NTC_PERIOD
#define NTC_1GIGA
#define NTC_NO_SYNC
#define NTC_NO_WIDESYNC
#define NTC_DISC_ENABLE
#define NTC_SPINUP

/* Default NVRam values                                                 */
#define NBC_DEFAULT
#define NCC_DEFAULT
#define NCC_MAX_TAGS
#define NCC_RESET_TIME
#define NTC_DEFAULT