// SPDX-License-Identifier: GPL-2.0-only /* * pata_radisys.c - Intel PATA/SATA controllers * * (C) 2006 Red Hat <[email protected]> * * Some parts based on ata_piix.c by Jeff Garzik and others. * * A PIIX relative, this device has a single ATA channel and no * slave timings, SITRE or PPE. In that sense it is a close relative * of the original PIIX. It does however support UDMA 33/66 per channel * although no other modes/timings. Also lacking is 32bit I/O on the ATA * port. */ #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_host.h> #include <linux/libata.h> #include <linux/ata.h> #define DRV_NAME … #define DRV_VERSION … /** * radisys_set_piomode - Initialize host controller PATA PIO timings * @ap: ATA port * @adev: Device whose timings we are configuring * * Set PIO mode for device, in host controller PCI config space. * * LOCKING: * None (inherited from caller). */ static void radisys_set_piomode (struct ata_port *ap, struct ata_device *adev) { … } /** * radisys_set_dmamode - Initialize host controller PATA DMA timings * @ap: Port whose timings we are configuring * @adev: Device to program * * Set MWDMA mode for device, in host controller PCI config space. * * LOCKING: * None (inherited from caller). */ static void radisys_set_dmamode (struct ata_port *ap, struct ata_device *adev) { … } /** * radisys_qc_issue - command issue * @qc: command pending * * Called when the libata layer is about to issue a command. We wrap * this interface so that we can load the correct ATA timings if * necessary. Our logic also clears TIME0/TIME1 for the other device so * that, even if we get this wrong, cycles to the other device will * be made PIO0. */ static unsigned int radisys_qc_issue(struct ata_queued_cmd *qc) { … } static const struct scsi_host_template radisys_sht = …; static struct ata_port_operations radisys_pata_ops = …; /** * radisys_init_one - Register PIIX ATA PCI device with kernel services * @pdev: PCI device to register * @ent: Entry in radisys_pci_tbl matching with @pdev * * Called from kernel PCI layer. We probe for combined mode (sigh), * and then hand over control to libata, for it to do the rest. * * LOCKING: * Inherited from PCI layer (may sleep). * * RETURNS: * Zero on success, or -ERRNO value. */ static int radisys_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) { … } static const struct pci_device_id radisys_pci_tbl[] = …; static struct pci_driver radisys_pci_driver = …; module_pci_driver(…) …; MODULE_AUTHOR(…) …; MODULE_DESCRIPTION(…) …; MODULE_LICENSE(…) …; MODULE_DEVICE_TABLE(pci, radisys_pci_tbl); MODULE_VERSION(…);