aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_oldpiix.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_oldpiix.c')
-rw-r--r--drivers/ata/pata_oldpiix.c74
1 files changed, 11 insertions, 63 deletions
diff --git a/drivers/ata/pata_oldpiix.c b/drivers/ata/pata_oldpiix.c
index 44da09ace52c..e678af383d13 100644
--- a/drivers/ata/pata_oldpiix.c
+++ b/drivers/ata/pata_oldpiix.c
@@ -47,21 +47,7 @@ static int oldpiix_pre_reset(struct ata_link *link, unsigned long deadline)
47 if (!pci_test_config_bits(pdev, &oldpiix_enable_bits[ap->port_no])) 47 if (!pci_test_config_bits(pdev, &oldpiix_enable_bits[ap->port_no]))
48 return -ENOENT; 48 return -ENOENT;
49 49
50 return ata_std_prereset(link, deadline); 50 return ata_sff_prereset(link, deadline);
51}
52
53/**
54 * oldpiix_pata_error_handler - Probe specified port on PATA host controller
55 * @ap: Port to probe
56 * @classes:
57 *
58 * LOCKING:
59 * None (inherited from caller).
60 */
61
62static void oldpiix_pata_error_handler(struct ata_port *ap)
63{
64 ata_bmdma_drive_eh(ap, oldpiix_pre_reset, ata_std_softreset, NULL, ata_std_postreset);
65} 51}
66 52
67/** 53/**
@@ -195,7 +181,7 @@ static void oldpiix_set_dmamode (struct ata_port *ap, struct ata_device *adev)
195} 181}
196 182
197/** 183/**
198 * oldpiix_qc_issue_prot - command issue 184 * oldpiix_qc_issue - command issue
199 * @qc: command pending 185 * @qc: command pending
200 * 186 *
201 * Called when the libata layer is about to issue a command. We wrap 187 * Called when the libata layer is about to issue a command. We wrap
@@ -205,7 +191,7 @@ static void oldpiix_set_dmamode (struct ata_port *ap, struct ata_device *adev)
205 * be made PIO0. 191 * be made PIO0.
206 */ 192 */
207 193
208static unsigned int oldpiix_qc_issue_prot(struct ata_queued_cmd *qc) 194static unsigned int oldpiix_qc_issue(struct ata_queued_cmd *qc)
209{ 195{
210 struct ata_port *ap = qc->ap; 196 struct ata_port *ap = qc->ap;
211 struct ata_device *adev = qc->dev; 197 struct ata_device *adev = qc->dev;
@@ -215,58 +201,21 @@ static unsigned int oldpiix_qc_issue_prot(struct ata_queued_cmd *qc)
215 if (adev->dma_mode) 201 if (adev->dma_mode)
216 oldpiix_set_dmamode(ap, adev); 202 oldpiix_set_dmamode(ap, adev);
217 } 203 }
218 return ata_qc_issue_prot(qc); 204 return ata_sff_qc_issue(qc);
219} 205}
220 206
221 207
222static struct scsi_host_template oldpiix_sht = { 208static struct scsi_host_template oldpiix_sht = {
223 .module = THIS_MODULE, 209 ATA_BMDMA_SHT(DRV_NAME),
224 .name = DRV_NAME,
225 .ioctl = ata_scsi_ioctl,
226 .queuecommand = ata_scsi_queuecmd,
227 .can_queue = ATA_DEF_QUEUE,
228 .this_id = ATA_SHT_THIS_ID,
229 .sg_tablesize = LIBATA_MAX_PRD,
230 .cmd_per_lun = ATA_SHT_CMD_PER_LUN,
231 .emulated = ATA_SHT_EMULATED,
232 .use_clustering = ATA_SHT_USE_CLUSTERING,
233 .proc_name = DRV_NAME,
234 .dma_boundary = ATA_DMA_BOUNDARY,
235 .slave_configure = ata_scsi_slave_config,
236 .slave_destroy = ata_scsi_slave_destroy,
237 .bios_param = ata_std_bios_param,
238}; 210};
239 211
240static const struct ata_port_operations oldpiix_pata_ops = { 212static struct ata_port_operations oldpiix_pata_ops = {
213 .inherits = &ata_bmdma_port_ops,
214 .qc_issue = oldpiix_qc_issue,
215 .cable_detect = ata_cable_40wire,
241 .set_piomode = oldpiix_set_piomode, 216 .set_piomode = oldpiix_set_piomode,
242 .set_dmamode = oldpiix_set_dmamode, 217 .set_dmamode = oldpiix_set_dmamode,
243 .mode_filter = ata_pci_default_filter, 218 .prereset = oldpiix_pre_reset,
244
245 .tf_load = ata_tf_load,
246 .tf_read = ata_tf_read,
247 .check_status = ata_check_status,
248 .exec_command = ata_exec_command,
249 .dev_select = ata_std_dev_select,
250
251 .freeze = ata_bmdma_freeze,
252 .thaw = ata_bmdma_thaw,
253 .error_handler = oldpiix_pata_error_handler,
254 .post_internal_cmd = ata_bmdma_post_internal_cmd,
255 .cable_detect = ata_cable_40wire,
256
257 .bmdma_setup = ata_bmdma_setup,
258 .bmdma_start = ata_bmdma_start,
259 .bmdma_stop = ata_bmdma_stop,
260 .bmdma_status = ata_bmdma_status,
261 .qc_prep = ata_qc_prep,
262 .qc_issue = oldpiix_qc_issue_prot,
263 .data_xfer = ata_data_xfer,
264
265 .irq_handler = ata_interrupt,
266 .irq_clear = ata_bmdma_irq_clear,
267 .irq_on = ata_irq_on,
268
269 .port_start = ata_sff_port_start,
270}; 219};
271 220
272 221
@@ -289,7 +238,6 @@ static int oldpiix_init_one (struct pci_dev *pdev, const struct pci_device_id *e
289{ 238{
290 static int printed_version; 239 static int printed_version;
291 static const struct ata_port_info info = { 240 static const struct ata_port_info info = {
292 .sht = &oldpiix_sht,
293 .flags = ATA_FLAG_SLAVE_POSS, 241 .flags = ATA_FLAG_SLAVE_POSS,
294 .pio_mask = 0x1f, /* pio0-4 */ 242 .pio_mask = 0x1f, /* pio0-4 */
295 .mwdma_mask = 0x07, /* mwdma1-2 */ 243 .mwdma_mask = 0x07, /* mwdma1-2 */
@@ -301,7 +249,7 @@ static int oldpiix_init_one (struct pci_dev *pdev, const struct pci_device_id *e
301 dev_printk(KERN_DEBUG, &pdev->dev, 249 dev_printk(KERN_DEBUG, &pdev->dev,
302 "version " DRV_VERSION "\n"); 250 "version " DRV_VERSION "\n");
303 251
304 return ata_pci_init_one(pdev, ppi); 252 return ata_pci_sff_init_one(pdev, ppi, &oldpiix_sht, NULL);
305} 253}
306 254
307static const struct pci_device_id oldpiix_pci_tbl[] = { 255static const struct pci_device_id oldpiix_pci_tbl[] = {