linux/drivers/scsi/53c700.h

/* SPDX-License-Identifier: GPL-2.0 */

/* Driver for 53c700 and 53c700-66 chips from NCR and Symbios
 *
 * Copyright (C) 2001 by [email protected]
 */

#ifndef _53C700_H
#define _53C700_H

#include <linux/interrupt.h>
#include <asm/io.h>

#include <scsi/scsi_device.h>
#include <scsi/scsi_cmnd.h>

/* Turn on for general debugging---too verbose for normal use */
#undef	NCR_700_DEBUG
/* Debug the tag queues, checking hash queue allocation and deallocation
 * and search for duplicate tags */
#undef NCR_700_TAG_DEBUG

#ifdef NCR_700_DEBUG
#define DEBUG
#define DDEBUG
#define CDEBUG
#else
#define DEBUG(x)
#define DDEBUG(prefix, scmd, fmt, a...)
#define CDEBUG(prefix, scmd, fmt, a...)
#endif

/* The number of available command slots */
#define NCR_700_COMMAND_SLOTS_PER_HOST
/* The maximum number of Scatter Gathers we allow */
#define NCR_700_SG_SEGMENTS
/* The maximum number of luns (make this of the form 2^n) */
#define NCR_700_MAX_LUNS
#define NCR_700_LUN_MASK
/* Maximum number of tags the driver ever allows per device */
#define NCR_700_MAX_TAGS
/* Tag depth the driver starts out with (can be altered in sysfs) */
#define NCR_700_DEFAULT_TAGS
/* This is the default number of commands per LUN in the untagged case.
 * two is a good value because it means we can have one command active and
 * one command fully prepared and waiting
 */
#define NCR_700_CMD_PER_LUN
/* magic byte identifying an internally generated REQUEST_SENSE command */
#define NCR_700_INTERNAL_SENSE_MAGIC

struct NCR_700_Host_Parameters;

/* These are the externally used routines */
struct Scsi_Host *NCR_700_detect(struct scsi_host_template *,
		struct NCR_700_Host_Parameters *, struct device *);
int NCR_700_release(struct Scsi_Host *host);
irqreturn_t NCR_700_intr(int, void *);


enum NCR_700_Host_State {};

struct NCR_700_SG_List {};

struct NCR_700_Device_Parameters {};


/* The SYNC negotiation sequence looks like:
 * 
 * If DEV_NEGOTIATED_SYNC not set, tack and SDTR message on to the
 * initial identify for the device and set DEV_BEGIN_SYNC_NEGOTIATION
 * If we get an SDTR reply, work out the SXFER parameters, squirrel
 * them away here, clear DEV_BEGIN_SYNC_NEGOTIATION and set
 * DEV_NEGOTIATED_SYNC.  If we get a REJECT msg, squirrel
 *
 *
 * 0:7	SXFER_REG negotiated value for this device
 * 8:15 Current queue depth
 * 16	negotiated SYNC flag
 * 17 begin SYNC negotiation flag 
 * 18 device supports tag queueing */
#define NCR_700_DEV_NEGOTIATED_SYNC
#define NCR_700_DEV_BEGIN_SYNC_NEGOTIATION
#define NCR_700_DEV_PRINT_SYNC_NEGOTIATION

static inline char *NCR_700_get_sense_cmnd(struct scsi_device *SDp)
{}

static inline void
NCR_700_set_depth(struct scsi_device *SDp, __u8 depth)
{}
static inline __u8
NCR_700_get_depth(struct scsi_device *SDp)
{}
static inline int
NCR_700_is_flag_set(struct scsi_device *SDp, __u32 flag)
{}
static inline int
NCR_700_is_flag_clear(struct scsi_device *SDp, __u32 flag)
{}
static inline void
NCR_700_set_flag(struct scsi_device *SDp, __u32 flag)
{}
static inline void
NCR_700_clear_flag(struct scsi_device *SDp, __u32 flag)
{}

enum NCR_700_tag_neg_state {};

static inline enum NCR_700_tag_neg_state
NCR_700_get_tag_neg_state(struct scsi_device *SDp)
{}

static inline void
NCR_700_set_tag_neg_state(struct scsi_device *SDp,
			  enum NCR_700_tag_neg_state state)
{}

struct NCR_700_command_slot {};

struct NCR_700_Host_Parameters {};

/*
 *	53C700 Register Interface - the offset from the Selected base
 *	I/O address */
#ifdef CONFIG_53C700_LE_ON_BE
#define bE
#define bSWAP
#define bEBus
#elif defined(__BIG_ENDIAN)
#define bE
#define bSWAP
#elif defined(__LITTLE_ENDIAN)
#define bE
#define bSWAP
#else
#error "__BIG_ENDIAN or __LITTLE_ENDIAN must be defined, did you include byteorder.h?"
#endif
#ifndef bEBus
#ifdef CONFIG_53C700_BE_BUS
#define bEBus
#else
#define bEBus
#endif
#endif
#define bS_to_cpu(x)
#define bS_to_host(x)

/* NOTE: These registers are in the LE register space only, the required byte
 * swapping is done by the NCR_700_{read|write}[b] functions */
