// SPDX-License-Identifier: GPL-2.0-only /* * ACPI PATA driver * * (c) 2007 Red Hat */ #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 <linux/gfp.h> #include <linux/acpi.h> #include <linux/libata.h> #include <linux/ata.h> #include <scsi/scsi_host.h> #define DRV_NAME … #define DRV_VERSION … struct pata_acpi { … }; /** * pacpi_pre_reset - check for 40/80 pin * @link: ATA link * @deadline: deadline jiffies for the operation * * Perform the PATA port setup we need. */ static int pacpi_pre_reset(struct ata_link *link, unsigned long deadline) { … } /** * pacpi_cable_detect - cable type detection * @ap: port to detect * * Perform device specific cable detection */ static int pacpi_cable_detect(struct ata_port *ap) { … } /** * pacpi_discover_modes - filter non ACPI modes * @ap: ATA port * @adev: ATA device * * Try the modes available and see which ones the ACPI method will * set up sensibly. From this we get a mask of ACPI modes we can use */ static unsigned long pacpi_discover_modes(struct ata_port *ap, struct ata_device *adev) { … } /** * pacpi_mode_filter - mode filter for ACPI * @adev: device * @mask: mask of valid modes * * Filter the valid mode list according to our own specific rules, in * this case the list of discovered valid modes obtained by ACPI probing */ static unsigned int pacpi_mode_filter(struct ata_device *adev, unsigned int mask) { … } /** * pacpi_set_piomode - set initial PIO mode data * @ap: ATA interface * @adev: ATA device */ static void pacpi_set_piomode(struct ata_port *ap, struct ata_device *adev) { … } /** * pacpi_set_dmamode - set initial DMA mode data * @ap: ATA interface * @adev: ATA device */ static void pacpi_set_dmamode(struct ata_port *ap, struct ata_device *adev) { … } /** * pacpi_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. */ static unsigned int pacpi_qc_issue(struct ata_queued_cmd *qc) { … } /** * pacpi_port_start - port setup * @ap: ATA port being set up * * Use the port_start hook to maintain private control structures */ static int pacpi_port_start(struct ata_port *ap) { … } static const struct scsi_host_template pacpi_sht = …; static struct ata_port_operations pacpi_ops = …; /** * pacpi_init_one - Register ACPI ATA PCI device with kernel services * @pdev: PCI device to register * @id: PCI device ID * * Called from kernel PCI layer. * * LOCKING: * Inherited from PCI layer (may sleep). * * RETURNS: * Zero on success, or -ERRNO value. */ static int pacpi_init_one (struct pci_dev *pdev, const struct pci_device_id *id) { … } static const struct pci_device_id pacpi_pci_tbl[] = …; static struct pci_driver pacpi_pci_driver = …; module_pci_driver(…) …; MODULE_AUTHOR(…) …; MODULE_DESCRIPTION(…) …; MODULE_LICENSE(…) …; MODULE_DEVICE_TABLE(pci, pacpi_pci_tbl); MODULE_VERSION(…);