diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-13 15:39:32 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-13 15:39:32 -0400 |
commit | 6b0da28b2d0f4f4e2c55689fc062db569075ff60 (patch) | |
tree | e7113f6db70fe3c2dd16bd2e7e1538fba4236c49 /drivers/ide/ide-tape.c | |
parent | 67c56364df843fb9e3ed1af014b8fbe4b22ff25d (diff) |
ide: add ide_retry_pc() helper
* Add ide_create_request_sense_cmd() and ide_retry_pc() helpers
and convert ide-{atapi,floppy,tape}.c to use them.
* Remove no longer used ide*_create_request_sense_cmd(),
ide*_retry_pc() and 'retry_pc' argument from ide_pc_intr().
* Make ide_queue_pc_head() static.
There should be no functional changes caused by this patch.
Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-tape.c')
-rw-r--r-- | drivers/ide/ide-tape.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 72ecc5657db2..72caca3cb7aa 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -581,31 +581,6 @@ static void ide_tape_callback(ide_drive_t *drive, int dsc) | |||
581 | idetape_end_request(drive, uptodate, 0); | 581 | idetape_end_request(drive, uptodate, 0); |
582 | } | 582 | } |
583 | 583 | ||
584 | static void idetape_create_request_sense_cmd(struct ide_atapi_pc *pc) | ||
585 | { | ||
586 | ide_init_pc(pc); | ||
587 | pc->c[0] = REQUEST_SENSE; | ||
588 | pc->c[4] = 20; | ||
589 | pc->req_xfer = 20; | ||
590 | } | ||
591 | |||
592 | /* | ||
593 | * idetape_retry_pc is called when an error was detected during the | ||
594 | * last packet command. We queue a request sense packet command in | ||
595 | * the head of the request list. | ||
596 | */ | ||
597 | static void idetape_retry_pc(ide_drive_t *drive) | ||
598 | { | ||
599 | struct ide_tape_obj *tape = drive->driver_data; | ||
600 | struct request *rq = &drive->request_sense_rq; | ||
601 | struct ide_atapi_pc *pc = &drive->request_sense_pc; | ||
602 | |||
603 | (void)ide_read_error(drive); | ||
604 | idetape_create_request_sense_cmd(pc); | ||
605 | set_bit(IDE_AFLAG_IGNORE_DSC, &drive->atapi_flags); | ||
606 | ide_queue_pc_head(drive, tape->disk, pc, rq); | ||
607 | } | ||
608 | |||
609 | /* | 584 | /* |
610 | * Postpone the current request so that ide.c will be able to service requests | 585 | * Postpone the current request so that ide.c will be able to service requests |
611 | * from another device on the same hwgroup while we are polling for DSC. | 586 | * from another device on the same hwgroup while we are polling for DSC. |
@@ -653,7 +628,7 @@ static int ide_tape_io_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
653 | static ide_startstop_t idetape_pc_intr(ide_drive_t *drive) | 628 | static ide_startstop_t idetape_pc_intr(ide_drive_t *drive) |
654 | { | 629 | { |
655 | return ide_pc_intr(drive, idetape_pc_intr, idetape_update_buffers, | 630 | return ide_pc_intr(drive, idetape_pc_intr, idetape_update_buffers, |
656 | idetape_retry_pc, ide_tape_io_buffers); | 631 | ide_tape_io_buffers); |
657 | } | 632 | } |
658 | 633 | ||
659 | /* | 634 | /* |
@@ -789,7 +764,7 @@ static ide_startstop_t idetape_media_access_finished(ide_drive_t *drive) | |||
789 | printk(KERN_ERR "ide-tape: %s: I/O error, ", | 764 | printk(KERN_ERR "ide-tape: %s: I/O error, ", |
790 | tape->name); | 765 | tape->name); |
791 | /* Retry operation */ | 766 | /* Retry operation */ |
792 | idetape_retry_pc(drive); | 767 | ide_retry_pc(drive, tape->disk); |
793 | return ide_stopped; | 768 | return ide_stopped; |
794 | } | 769 | } |
795 | pc->error = 0; | 770 | pc->error = 0; |