// SPDX-License-Identifier: GPL-2.0-or-later /* * pata_pcmcia.c - PCMCIA PATA controller driver. * Copyright 2005-2006 Red Hat Inc, all rights reserved. * PCMCIA ident update Copyright 2006 Marcin Juszkiewicz * <[email protected]> * * Heavily based upon ide-cs.c * The initial developer of the original code is David A. Hinds * <[email protected]>. Portions created by David A. Hinds * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/blkdev.h> #include <linux/delay.h> #include <linux/slab.h> #include <scsi/scsi_host.h> #include <linux/ata.h> #include <linux/libata.h> #include <pcmcia/cistpl.h> #include <pcmcia/ds.h> #include <pcmcia/cisreg.h> #include <pcmcia/ciscode.h> #define DRV_NAME … #define DRV_VERSION … /** * pcmcia_set_mode - PCMCIA specific mode setup * @link: link * @r_failed_dev: Return pointer for failed device * * Perform the tuning and setup of the devices and timings, which * for PCMCIA is the same as any other controller. We wrap it however * as we need to spot hardware with incorrect or missing master/slave * decode, which alas is embarrassingly common in the PC world */ static int pcmcia_set_mode(struct ata_link *link, struct ata_device **r_failed_dev) { … } /** * pcmcia_set_mode_8bit - PCMCIA specific mode setup * @link: link * @r_failed_dev: Return pointer for failed device * * For the simple emulated 8bit stuff the less we do the better. */ static int pcmcia_set_mode_8bit(struct ata_link *link, struct ata_device **r_failed_dev) { … } /** * ata_data_xfer_8bit - Transfer data by 8bit PIO * @qc: queued command * @buf: data buffer * @buflen: buffer length * @rw: read/write * * Transfer data from/to the device data register by 8 bit PIO. * * LOCKING: * Inherited from caller. */ static unsigned int ata_data_xfer_8bit(struct ata_queued_cmd *qc, unsigned char *buf, unsigned int buflen, int rw) { … } /** * pcmcia_8bit_drain_fifo - Stock FIFO drain logic for SFF controllers * @qc: command * * Drain the FIFO and device of any stuck data following a command * failing to complete. In some cases this is necessary before a * reset will recover the device. * */ static void pcmcia_8bit_drain_fifo(struct ata_queued_cmd *qc) { … } static const struct scsi_host_template pcmcia_sht = …; static struct ata_port_operations pcmcia_port_ops = …; static struct ata_port_operations pcmcia_8bit_port_ops = …; static int pcmcia_check_one_config(struct pcmcia_device *pdev, void *priv_data) { … } /** * pcmcia_init_one - attach a PCMCIA interface * @pdev: pcmcia device * * Register a PCMCIA IDE interface. Such interfaces are PIO 0 and * shared IRQ. */ static int pcmcia_init_one(struct pcmcia_device *pdev) { … } /** * pcmcia_remove_one - unplug an pcmcia interface * @pdev: pcmcia device * * A PCMCIA ATA device has been unplugged. Perform the needed * cleanup. Also called on module unload for any active devices. */ static void pcmcia_remove_one(struct pcmcia_device *pdev) { … } static const struct pcmcia_device_id pcmcia_devices[] = …; MODULE_DEVICE_TABLE(pcmcia, pcmcia_devices); static struct pcmcia_driver pcmcia_driver = …; module_pcmcia_driver(…); MODULE_AUTHOR(…) …; MODULE_DESCRIPTION(…) …; MODULE_LICENSE(…) …; MODULE_VERSION(…);