#define SCNTL0_REG
#define FULL_ARBITRATION
#define PARITY
#define ENABLE_PARITY
#define AUTO_ATN
#define SCNTL1_REG
#define SLOW_BUS
#define ENABLE_SELECT
#define ASSERT_RST
#define ASSERT_EVEN_PARITY
#define SDID_REG
#define SIEN_REG
#define PHASE_MM_INT
#define FUNC_COMP_INT
#define SEL_TIMEOUT_INT
#define SELECT_INT
#define GROSS_ERR_INT
#define UX_DISC_INT
#define RST_INT
#define PAR_ERR_INT
#define SCID_REG
#define SXFER_REG
#define ASYNC_OPERATION
#define SODL_REG
#define SOCL_REG
#define SFBR_REG
#define SIDL_REG
#define SBDL_REG
#define SBCL_REG
/* read bits */
#define SBCL_IO
/*write bits */
#define SYNC_DIV_AS_ASYNC
#define SYNC_DIV_1_0
#define SYNC_DIV_1_5
#define SYNC_DIV_2_0
#define DSTAT_REG
#define ILGL_INST_DETECTED
#define WATCH_DOG_INTERRUPT
#define SCRIPT_INT_RECEIVED
#define ABORTED
#define SSTAT0_REG
#define PARITY_ERROR
#define SCSI_RESET_DETECTED
#define UNEXPECTED_DISCONNECT
#define SCSI_GROSS_ERROR
#define SELECTED
#define SELECTION_TIMEOUT
#define FUNCTION_COMPLETE
#define PHASE_MISMATCH
#define SSTAT1_REG
#define SIDL_REG_FULL
#define SODR_REG_FULL
#define SODL_REG_FULL
#define SSTAT2_REG
#define CTEST0_REG
#define BTB_TIMER_DISABLE
#define CTEST1_REG
#define CTEST2_REG
#define CTEST3_REG
#define CTEST4_REG
#define DISABLE_FIFO
#define SLBE
#define SFWR
#define BYTE_LANE0
#define BYTE_LANE1
#define BYTE_LANE2
#define BYTE_LANE3
#define SCSI_ZMODE
#define ZMODE
#define CTEST5_REG
#define MASTER_CONTROL
#define DMA_DIRECTION
#define CTEST7_REG
#define BURST_DISABLE
#define SEL_TIMEOUT_DISABLE
#define DFP
#define EVP
#define CTEST7_TT1
#define DIFF
#define CTEST6_REG
#define TEMP_REG
#define DFIFO_REG
#define FLUSH_DMA_FIFO
#define CLR_FIFO
#define ISTAT_REG
#define ABORT_OPERATION
#define SOFTWARE_RESET_710
#define DMA_INT_PENDING
#define SCSI_INT_PENDING
#define CONNECTED
#define CTEST8_REG
#define LAST_DIS_ENBL
#define SHORTEN_FILTERING
#define ENABLE_ACTIVE_NEGATION
#define GENERATE_RECEIVE_PARITY
#define CLR_FIFO_710
#define FLUSH_DMA_FIFO_710
#define CTEST9_REG
#define DBC_REG
#define DCMD_REG
#define DNAD_REG
#define DIEN_REG
#define BUS_FAULT
#define ABORT_INT
#define INT_INST_INT
#define WD_INT
#define ILGL_INST_INT
#define DCNTL_REG
#define SOFTWARE_RESET
#define COMPAT_700_MODE
#define SCRPTS_16BITS
#define EA_710
#define ASYNC_DIV_2_0
#define ASYNC_DIV_1_5
#define ASYNC_DIV_1_0
#define ASYNC_DIV_3_0
#define DMODE_710_REG
#define DMODE_700_REG
#define BURST_LENGTH_1
#define BURST_LENGTH_2
#define BURST_LENGTH_4
#define BURST_LENGTH_8
#define DMODE_FC1
#define DMODE_FC2
#define BW16 
#define MODE_286
#define IO_XFER
#define FIXED_ADDR

#define DSP_REG
#define DSPS_REG

/* Parameters to begin SDTR negotiations.  Empirically, I find that
 * the 53c700-66 cannot handle an offset >8, so don't change this  */
#define NCR_700_MAX_OFFSET
/* Was hoping the max offset would be greater for the 710, but
 * empirically it seems to be 8 also */
#define NCR_710_MAX_OFFSET
#define NCR_700_MIN_XFERP
#define NCR_710_MIN_XFERP
#define NCR_700_MIN_PERIOD

#define script_patch_32(h, script, symbol, value)

#define script_patch_32_abs(h, script, symbol, value)

/* Used for patching the SCSI ID in the SELECT instruction */
#define script_patch_ID(h, script, symbol, value)

#define script_patch_16(h, script, symbol, value)


static inline __u8
NCR_700_readb(struct Scsi_Host *host, __u32 reg)
{}

static inline __u32
NCR_700_readl(struct Scsi_Host *host, __u32 reg)
{}

static inline void
NCR_700_writeb(__u8 value, struct Scsi_Host *host, __u32 reg)
{}

static inline void
NCR_700_writel(__u32 value, struct Scsi_Host *host, __u32 reg)
{}

#endif