linux/drivers/ata/sata_inic162x.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * sata_inic162x.c - Driver for Initio 162x SATA controllers
 *
 * Copyright 2006  SUSE Linux Products GmbH
 * Copyright 2006  Tejun Heo <[email protected]>
 *
 * **** WARNING ****
 *
 * This driver never worked properly and unfortunately data corruption is
 * relatively common.  There isn't anyone working on the driver and there's
 * no support from the vendor.  Do not use this driver in any production
 * environment.
 *
 * http://thread.gmane.org/gmane.linux.debian.devel.bugs.rc/378525/focus=54491
 * https://bugzilla.kernel.org/show_bug.cgi?id=60565
 *
 * *****************
 *
 * This controller is eccentric and easily locks up if something isn't
 * right.  Documentation is available at initio's website but it only
 * documents registers (not programming model).
 *
 * This driver has interesting history.  The first version was written
 * from the documentation and a 2.4 IDE driver posted on a Taiwan
 * company, which didn't use any IDMA features and couldn't handle
 * LBA48.  The resulting driver couldn't handle LBA48 devices either
 * making it pretty useless.
 *
 * After a while, initio picked the driver up, renamed it to
 * sata_initio162x, updated it to use IDMA for ATA DMA commands and
 * posted it on their website.  It only used ATA_PROT_DMA for IDMA and
 * attaching both devices and issuing IDMA and !IDMA commands
 * simultaneously broke it due to PIRQ masking interaction but it did
 * show how to use the IDMA (ADMA + some initio specific twists)
 * engine.
 *
 * Then, I picked up their changes again and here's the usable driver
 * which uses IDMA for everything.  Everything works now including
 * LBA48, CD/DVD burning, suspend/resume and hotplug.  There are some
 * issues tho.  Result Tf is not resported properly, NCQ isn't
 * supported yet and CD/DVD writing works with DMA assisted PIO
 * protocol (which, for native SATA devices, shouldn't cause any
 * noticeable difference).
 *
 * Anyways, so, here's finally a working driver for inic162x.  Enjoy!
 *
 * initio: If you guys wanna improve the driver regarding result TF
 * access and other stuff, please feel free to contact me.  I'll be
 * happy to assist.
 */

#include <linux/gfp.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <scsi/scsi_host.h>
#include <linux/libata.h>
#include <linux/blkdev.h>
#include <scsi/scsi_device.h>

#define DRV_NAME
#define DRV_VERSION

enum {};

/* Comman Parameter Block */
struct inic_cpb {} __packed;

/* Physical Region Descriptor */
struct inic_prd {} __packed;

struct inic_pkt {} __packed;

struct inic_host_priv {};

struct inic_port_priv {};

static const struct scsi_host_template inic_sht =;

static const int scr_map[] =;

static void __iomem *inic_port_base(struct ata_port *ap)
{}

static void inic_reset_port(void __iomem *port_base)
{}

static int inic_scr_read(struct ata_link *link, unsigned sc_reg, u32 *val)
{}

static int inic_scr_write(struct ata_link *link, unsigned sc_reg, u32 val)
{}

static void inic_stop_idma(struct ata_port *ap)
{}

static void inic_host_err_intr(struct ata_port *ap, u8 irq_stat, u16 idma_stat)
{}

static void inic_host_intr(struct ata_port *ap)
{}

static irqreturn_t inic_interrupt(int irq, void *dev_instance)
{}

static int inic_check_atapi_dma(struct ata_queued_cmd *qc)
{}

static void inic_fill_sg(struct inic_prd *prd, struct ata_queued_cmd *qc)
{}

static enum ata_completion_errors inic_qc_prep(struct ata_queued_cmd *qc)
{}

static unsigned int inic_qc_issue(struct ata_queued_cmd *qc)
{}

static void inic_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
{}

static void inic_qc_fill_rtf(struct ata_queued_cmd *qc)
{}

static void inic_freeze(struct ata_port *ap)
{}

static void inic_thaw(struct ata_port *ap)
{}

static int inic_check_ready(struct ata_link *link)
{}

/*
 * SRST and SControl hardreset don't give valid signature on this
 * controller.  Only controller specific hardreset mechanism works.
 */
static int inic_hardreset(struct ata_link *link, unsigned int *class,
			  unsigned long deadline)
{}

static void inic_error_handler(struct ata_port *ap)
{}

static void inic_post_internal_cmd(struct ata_queued_cmd *qc)
{}

static void init_port(struct ata_port *ap)
{}

static int inic_port_resume(struct ata_port *ap)
{}

static int inic_port_start(struct ata_port *ap)
{}

static struct ata_port_operations inic_port_ops =;

static const struct ata_port_info inic_port_info =;

static int init_controller(void __iomem *mmio_base, u16 hctl)
{}

#ifdef CONFIG_PM_SLEEP
static int inic_pci_device_resume(struct pci_dev *pdev)
{}
#endif

static int inic_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{}

static const struct pci_device_id inic_pci_tbl[] =;

static struct pci_driver inic_pci_driver =;

module_pci_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_DEVICE_TABLE(pci, inic_pci_tbl);
MODULE_VERSION();