linux/drivers/scsi/pcmcia/sym53c500_cs.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
*  sym53c500_cs.c	Bob Tracy ([email protected])
*
*  A rewrite of the pcmcia-cs add-on driver for newer (circa 1997)
*  New Media Bus Toaster PCMCIA SCSI cards using the Symbios Logic
*  53c500 controller: intended for use with 2.6 and later kernels.
*  The pcmcia-cs add-on version of this driver is not supported
*  beyond 2.4.  It consisted of three files with history/copyright
*  information as follows:
*
*  SYM53C500.h
*	Bob Tracy ([email protected])
*	Original by Tom Corner ([email protected]).
*	Adapted from NCR53c406a.h which is Copyrighted (C) 1994
*	Normunds Saumanis ([email protected])
*
*  SYM53C500.c
*	Bob Tracy ([email protected])
*	Original driver by Tom Corner ([email protected]) was adapted
*	from NCR53c406a.c which is Copyrighted (C) 1994, 1995, 1996 
*	Normunds Saumanis ([email protected])
*
*  sym53c500.c
*	Bob Tracy ([email protected])
*	Original by Tom Corner ([email protected]) was adapted from a
*	driver for the Qlogic SCSI card written by
*	David Hinds ([email protected]).
*/

#define SYM53C500_DEBUG
#define VERBOSE_SYM53C500_DEBUG

/*
*  Set this to 0 if you encounter kernel lockups while transferring 
*  data in PIO mode.  Note this can be changed via "sysfs".
*/
#define USE_FAST_PIO

/* =============== End of user configurable parameters ============== */

#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/ioport.h>
#include <linux/blkdev.h>
#include <linux/spinlock.h>
#include <linux/bitops.h>

#include <asm/io.h>
#include <asm/dma.h>
#include <asm/irq.h>

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

#include <pcmcia/cistpl.h>
#include <pcmcia/ds.h>
#include <pcmcia/ciscode.h>


/* ================================================================== */

#define SYNC_MODE

/* Default configuration */
#define C1_IMG
#define C2_IMG
#define C3_IMG
#define C4_IMG
#define C5_IMG
#define C7_IMG

/* Hardware Registers: offsets from io_port (base) */

/* Control Register Set 0 */
#define TC_LSB
#define TC_MSB
#define SCSI_FIFO
#define CMD_REG
#define STAT_REG
#define DEST_ID
#define INT_REG
#define SRTIMOUT
#define SEQ_REG
#define SYNCPRD
#define FIFO_FLAGS
#define SYNCOFF
#define CONFIG1
#define CLKCONV
/* #define TESTREG	0x0A */		/* test mode register */
#define CONFIG2
#define CONFIG3
#define CONFIG4
#define TC_HIGH
/* #define FIFO_BOTTOM	0x0F */		/* reserve FIFO byte register */

/* Control Register Set 1 */
/* #define JUMPER_SENSE	0x00 */		/* jumper sense port reg (r/w) */
/* #define SRAM_PTR	0x01 */		/* SRAM address pointer reg (r/w) */
/* #define SRAM_DATA	0x02 */		/* SRAM data register (r/w) */
#define PIO_FIFO
/* #define PIO_FIFO1	0x05 */		/*  */
/* #define PIO_FIFO2	0x06 */		/*  */
/* #define PIO_FIFO3	0x07 */		/*  */
#define PIO_STATUS
/* #define ATA_CMD	0x09 */		/* ATA command/status reg (r/w) */
/* #define ATA_ERR	0x0A */		/* ATA features/error reg (r/w) */
#define PIO_FLAG
#define CONFIG5
/* #define SIGNATURE	0x0E */		/* signature register (r) */
/* #define CONFIG6	0x0F */		/* configuration 6 register (r) */
#define CONFIG7

/* select register set 0 */
#define REG0(x)
/* select register set 1 */
#define REG1(x)

#if SYM53C500_DEBUG
#define DEB
#else
#define DEB(x)
#endif

#if VERBOSE_SYM53C500_DEBUG
#define VDEB
#else
#define VDEB(x)
#endif

#define LOAD_DMA_COUNT(x, count)

/* Chip commands */
#define DMA_OP

#define SCSI_NOP
#define FLUSH_FIFO
#define CHIP_RESET
#define SCSI_RESET
#define RESELECT
#define SELECT_NO_ATN
#define SELECT_ATN
#define SELECT_ATN_STOP
#define ENABLE_SEL
#define DISABLE_SEL
#define SELECT_ATN3
#define RESELECT3
#define TRANSFER_INFO
#define INIT_CMD_COMPLETE
#define MSG_ACCEPT
#define TRANSFER_PAD
#define SET_ATN
#define RESET_ATN
#define SEND_MSG
#define SEND_STATUS
#define SEND_DATA
#define DISCONN_SEQ
#define TERMINATE_SEQ
#define TARG_CMD_COMPLETE
#define DISCONN
#define RECV_MSG
#define RECV_CMD
#define RECV_DATA
#define RECV_CMD_SEQ
#define TARGET_ABORT_DMA

/* ================================================================== */

struct scsi_info_t {};

/*
*  Repository for per-instance host data.
*/
struct sym53c500_data {};

struct sym53c500_cmd_priv {};

enum Phase {};

/* ================================================================== */

static void
chip_init(int io_port)
{}

static void
SYM53C500_int_host_reset(int io_port)
{}

static __inline__ int
SYM53C500_pio_read(int fast_pio, int base, unsigned char *request, unsigned int reqlen)
{}

static __inline__ int
SYM53C500_pio_write(int fast_pio, int base, unsigned char *request, unsigned int reqlen)
{}

static irqreturn_t
SYM53C500_intr(int irq, void *dev_id)
{}

static void
SYM53C500_release(struct pcmcia_device *link)
{} /* SYM53C500_release */

static const char*
SYM53C500_info(struct Scsi_Host *SChost)
{}

static int SYM53C500_queue_lck(struct scsi_cmnd *SCpnt)
{}

static DEF_SCSI_QCMD(SYM53C500_queue)

static int 
SYM53C500_host_reset(struct scsi_cmnd *SCpnt)
{}

static int 
SYM53C500_biosparm(struct scsi_device *disk,
    struct block_device *dev,
    sector_t capacity, int *info_array)
{}

static ssize_t
SYM53C500_show_pio(struct device *dev, struct device_attribute *attr,
		   char *buf)
{}

static ssize_t
SYM53C500_store_pio(struct device *dev, struct device_attribute *attr,
		    const char *buf, size_t count)
{}

/*
*  SCSI HBA device attributes we want to
*  make available via sysfs.
*/
static struct device_attribute SYM53C500_pio_attr =;

static struct attribute *SYM53C500_shost_attrs[] =;

ATTRIBUTE_GROUPS();

/*
*  scsi_host_template initializer
*/
static const struct scsi_host_template sym53c500_driver_template =;

static int SYM53C500_config_check(struct pcmcia_device *p_dev, void *priv_data)
{}

static int
SYM53C500_config(struct pcmcia_device *link)
{} /* SYM53C500_config */

static int sym53c500_resume(struct pcmcia_device *link)
{}

static void
SYM53C500_detach(struct pcmcia_device *link)
{} /* SYM53C500_detach */

static int
SYM53C500_probe(struct pcmcia_device *link)
{} /* SYM53C500_attach */

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();

static const struct pcmcia_device_id sym53c500_ids[] =;
MODULE_DEVICE_TABLE();

static struct pcmcia_driver sym53c500_cs_driver =;
module_pcmcia_driver();