aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_mpiix.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_mpiix.c')
-rw-r--r--drivers/ata/pata_mpiix.c71
1 files changed, 13 insertions, 58 deletions
diff --git a/drivers/ata/pata_mpiix.c b/drivers/ata/pata_mpiix.c
index c0d9e0cf208c..7d7e3fdab71f 100644
--- a/drivers/ata/pata_mpiix.c
+++ b/drivers/ata/pata_mpiix.c
@@ -55,21 +55,7 @@ static int mpiix_pre_reset(struct ata_link *link, unsigned long deadline)
55 if (!pci_test_config_bits(pdev, &mpiix_enable_bits)) 55 if (!pci_test_config_bits(pdev, &mpiix_enable_bits))
56 return -ENOENT; 56 return -ENOENT;
57 57
58 return ata_std_prereset(link, deadline); 58 return ata_sff_prereset(link, deadline);
59}
60
61/**
62 * mpiix_error_handler - probe reset
63 * @ap: ATA port
64 *
65 * Perform the ATA probe and bus reset sequence plus specific handling
66 * for this hardware. The MPIIX has the enable bits in a different place
67 * to PIIX4 and friends. As a pure PIO device it has no cable detect
68 */
69
70static void mpiix_error_handler(struct ata_port *ap)
71{
72 ata_bmdma_drive_eh(ap, mpiix_pre_reset, ata_std_softreset, NULL, ata_std_postreset);
73} 59}
74 60
75/** 61/**
@@ -83,8 +69,8 @@ static void mpiix_error_handler(struct ata_port *ap)
83 * 69 *
84 * This would get very ugly because we can only program timing for one 70 * This would get very ugly because we can only program timing for one
85 * device at a time, the other gets PIO0. Fortunately libata calls 71 * device at a time, the other gets PIO0. Fortunately libata calls
86 * our qc_issue_prot command before a command is issued so we can 72 * our qc_issue command before a command is issued so we can flip the
87 * flip the timings back and forth to reduce the pain. 73 * timings back and forth to reduce the pain.
88 */ 74 */
89 75
90static void mpiix_set_piomode(struct ata_port *ap, struct ata_device *adev) 76static void mpiix_set_piomode(struct ata_port *ap, struct ata_device *adev)
@@ -124,7 +110,7 @@ static void mpiix_set_piomode(struct ata_port *ap, struct ata_device *adev)
124} 110}
125 111
126/** 112/**
127 * mpiix_qc_issue_prot - command issue 113 * mpiix_qc_issue - command issue
128 * @qc: command pending 114 * @qc: command pending
129 * 115 *
130 * Called when the libata layer is about to issue a command. We wrap 116 * Called when the libata layer is about to issue a command. We wrap
@@ -134,7 +120,7 @@ static void mpiix_set_piomode(struct ata_port *ap, struct ata_device *adev)
134 * be made PIO0. 120 * be made PIO0.
135 */ 121 */
136 122
137static unsigned int mpiix_qc_issue_prot(struct ata_queued_cmd *qc) 123static unsigned int mpiix_qc_issue(struct ata_queued_cmd *qc)
138{ 124{
139 struct ata_port *ap = qc->ap; 125 struct ata_port *ap = qc->ap;
140 struct ata_device *adev = qc->dev; 126 struct ata_device *adev = qc->dev;
@@ -147,50 +133,19 @@ static unsigned int mpiix_qc_issue_prot(struct ata_queued_cmd *qc)
147 if (adev->pio_mode && adev != ap->private_data) 133 if (adev->pio_mode && adev != ap->private_data)
148 mpiix_set_piomode(ap, adev); 134 mpiix_set_piomode(ap, adev);
149 135
150 return ata_qc_issue_prot(qc); 136 return ata_sff_qc_issue(qc);
151} 137}
152 138
153static struct scsi_host_template mpiix_sht = { 139static struct scsi_host_template mpiix_sht = {
154 .module = THIS_MODULE, 140 ATA_PIO_SHT(DRV_NAME),
155 .name = DRV_NAME,
156 .ioctl = ata_scsi_ioctl,
157 .queuecommand = ata_scsi_queuecmd,
158 .can_queue = ATA_DEF_QUEUE,
159 .this_id = ATA_SHT_THIS_ID,
160 .sg_tablesize = LIBATA_MAX_PRD,
161 .cmd_per_lun = ATA_SHT_CMD_PER_LUN,
162 .emulated = ATA_SHT_EMULATED,
163 .use_clustering = ATA_SHT_USE_CLUSTERING,
164 .proc_name = DRV_NAME,
165 .dma_boundary = ATA_DMA_BOUNDARY,
166 .slave_configure = ata_scsi_slave_config,
167 .slave_destroy = ata_scsi_slave_destroy,
168 .bios_param = ata_std_bios_param,
169}; 141};
170 142
171static struct ata_port_operations mpiix_port_ops = { 143static struct ata_port_operations mpiix_port_ops = {
172 .set_piomode = mpiix_set_piomode, 144 .inherits = &ata_sff_port_ops,
173 145 .qc_issue = mpiix_qc_issue,
174 .tf_load = ata_tf_load,
175 .tf_read = ata_tf_read,
176 .check_status = ata_check_status,
177 .exec_command = ata_exec_command,
178 .dev_select = ata_std_dev_select,
179
180 .freeze = ata_bmdma_freeze,
181 .thaw = ata_bmdma_thaw,
182 .error_handler = mpiix_error_handler,
183 .post_internal_cmd = ata_bmdma_post_internal_cmd,
184 .cable_detect = ata_cable_40wire, 146 .cable_detect = ata_cable_40wire,
185 147 .set_piomode = mpiix_set_piomode,
186 .qc_prep = ata_qc_prep, 148 .prereset = mpiix_pre_reset,
187 .qc_issue = mpiix_qc_issue_prot,
188 .data_xfer = ata_data_xfer,
189
190 .irq_clear = ata_bmdma_irq_clear,
191 .irq_on = ata_irq_on,
192
193 .port_start = ata_sff_port_start,
194}; 149};
195 150
196static int mpiix_init_one(struct pci_dev *dev, const struct pci_device_id *id) 151static int mpiix_init_one(struct pci_dev *dev, const struct pci_device_id *id)
@@ -252,10 +207,10 @@ static int mpiix_init_one(struct pci_dev *dev, const struct pci_device_id *id)
252 ap->ioaddr.altstatus_addr = ctl_addr; 207 ap->ioaddr.altstatus_addr = ctl_addr;
253 208
254 /* Let libata fill in the port details */ 209 /* Let libata fill in the port details */
255 ata_std_ports(&ap->ioaddr); 210 ata_sff_std_ports(&ap->ioaddr);
256 211
257 /* activate host */ 212 /* activate host */
258 return ata_host_activate(host, irq, ata_interrupt, IRQF_SHARED, 213 return ata_host_activate(host, irq, ata_sff_interrupt, IRQF_SHARED,
259 &mpiix_sht); 214 &mpiix_sht);
260} 215}
261 216