diff options
Diffstat (limited to 'drivers/ide/ide-lib.c')
-rw-r--r-- | drivers/ide/ide-lib.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c index 8237d89eec6e..8afce4ceea31 100644 --- a/drivers/ide/ide-lib.c +++ b/drivers/ide/ide-lib.c | |||
@@ -205,6 +205,21 @@ int ide_dma_enable (ide_drive_t *drive) | |||
205 | 205 | ||
206 | EXPORT_SYMBOL(ide_dma_enable); | 206 | EXPORT_SYMBOL(ide_dma_enable); |
207 | 207 | ||
208 | int ide_use_fast_pio(ide_drive_t *drive) | ||
209 | { | ||
210 | struct hd_driveid *id = drive->id; | ||
211 | |||
212 | if ((id->capability & 1) && drive->autodma) | ||
213 | return 1; | ||
214 | |||
215 | if ((id->capability & 8) || (id->field_valid & 2)) | ||
216 | return 1; | ||
217 | |||
218 | return 0; | ||
219 | } | ||
220 | |||
221 | EXPORT_SYMBOL_GPL(ide_use_fast_pio); | ||
222 | |||
208 | /* | 223 | /* |
209 | * Standard (generic) timings for PIO modes, from ATA2 specification. | 224 | * Standard (generic) timings for PIO modes, from ATA2 specification. |
210 | * These timings are for access to the IDE data port register *only*. | 225 | * These timings are for access to the IDE data port register *only*. |
@@ -349,7 +364,6 @@ u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_p | |||
349 | int use_iordy = 0; | 364 | int use_iordy = 0; |
350 | struct hd_driveid* id = drive->id; | 365 | struct hd_driveid* id = drive->id; |
351 | int overridden = 0; | 366 | int overridden = 0; |
352 | int blacklisted = 0; | ||
353 | 367 | ||
354 | if (mode_wanted != 255) { | 368 | if (mode_wanted != 255) { |
355 | pio_mode = mode_wanted; | 369 | pio_mode = mode_wanted; |
@@ -357,7 +371,6 @@ u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_p | |||
357 | pio_mode = 0; | 371 | pio_mode = 0; |
358 | } else if ((pio_mode = ide_scan_pio_blacklist(id->model)) != -1) { | 372 | } else if ((pio_mode = ide_scan_pio_blacklist(id->model)) != -1) { |
359 | overridden = 1; | 373 | overridden = 1; |
360 | blacklisted = 1; | ||
361 | use_iordy = (pio_mode > 2); | 374 | use_iordy = (pio_mode > 2); |
362 | } else { | 375 | } else { |
363 | pio_mode = id->tPIO; | 376 | pio_mode = id->tPIO; |
@@ -409,7 +422,6 @@ u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_p | |||
409 | d->cycle_time = cycle_time ? cycle_time : ide_pio_timings[pio_mode].cycle_time; | 422 | d->cycle_time = cycle_time ? cycle_time : ide_pio_timings[pio_mode].cycle_time; |
410 | d->use_iordy = use_iordy; | 423 | d->use_iordy = use_iordy; |
411 | d->overridden = overridden; | 424 | d->overridden = overridden; |
412 | d->blacklisted = blacklisted; | ||
413 | } | 425 | } |
414 | return pio_mode; | 426 | return pio_mode; |
415 | } | 427 | } |
@@ -462,8 +474,6 @@ int ide_set_xfer_rate(ide_drive_t *drive, u8 rate) | |||
462 | return -1; | 474 | return -1; |
463 | } | 475 | } |
464 | 476 | ||
465 | EXPORT_SYMBOL_GPL(ide_set_xfer_rate); | ||
466 | |||
467 | static void ide_dump_opcode(ide_drive_t *drive) | 477 | static void ide_dump_opcode(ide_drive_t *drive) |
468 | { | 478 | { |
469 | struct request *rq; | 479 | struct request *rq; |