aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_pdc202xx_old.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_pdc202xx_old.c')
-rw-r--r--drivers/ata/pata_pdc202xx_old.c96
1 files changed, 17 insertions, 79 deletions
diff --git a/drivers/ata/pata_pdc202xx_old.c b/drivers/ata/pata_pdc202xx_old.c
index 3ed866723e0c..d2673060bc8d 100644
--- a/drivers/ata/pata_pdc202xx_old.c
+++ b/drivers/ata/pata_pdc202xx_old.c
@@ -262,94 +262,34 @@ static int pdc2026x_check_atapi_dma(struct ata_queued_cmd *qc)
262} 262}
263 263
264static struct scsi_host_template pdc202xx_sht = { 264static struct scsi_host_template pdc202xx_sht = {
265 .module = THIS_MODULE, 265 ATA_BMDMA_SHT(DRV_NAME),
266 .name = DRV_NAME,
267 .ioctl = ata_scsi_ioctl,
268 .queuecommand = ata_scsi_queuecmd,
269 .can_queue = ATA_DEF_QUEUE,
270 .this_id = ATA_SHT_THIS_ID,
271 .sg_tablesize = LIBATA_MAX_PRD,
272 .cmd_per_lun = ATA_SHT_CMD_PER_LUN,
273 .emulated = ATA_SHT_EMULATED,
274 .use_clustering = ATA_SHT_USE_CLUSTERING,
275 .proc_name = DRV_NAME,
276 .dma_boundary = ATA_DMA_BOUNDARY,
277 .slave_configure = ata_scsi_slave_config,
278 .slave_destroy = ata_scsi_slave_destroy,
279 .bios_param = ata_std_bios_param,
280}; 266};
281 267
282static struct ata_port_operations pdc2024x_port_ops = { 268static struct ata_port_operations pdc2024x_port_ops = {
283 .set_piomode = pdc202xx_set_piomode, 269 .inherits = &ata_bmdma_port_ops,
284 .set_dmamode = pdc202xx_set_dmamode, 270
285 .mode_filter = ata_pci_default_filter, 271 .cable_detect = ata_cable_40wire,
286 .tf_load = ata_tf_load, 272 .set_piomode = pdc202xx_set_piomode,
287 .tf_read = ata_tf_read, 273 .set_dmamode = pdc202xx_set_dmamode,
288 .check_status = ata_check_status,
289 .exec_command = ata_exec_command,
290 .dev_select = ata_std_dev_select,
291
292 .freeze = ata_bmdma_freeze,
293 .thaw = ata_bmdma_thaw,
294 .error_handler = ata_bmdma_error_handler,
295 .post_internal_cmd = ata_bmdma_post_internal_cmd,
296 .cable_detect = ata_cable_40wire,
297
298 .bmdma_setup = ata_bmdma_setup,
299 .bmdma_start = ata_bmdma_start,
300 .bmdma_stop = ata_bmdma_stop,
301 .bmdma_status = ata_bmdma_status,
302
303 .qc_prep = ata_qc_prep,
304 .qc_issue = ata_qc_issue_prot,
305 .data_xfer = ata_data_xfer,
306
307 .irq_handler = ata_interrupt,
308 .irq_clear = ata_bmdma_irq_clear,
309 .irq_on = ata_irq_on,
310
311 .port_start = ata_sff_port_start,
312}; 274};
313 275
314static struct ata_port_operations pdc2026x_port_ops = { 276static struct ata_port_operations pdc2026x_port_ops = {
315 .set_piomode = pdc202xx_set_piomode, 277 .inherits = &pdc2024x_port_ops,
316 .set_dmamode = pdc202xx_set_dmamode, 278
317 .mode_filter = ata_pci_default_filter, 279 .check_atapi_dma = pdc2026x_check_atapi_dma,
318 .tf_load = ata_tf_load, 280 .bmdma_start = pdc2026x_bmdma_start,
319 .tf_read = ata_tf_read, 281 .bmdma_stop = pdc2026x_bmdma_stop,
320 .check_status = ata_check_status, 282
321 .exec_command = ata_exec_command, 283 .cable_detect = pdc2026x_cable_detect,
322 .dev_select = ata_std_dev_select, 284 .dev_config = pdc2026x_dev_config,
323 .dev_config = pdc2026x_dev_config, 285
324 286 .port_start = pdc2026x_port_start,
325 .freeze = ata_bmdma_freeze,
326 .thaw = ata_bmdma_thaw,
327 .error_handler = ata_bmdma_error_handler,
328 .post_internal_cmd = ata_bmdma_post_internal_cmd,
329 .cable_detect = pdc2026x_cable_detect,
330
331 .check_atapi_dma= pdc2026x_check_atapi_dma,
332 .bmdma_setup = ata_bmdma_setup,
333 .bmdma_start = pdc2026x_bmdma_start,
334 .bmdma_stop = pdc2026x_bmdma_stop,
335 .bmdma_status = ata_bmdma_status,
336
337 .qc_prep = ata_qc_prep,
338 .qc_issue = ata_qc_issue_prot,
339 .data_xfer = ata_data_xfer,
340
341 .irq_handler = ata_interrupt,
342 .irq_clear = ata_bmdma_irq_clear,
343 .irq_on = ata_irq_on,
344
345 .port_start = pdc2026x_port_start,
346}; 287};
347 288
348static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id) 289static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id)
349{ 290{
350 static const struct ata_port_info info[3] = { 291 static const struct ata_port_info info[3] = {
351 { 292 {
352 .sht = &pdc202xx_sht,
353 .flags = ATA_FLAG_SLAVE_POSS, 293 .flags = ATA_FLAG_SLAVE_POSS,
354 .pio_mask = 0x1f, 294 .pio_mask = 0x1f,
355 .mwdma_mask = 0x07, 295 .mwdma_mask = 0x07,
@@ -357,7 +297,6 @@ static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id
357 .port_ops = &pdc2024x_port_ops 297 .port_ops = &pdc2024x_port_ops
358 }, 298 },
359 { 299 {
360 .sht = &pdc202xx_sht,
361 .flags = ATA_FLAG_SLAVE_POSS, 300 .flags = ATA_FLAG_SLAVE_POSS,
362 .pio_mask = 0x1f, 301 .pio_mask = 0x1f,
363 .mwdma_mask = 0x07, 302 .mwdma_mask = 0x07,
@@ -365,7 +304,6 @@ static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id
365 .port_ops = &pdc2026x_port_ops 304 .port_ops = &pdc2026x_port_ops
366 }, 305 },
367 { 306 {
368 .sht = &pdc202xx_sht,
369 .flags = ATA_FLAG_SLAVE_POSS, 307 .flags = ATA_FLAG_SLAVE_POSS,
370 .pio_mask = 0x1f, 308 .pio_mask = 0x1f,
371 .mwdma_mask = 0x07, 309 .mwdma_mask = 0x07,
@@ -386,7 +324,7 @@ static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id
386 return -ENODEV; 324 return -ENODEV;
387 } 325 }
388 } 326 }
389 return ata_pci_init_one(dev, ppi); 327 return ata_pci_sff_init_one(dev, ppi, &pdc202xx_sht, NULL);
390} 328}
391 329
392static const struct pci_device_id pdc202xx[] = { 330static const struct pci_device_id pdc202xx[] = {