#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 …
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)
{ … }
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 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(…) …;