linux/drivers/ata/sata_sil.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  sata_sil.c - Silicon Image SATA
 *
 *  Maintained by:  Tejun Heo <[email protected]>
 *  		    Please ALWAYS copy [email protected]
 *		    on emails.
 *
 *  Copyright 2003-2005 Red Hat, Inc.
 *  Copyright 2003 Benjamin Herrenschmidt
 *
 *  libata documentation is available via 'make {ps|pdf}docs',
 *  as Documentation/driver-api/libata.rst
 *
 *  Documentation for SiI 3112:
 *  http://gkernel.sourceforge.net/specs/sii/3112A_SiI-DS-0095-B2.pdf.bz2
 *
 *  Other errata and documentation available under NDA.
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/blkdev.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/device.h>
#include <scsi/scsi_host.h>
#include <linux/libata.h>
#include <linux/dmi.h>

#define DRV_NAME
#define DRV_VERSION

#define SIL_DMA_BOUNDARY

enum {};

static int sil_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
#ifdef CONFIG_PM_SLEEP
static int sil_pci_device_resume(struct pci_dev *pdev);
#endif
static void sil_dev_config(struct ata_device *dev);
static int sil_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val);
static int sil_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);
static int sil_set_mode(struct ata_link *link, struct ata_device **r_failed);
static enum ata_completion_errors sil_qc_prep(struct ata_queued_cmd *qc);
static void sil_bmdma_setup(struct ata_queued_cmd *qc);
static void sil_bmdma_start(struct ata_queued_cmd *qc);
static void sil_bmdma_stop(struct ata_queued_cmd *qc);
static void sil_freeze(struct ata_port *ap);
static void sil_thaw(struct ata_port *ap);


static const struct pci_device_id sil_pci_tbl[] =;


/* TODO firmware versions should be added - eric */
static const struct sil_drivelist {} sil_blacklist [] =;

static struct pci_driver sil_pci_driver =;

static const struct scsi_host_template sil_sht =;

static struct ata_port_operations sil_ops =;

static const struct ata_port_info sil_port_info[] =;

/* per-port register offsets */
/* TODO: we can probably calculate rather than use a table */
static const struct {} sil_port[] =;

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

static int slow_down;
module_param(slow_down, int, 0444);
MODULE_PARM_DESC();


static void sil_bmdma_stop(struct ata_queued_cmd *qc)
{}

static void sil_bmdma_setup(struct ata_queued_cmd *qc)
{}

static void sil_bmdma_start(struct ata_queued_cmd *qc)
{}

/* The way God intended PCI IDE scatter/gather lists to look and behave... */
static void sil_fill_sg(struct ata_queued_cmd *qc)
{}

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

static unsigned char sil_get_device_cache_line(struct pci_dev *pdev)
{}

/**
 *	sil_set_mode		-	wrap set_mode functions
 *	@link: link to set up
 *	@r_failed: returned device when we fail
 *
 *	Wrap the libata method for device setup as after the setup we need
 *	to inspect the results and do some configuration work
 */

static int sil_set_mode(struct ata_link *link, struct ata_device **r_failed)
{}

static inline void __iomem *sil_scr_addr(struct ata_port *ap,
					 unsigned int sc_reg)
{}

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

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

static void sil_host_intr(struct ata_port *ap, u32 bmdma2)
{}

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

static void sil_freeze(struct ata_port *ap)
{}

static void sil_thaw(struct ata_port *ap)
{}

/**
 *	sil_dev_config - Apply device/host-specific errata fixups
 *	@dev: Device to be examined
 *
 *	After the IDENTIFY [PACKET] DEVICE step is complete, and a
 *	device is known to be present, this function is called.
 *	We apply two errata fixups which are specific to Silicon Image,
 *	a Seagate and a Maxtor fixup.
 *
 *	For certain Seagate devices, we must limit the maximum sectors
 *	to under 8K.
 *
 *	For certain Maxtor devices, we must not program the drive
 *	beyond udma5.
 *
 *	Both fixups are unfairly pessimistic.  As soon as I get more
 *	information on these errata, I will create a more exhaustive
 *	list, and apply the fixups to only the specific
 *	devices/hosts/firmwares that need it.
 *
 *	20040111 - Seagate drives affected by the Mod15Write bug are blacklisted
 *	The Maxtor quirk is in the blacklist, but I'm keeping the original
 *	pessimistic fix for the following reasons...
 *	- There seems to be less info on it, only one device gleaned off the
 *	Windows	driver, maybe only one is affected.  More info would be greatly
 *	appreciated.
 *	- But then again UDMA5 is hardly anything to complain about
 */
static void sil_dev_config(struct ata_device *dev)
{}

static void sil_init_controller(struct ata_host *host)
{}

static bool sil_broken_system_poweroff(struct pci_dev *pdev)
{}

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

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

module_pci_driver();