aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/ata_generic.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/ata_generic.c')
-rw-r--r--drivers/ata/ata_generic.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/ata/ata_generic.c b/drivers/ata/ata_generic.c
index 20b191dcf7ed..1d1c30a2fcd0 100644
--- a/drivers/ata/ata_generic.c
+++ b/drivers/ata/ata_generic.c
@@ -2,18 +2,18 @@
2 * ata_generic.c - Generic PATA/SATA controller driver. 2 * ata_generic.c - Generic PATA/SATA controller driver.
3 * Copyright 2005 Red Hat Inc <alan@redhat.com>, all rights reserved. 3 * Copyright 2005 Red Hat Inc <alan@redhat.com>, all rights reserved.
4 * 4 *
5 * Elements from ide/pci/generic.c 5 * Elements from ide/pci/generic.c
6 * Copyright (C) 2001-2002 Andre Hedrick <andre@linux-ide.org> 6 * Copyright (C) 2001-2002 Andre Hedrick <andre@linux-ide.org>
7 * Portions (C) Copyright 2002 Red Hat Inc <alan@redhat.com> 7 * Portions (C) Copyright 2002 Red Hat Inc <alan@redhat.com>
8 * 8 *
9 * May be copied or modified under the terms of the GNU General Public License 9 * May be copied or modified under the terms of the GNU General Public License
10 * 10 *
11 * Driver for PCI IDE interfaces implementing the standard bus mastering 11 * Driver for PCI IDE interfaces implementing the standard bus mastering
12 * interface functionality. This assumes the BIOS did the drive set up and 12 * interface functionality. This assumes the BIOS did the drive set up and
13 * tuning for us. By default we do not grab all IDE class devices as they 13 * tuning for us. By default we do not grab all IDE class devices as they
14 * may have other drivers or need fixups to avoid problems. Instead we keep 14 * may have other drivers or need fixups to avoid problems. Instead we keep
15 * a default list of stuff without documentation/driver that appears to 15 * a default list of stuff without documentation/driver that appears to
16 * work. 16 * work.
17 */ 17 */
18 18
19#include <linux/kernel.h> 19#include <linux/kernel.h>
@@ -38,7 +38,7 @@
38 * 38 *
39 * Set up cable type and use generic probe init 39 * Set up cable type and use generic probe init
40 */ 40 */
41 41
42static int generic_pre_reset(struct ata_port *ap) 42static int generic_pre_reset(struct ata_port *ap)
43{ 43{
44 ap->cbl = ATA_CBL_PATA80; 44 ap->cbl = ATA_CBL_PATA80;
@@ -55,7 +55,7 @@ static int generic_pre_reset(struct ata_port *ap)
55 * None (inherited from caller). 55 * None (inherited from caller).
56 */ 56 */
57 57
58 58
59static void generic_error_handler(struct ata_port *ap) 59static void generic_error_handler(struct ata_port *ap)
60{ 60{
61 ata_bmdma_drive_eh(ap, generic_pre_reset, ata_std_softreset, NULL, ata_std_postreset); 61 ata_bmdma_drive_eh(ap, generic_pre_reset, ata_std_softreset, NULL, ata_std_postreset);
@@ -68,9 +68,9 @@ static void generic_error_handler(struct ata_port *ap)
68 * Use a non standard set_mode function. We don't want to be tuned. 68 * Use a non standard set_mode function. We don't want to be tuned.
69 * The BIOS configured everything. Our job is not to fiddle. We 69 * The BIOS configured everything. Our job is not to fiddle. We
70 * read the dma enabled bits from the PCI configuration of the device 70 * read the dma enabled bits from the PCI configuration of the device
71 * and respect them. 71 * and respect them.
72 */ 72 */
73 73
74static void generic_set_mode(struct ata_port *ap) 74static void generic_set_mode(struct ata_port *ap)
75{ 75{
76 int dma_enabled = 0; 76 int dma_enabled = 0;
@@ -79,14 +79,14 @@ static void generic_set_mode(struct ata_port *ap)
79 /* Bits 5 and 6 indicate if DMA is active on master/slave */ 79 /* Bits 5 and 6 indicate if DMA is active on master/slave */
80 if (ap->ioaddr.bmdma_addr) 80 if (ap->ioaddr.bmdma_addr)
81 dma_enabled = inb(ap->ioaddr.bmdma_addr + ATA_DMA_CMD); 81 dma_enabled = inb(ap->ioaddr.bmdma_addr + ATA_DMA_CMD);
82 82
83 for (i = 0; i < ATA_MAX_DEVICES; i++) { 83 for (i = 0; i < ATA_MAX_DEVICES; i++) {
84 struct ata_device *dev = &ap->device[i]; 84 struct ata_device *dev = &ap->device[i];
85 if (ata_dev_enabled(dev)) { 85 if (ata_dev_enabled(dev)) {
86 /* We don't really care */ 86 /* We don't really care */
87 dev->pio_mode = XFER_PIO_0; 87 dev->pio_mode = XFER_PIO_0;
88 dev->dma_mode = XFER_MW_DMA_0; 88 dev->dma_mode = XFER_MW_DMA_0;
89 /* We do need the right mode information for DMA or PIO 89 /* We do need the right mode information for DMA or PIO
90 and this comes from the current configuration flags */ 90 and this comes from the current configuration flags */
91 if (dma_enabled & (1 << (5 + i))) { 91 if (dma_enabled & (1 << (5 + i))) {
92 dev->xfer_mode = XFER_MW_DMA_0; 92 dev->xfer_mode = XFER_MW_DMA_0;
@@ -121,7 +121,7 @@ static struct scsi_host_template generic_sht = {
121 121
122static struct ata_port_operations generic_port_ops = { 122static struct ata_port_operations generic_port_ops = {
123 .set_mode = generic_set_mode, 123 .set_mode = generic_set_mode,
124 124
125 .port_disable = ata_port_disable, 125 .port_disable = ata_port_disable,
126 .tf_load = ata_tf_load, 126 .tf_load = ata_tf_load,
127 .tf_read = ata_tf_read, 127 .tf_read = ata_tf_read,
@@ -133,7 +133,7 @@ static struct ata_port_operations generic_port_ops = {
133 .bmdma_start = ata_bmdma_start, 133 .bmdma_start = ata_bmdma_start,
134 .bmdma_stop = ata_bmdma_stop, 134 .bmdma_stop = ata_bmdma_stop,
135 .bmdma_status = ata_bmdma_status, 135 .bmdma_status = ata_bmdma_status,
136 136
137 .data_xfer = ata_pio_data_xfer, 137 .data_xfer = ata_pio_data_xfer,
138 138
139 .freeze = ata_bmdma_freeze, 139 .freeze = ata_bmdma_freeze,
@@ -150,8 +150,8 @@ static struct ata_port_operations generic_port_ops = {
150 .port_start = ata_port_start, 150 .port_start = ata_port_start,
151 .port_stop = ata_port_stop, 151 .port_stop = ata_port_stop,
152 .host_stop = ata_host_stop 152 .host_stop = ata_host_stop
153}; 153};
154 154
155static int all_generic_ide; /* Set to claim all devices */ 155static int all_generic_ide; /* Set to claim all devices */
156 156
157/** 157/**
@@ -160,10 +160,10 @@ static int all_generic_ide; /* Set to claim all devices */
160 * @id: match entry 160 * @id: match entry
161 * 161 *
162 * Called each time a matching IDE interface is found. We check if the 162 * Called each time a matching IDE interface is found. We check if the
163 * interface is one we wish to claim and if so we perform any chip 163 * interface is one we wish to claim and if so we perform any chip
164 * specific hacks then let the ATA layer do the heavy lifting. 164 * specific hacks then let the ATA layer do the heavy lifting.
165 */ 165 */
166 166
167static int ata_generic_init_one(struct pci_dev *dev, const struct pci_device_id *id) 167static int ata_generic_init_one(struct pci_dev *dev, const struct pci_device_id *id)
168{ 168{
169 u16 command; 169 u16 command;
@@ -176,7 +176,7 @@ static int ata_generic_init_one(struct pci_dev *dev, const struct pci_device_id
176 .port_ops = &generic_port_ops 176 .port_ops = &generic_port_ops
177 }; 177 };
178 static struct ata_port_info *port_info[2] = { &info, &info }; 178 static struct ata_port_info *port_info[2] = { &info, &info };
179 179
180 /* Don't use the generic entry unless instructed to do so */ 180 /* Don't use the generic entry unless instructed to do so */
181 if (id->driver_data == 1 && all_generic_ide == 0) 181 if (id->driver_data == 1 && all_generic_ide == 0)
182 return -ENODEV; 182 return -ENODEV;
@@ -197,7 +197,7 @@ static int ata_generic_init_one(struct pci_dev *dev, const struct pci_device_id
197 pci_read_config_word(dev, PCI_COMMAND, &command); 197 pci_read_config_word(dev, PCI_COMMAND, &command);
198 if (!(command & PCI_COMMAND_IO)) 198 if (!(command & PCI_COMMAND_IO))
199 return -ENODEV; 199 return -ENODEV;
200 200
201 if (dev->vendor == PCI_VENDOR_ID_AL) 201 if (dev->vendor == PCI_VENDOR_ID_AL)
202 ata_pci_clear_simplex(dev); 202 ata_pci_clear_simplex(dev);
203 203
@@ -207,7 +207,7 @@ static int ata_generic_init_one(struct pci_dev *dev, const struct pci_device_id
207static struct pci_device_id ata_generic[] = { 207static struct pci_device_id ata_generic[] = {
208 { PCI_DEVICE(PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_SAMURAI_IDE), }, 208 { PCI_DEVICE(PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_SAMURAI_IDE), },
209 { PCI_DEVICE(PCI_VENDOR_ID_HOLTEK, PCI_DEVICE_ID_HOLTEK_6565), }, 209 { PCI_DEVICE(PCI_VENDOR_ID_HOLTEK, PCI_DEVICE_ID_HOLTEK_6565), },
210 { PCI_DEVICE(PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8673F), }, 210 { PCI_DEVICE(PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8673F), },
211 { PCI_DEVICE(PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886A), }, 211 { PCI_DEVICE(PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886A), },
212 { PCI_DEVICE(PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886BF), }, 212 { PCI_DEVICE(PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886BF), },
213 { PCI_DEVICE(PCI_VENDOR_ID_HINT, PCI_DEVICE_ID_HINT_VXPROII_IDE), }, 213 { PCI_DEVICE(PCI_VENDOR_ID_HINT, PCI_DEVICE_ID_HINT_VXPROII_IDE), },