diff options
Diffstat (limited to 'drivers/ide/ide-dma.c')
-rw-r--r-- | drivers/ide/ide-dma.c | 45 |
1 files changed, 10 insertions, 35 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index 5fe1d72ab451..ff644a5e12cd 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c | |||
@@ -135,25 +135,6 @@ static const struct drive_list_entry drive_blacklist [] = { | |||
135 | }; | 135 | }; |
136 | 136 | ||
137 | /** | 137 | /** |
138 | * ide_in_drive_list - look for drive in black/white list | ||
139 | * @id: drive identifier | ||
140 | * @drive_table: list to inspect | ||
141 | * | ||
142 | * Look for a drive in the blacklist and the whitelist tables | ||
143 | * Returns 1 if the drive is found in the table. | ||
144 | */ | ||
145 | |||
146 | int ide_in_drive_list(struct hd_driveid *id, const struct drive_list_entry *drive_table) | ||
147 | { | ||
148 | for ( ; drive_table->id_model ; drive_table++) | ||
149 | if ((!strcmp(drive_table->id_model, id->model)) && | ||
150 | (!drive_table->id_firmware || | ||
151 | strstr(id->fw_rev, drive_table->id_firmware))) | ||
152 | return 1; | ||
153 | return 0; | ||
154 | } | ||
155 | |||
156 | /** | ||
157 | * ide_dma_intr - IDE DMA interrupt handler | 138 | * ide_dma_intr - IDE DMA interrupt handler |
158 | * @drive: the drive the interrupt is for | 139 | * @drive: the drive the interrupt is for |
159 | * | 140 | * |
@@ -349,9 +330,17 @@ EXPORT_SYMBOL_GPL(ide_destroy_dmatable); | |||
349 | 330 | ||
350 | static int config_drive_for_dma (ide_drive_t *drive) | 331 | static int config_drive_for_dma (ide_drive_t *drive) |
351 | { | 332 | { |
333 | ide_hwif_t *hwif = drive->hwif; | ||
352 | struct hd_driveid *id = drive->id; | 334 | struct hd_driveid *id = drive->id; |
353 | 335 | ||
354 | if ((id->capability & 1) && drive->hwif->autodma) { | 336 | /* consult the list of known "bad" drives */ |
337 | if (__ide_dma_bad_drive(drive)) | ||
338 | return -1; | ||
339 | |||
340 | if (drive->media != ide_disk && hwif->atapi_dma == 0) | ||
341 | return -1; | ||
342 | |||
343 | if ((id->capability & 1) && drive->autodma) { | ||
355 | /* | 344 | /* |
356 | * Enable DMA on any drive that has | 345 | * Enable DMA on any drive that has |
357 | * UltraDMA (mode 0/1/2/3/4/5/6) enabled | 346 | * UltraDMA (mode 0/1/2/3/4/5/6) enabled |
@@ -514,20 +503,6 @@ int __ide_dma_on (ide_drive_t *drive) | |||
514 | EXPORT_SYMBOL(__ide_dma_on); | 503 | EXPORT_SYMBOL(__ide_dma_on); |
515 | 504 | ||
516 | /** | 505 | /** |
517 | * __ide_dma_check - check DMA setup | ||
518 | * @drive: drive to check | ||
519 | * | ||
520 | * Don't use - due for extermination | ||
521 | */ | ||
522 | |||
523 | int __ide_dma_check (ide_drive_t *drive) | ||
524 | { | ||
525 | return config_drive_for_dma(drive); | ||
526 | } | ||
527 | |||
528 | EXPORT_SYMBOL(__ide_dma_check); | ||
529 | |||
530 | /** | ||
531 | * ide_dma_setup - begin a DMA phase | 506 | * ide_dma_setup - begin a DMA phase |
532 | * @drive: target device | 507 | * @drive: target device |
533 | * | 508 | * |
@@ -1021,7 +996,7 @@ void ide_setup_dma (ide_hwif_t *hwif, unsigned long dma_base, unsigned int num_p | |||
1021 | if (!hwif->dma_host_on) | 996 | if (!hwif->dma_host_on) |
1022 | hwif->dma_host_on = &ide_dma_host_on; | 997 | hwif->dma_host_on = &ide_dma_host_on; |
1023 | if (!hwif->ide_dma_check) | 998 | if (!hwif->ide_dma_check) |
1024 | hwif->ide_dma_check = &__ide_dma_check; | 999 | hwif->ide_dma_check = &config_drive_for_dma; |
1025 | if (!hwif->dma_setup) | 1000 | if (!hwif->dma_setup) |
1026 | hwif->dma_setup = &ide_dma_setup; | 1001 | hwif->dma_setup = &ide_dma_setup; |
1027 | if (!hwif->dma_exec_cmd) | 1002 | if (!hwif->dma_exec_cmd) |