/* * pata_hpt3x3 - HPT3x3 driver * (c) Copyright 2005-2006 Red Hat * * Was pata_hpt34x but the naming was confusing as it supported the * 343 and 363 so it has been renamed. * * Based on: * linux/drivers/ide/pci/hpt34x.c Version 0.40 Sept 10, 2002 * Copyright (C) 1998-2000 Andre Hedrick <[email protected]> * * May be copied or modified under the terms of the GNU General Public * License */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/blkdev.h> #include <linux/delay.h> #include <scsi/scsi_host.h> #include <linux/libata.h> #define DRV_NAME … #define DRV_VERSION … /** * hpt3x3_set_piomode - PIO setup * @ap: ATA interface * @adev: device on the interface * * Set our PIO requirements. This is fairly simple on the HPT3x3 as * all we have to do is clear the MWDMA and UDMA bits then load the * mode number. */ static void hpt3x3_set_piomode(struct ata_port *ap, struct ata_device *adev) { … } #if defined(CONFIG_PATA_HPT3X3_DMA) /** * hpt3x3_set_dmamode - DMA timing setup * @ap: ATA interface * @adev: Device being configured * * Set up the channel for MWDMA or UDMA modes. Much the same as with * PIO, load the mode number and then set MWDMA or UDMA flag. * * 0x44 : bit 0-2 master mode, 3-5 slave mode, etc * 0x48 : bit 4/0 DMA/UDMA bit 5/1 for slave etc */ static void hpt3x3_set_dmamode(struct ata_port *ap, struct ata_device *adev) { … } /** * hpt3x3_freeze - DMA workaround * @ap: port to freeze * * When freezing an HPT3x3 we must stop any pending DMA before * writing to the control register or the chip will hang */ static void hpt3x3_freeze(struct ata_port *ap) { … } /** * hpt3x3_bmdma_setup - DMA workaround * @qc: Queued command * * When issuing BMDMA we must clean up the error/active bits in * software on this device */ static void hpt3x3_bmdma_setup(struct ata_queued_cmd *qc) { … } /** * hpt3x3_atapi_dma - ATAPI DMA check * @qc: Queued command * * Just say no - we don't do ATAPI DMA */ static int hpt3x3_atapi_dma(struct ata_queued_cmd *qc) { … } #endif /* CONFIG_PATA_HPT3X3_DMA */ static const struct scsi_host_template hpt3x3_sht = …; static struct ata_port_operations hpt3x3_port_ops = …; /** * hpt3x3_init_chipset - chip setup * @dev: PCI device * * Perform the setup required at boot and on resume. */ static void hpt3x3_init_chipset(struct pci_dev *dev) { … } /** * hpt3x3_init_one - Initialise an HPT343/363 * @pdev: PCI device * @id: Entry in match table * * Perform basic initialisation. We set the device up so we access all * ports via BAR4. This is necessary to work around errata. */ static int hpt3x3_init_one(struct pci_dev *pdev, const struct pci_device_id *id) { … } #ifdef CONFIG_PM_SLEEP static int hpt3x3_reinit_one(struct pci_dev *dev) { … } #endif static const struct pci_device_id hpt3x3[] = …; static struct pci_driver hpt3x3_pci_driver = …; module_pci_driver(…) …; MODULE_AUTHOR(…) …; MODULE_DESCRIPTION(…) …; MODULE_LICENSE(…) …; MODULE_DEVICE_TABLE(pci, hpt3x3); MODULE_VERSION(…);