linux/drivers/scsi/wd719x.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Driver for Western Digital WD7193, WD7197 and WD7296 SCSI cards
 * Copyright 2013 Ondrej Zary
 *
 * Original driver by
 * Aaron Dewell <[email protected]>
 * Gaerti <[email protected]>
 *
 * HW documentation available in book:
 *
 * SPIDER Command Protocol
 * by Chandru M. Sippy
 * SCSI Storage Products (MCP)
 * Western Digital Corporation
 * 09-15-95
 *
 * http://web.archive.org/web/20070717175254/http://sun1.rrzn.uni-hannover.de/gaertner.juergen/wd719x/Linux/Docu/Spider/
 */

/*
 * Driver workflow:
 * 1. SCSI command is transformed to SCB (Spider Control Block) by the
 *    queuecommand function.
 * 2. The address of the SCB is stored in a list to be able to access it, if
 *    something goes wrong.
 * 3. The address of the SCB is written to the Controller, which loads the SCB
 *    via BM-DMA and processes it.
 * 4. After it has finished, it generates an interrupt, and sets registers.
 *
 * flaws:
 *  - abort/reset functions
 *
 * ToDo:
 *  - tagged queueing
 */

#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/pci.h>
#include <linux/firmware.h>
#include <linux/eeprom_93cx6.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>
#include "wd719x.h"

/* low-level register access */
static inline u8 wd719x_readb(struct wd719x *wd, u8 reg)
{}

static inline u32 wd719x_readl(struct wd719x *wd, u8 reg)
{}

static inline void wd719x_writeb(struct wd719x *wd, u8 reg, u8 val)
{}

static inline void wd719x_writew(struct wd719x *wd, u8 reg, u16 val)
{}

static inline void wd719x_writel(struct wd719x *wd, u8 reg, u32 val)
{}

/* wait until the command register is ready */
static inline int wd719x_wait_ready(struct wd719x *wd)
{}

/* poll interrupt status register until command finishes */
static inline int wd719x_wait_done(struct wd719x *wd, int timeout)
{}

static int wd719x_direct_cmd(struct wd719x *wd, u8 opcode, u8 dev, u8 lun,
			     u8 tag, dma_addr_t data, int timeout)
{}

static void wd719x_destroy(struct wd719x *wd)
{}

/* finish a SCSI command, unmap buffers */
static void wd719x_finish_cmd(struct wd719x_scb *scb, int result)
{}

/* Build a SCB and send it to the card */
static int wd719x_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *cmd)
{}

static int wd719x_chip_init(struct wd719x *wd)
{}

static int wd719x_abort(struct scsi_cmnd *cmd)
{}

static int wd719x_reset(struct scsi_cmnd *cmd, u8 opcode, u8 device)
{}

static int wd719x_dev_reset(struct scsi_cmnd *cmd)
{}

static int wd719x_bus_reset(struct scsi_cmnd *cmd)
{}

static int wd719x_host_reset(struct scsi_cmnd *cmd)
{}

static int wd719x_biosparam(struct scsi_device *sdev, struct block_device *bdev,
			    sector_t capacity, int geom[])
{}

/* process a SCB-completion interrupt */
static inline void wd719x_interrupt_SCB(struct wd719x *wd,
					union wd719x_regs regs,
					struct wd719x_scb *scb)
{}

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

static void wd719x_eeprom_reg_read(struct eeprom_93cx6 *eeprom)
{}

static void wd719x_eeprom_reg_write(struct eeprom_93cx6 *eeprom)
{}

/* read config from EEPROM so it can be downloaded by the RISC on (re-)init */
static void wd719x_read_eeprom(struct wd719x *wd)
{}

/* Read card type from GPIO bits 1 and 3 */
static enum wd719x_card_type wd719x_detect_type(struct wd719x *wd)
{}

static int wd719x_board_found(struct Scsi_Host *sh)
{}

static const struct scsi_host_template wd719x_template =;

static int wd719x_pci_probe(struct pci_dev *pdev, const struct pci_device_id *d)
{}


static void wd719x_pci_remove(struct pci_dev *pdev)
{}

static const struct pci_device_id wd719x_pci_table[] =;

MODULE_DEVICE_TABLE(pci, wd719x_pci_table);

static struct pci_driver wd719x_pci_driver =;

module_pci_driver();

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