diff options
author | Borislav Petkov <petkovbb@googlemail.com> | 2009-01-02 10:12:55 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-01-02 10:12:55 -0500 |
commit | def860d061d0fcab7fbbe193c0b8b8f0b9b4c828 (patch) | |
tree | 9ba849221a1bb50dc04b77dffd246729699e8f88 /drivers/ide | |
parent | 8c662852d1aa35ed370942ef2740759cd334d2d5 (diff) |
ide-atapi: assign expiry and timeout based on device type
There should be no functionality change resulting from this patch.
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-atapi.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c index 5fdcb953fc13..cf2b99c37364 100644 --- a/drivers/ide/ide-atapi.c +++ b/drivers/ide/ide-atapi.c | |||
@@ -525,21 +525,25 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive) | |||
525 | cmd_len = COMMAND_SIZE(rq->cmd[0]); | 525 | cmd_len = COMMAND_SIZE(rq->cmd[0]); |
526 | if (cmd_len < ATAPI_MIN_CDB_BYTES) | 526 | if (cmd_len < ATAPI_MIN_CDB_BYTES) |
527 | cmd_len = ATAPI_MIN_CDB_BYTES; | 527 | cmd_len = ATAPI_MIN_CDB_BYTES; |
528 | } else | ||
529 | cmd_len = ATAPI_MIN_CDB_BYTES; | ||
530 | 528 | ||
531 | /* | 529 | timeout = rq->timeout; |
532 | * If necessary schedule the packet transfer to occur 'timeout' | 530 | expiry = ide_cd_expiry; |
533 | * miliseconds later in ide_delayed_transfer_pc() after the device | ||
534 | * says it's ready for a packet. | ||
535 | */ | ||
536 | if (drive->atapi_flags & IDE_AFLAG_ZIP_DRIVE) { | ||
537 | timeout = drive->pc_delay; | ||
538 | expiry = &ide_delayed_transfer_pc; | ||
539 | } else { | 531 | } else { |
540 | timeout = (drive->media == ide_floppy) ? WAIT_FLOPPY_CMD | 532 | cmd_len = ATAPI_MIN_CDB_BYTES; |
541 | : WAIT_TAPE_CMD; | 533 | |
542 | expiry = NULL; | 534 | /* |
535 | * If necessary schedule the packet transfer to occur 'timeout' | ||
536 | * miliseconds later in ide_delayed_transfer_pc() after the | ||
537 | * device says it's ready for a packet. | ||
538 | */ | ||
539 | if (drive->atapi_flags & IDE_AFLAG_ZIP_DRIVE) { | ||
540 | timeout = drive->pc_delay; | ||
541 | expiry = &ide_delayed_transfer_pc; | ||
542 | } else { | ||
543 | timeout = (drive->media == ide_floppy) ? WAIT_FLOPPY_CMD | ||
544 | : WAIT_TAPE_CMD; | ||
545 | expiry = NULL; | ||
546 | } | ||
543 | } | 547 | } |
544 | 548 | ||
545 | /* Set the interrupt routine */ | 549 | /* Set the interrupt routine */ |