linux/drivers/ata/sata_via.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  sata_via.c - VIA Serial ATA controllers
 *
 *  Maintained by:  Tejun Heo <[email protected]>
 * 		   Please ALWAYS copy [email protected]
 *		   on emails.
 *
 *  Copyright 2003-2004 Red Hat, Inc.  All rights reserved.
 *  Copyright 2003-2004 Jeff Garzik
 *
 *  libata documentation is available via 'make {ps|pdf}docs',
 *  as Documentation/driver-api/libata.rst
 *
 *  Hardware 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/device.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_host.h>
#include <linux/libata.h>

#define DRV_NAME
#define DRV_VERSION

/*
 * vt8251 is different from other sata controllers of VIA.  It has two
 * channels, each channel has both Master and Slave slot.
 */
enum board_ids_enum {};

enum {};

struct svia_priv {};

static int vt6420_hotplug;
module_param_named(vt6420_hotplug, vt6420_hotplug, int, 0644);
MODULE_PARM_DESC();

static int svia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
#ifdef CONFIG_PM_SLEEP
static int svia_pci_device_resume(struct pci_dev *pdev);
#endif
static int svia_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val);
static int svia_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);
static int vt8251_scr_read(struct ata_link *link, unsigned int scr, u32 *val);
static int vt8251_scr_write(struct ata_link *link, unsigned int scr, u32 val);
static void svia_tf_load(struct ata_port *ap, const struct ata_taskfile *tf);
static void svia_noop_freeze(struct ata_port *ap);
static int vt6420_prereset(struct ata_link *link, unsigned long deadline);
static void vt6420_bmdma_start(struct ata_queued_cmd *qc);
static int vt6421_pata_cable_detect(struct ata_port *ap);
static void vt6421_set_pio_mode(struct ata_port *ap, struct ata_device *adev);
static void vt6421_set_dma_mode(struct ata_port *ap, struct ata_device *adev);
static void vt6421_error_handler(struct ata_port *ap);

static const struct pci_device_id svia_pci_tbl[] =;

static struct pci_driver svia_pci_driver =;

static const struct scsi_host_template svia_sht =;

static struct ata_port_operations svia_base_ops =;

static struct ata_port_operations vt6420_sata_ops =;

static struct ata_port_operations vt6421_pata_ops =;

static struct ata_port_operations vt6421_sata_ops =;

static struct ata_port_operations vt8251_ops =;

static const struct ata_port_info vt6420_port_info =;

static const struct ata_port_info vt6421_sport_info =;

static const struct ata_port_info vt6421_pport_info =;

static const struct ata_port_info vt8251_port_info =;

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

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

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

static int vt8251_scr_read(struct ata_link *link, unsigned int scr, u32 *val)
{}

static int vt8251_scr_write(struct ata_link *link, unsigned int scr, u32 val)
{}

/**
 *	svia_tf_load - send taskfile registers to host controller
 *	@ap: Port to which output is sent
 *	@tf: ATA taskfile register set
 *
 *	Outputs ATA taskfile to standard ATA host controller.
 *
 *	This is to fix the internal bug of via chipsets, which will
 *	reset the device register after changing the IEN bit on ctl
 *	register.
 */
static void svia_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)
{}

static void svia_noop_freeze(struct ata_port *ap)
{}

/**
 *	vt6420_prereset - prereset for vt6420
 *	@link: target ATA link
 *	@deadline: deadline jiffies for the operation
 *
 *	SCR registers on vt6420 are pieces of shit and may hang the
 *	whole machine completely if accessed with the wrong timing.
 *	To avoid such catastrophe, vt6420 doesn't provide generic SCR
 *	access operations, but uses SStatus and SControl only during
 *	boot probing in controlled way.
 *
 *	As the old (pre EH update) probing code is proven to work, we
 *	strictly follow the access pattern.
 *
 *	LOCKING:
 *	Kernel thread context (may sleep)
 *
 *	RETURNS:
 *	0 on success, -errno otherwise.
 */
static int vt6420_prereset(struct ata_link *link, unsigned long deadline)
{}

static void vt6420_bmdma_start(struct ata_queued_cmd *qc)
{}

static int vt6421_pata_cable_detect(struct ata_port *ap)
{}

static void vt6421_set_pio_mode(struct ata_port *ap, struct ata_device *adev)
{}

static void vt6421_set_dma_mode(struct ata_port *ap, struct ata_device *adev)
{}

static const unsigned int svia_bar_sizes[] =;

static const unsigned int vt6421_bar_sizes[] =;

static void __iomem *svia_scr_addr(void __iomem *addr, unsigned int port)
{}

static void __iomem *vt6421_scr_addr(void __iomem *addr, unsigned int port)
{}

static void vt6421_init_addrs(struct ata_port *ap)
{}

static int vt6420_prepare_host(struct pci_dev *pdev, struct ata_host **r_host)
{}

static int vt6421_prepare_host(struct pci_dev *pdev, struct ata_host **r_host)
{}

static int vt8251_prepare_host(struct pci_dev *pdev, struct ata_host **r_host)
{}

static void svia_wd_fix(struct pci_dev *pdev)
{}

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

static void vt6421_error_handler(struct ata_port *ap)
{}

static void svia_configure(struct pci_dev *pdev, int board_id,
			   struct svia_priv *hpriv)
{}

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

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

module_pci_driver();