aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-cd.c
diff options
context:
space:
mode:
authorBorislav Petkov <petkovbb@gmail.com>2009-01-02 10:12:53 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-01-02 10:12:53 -0500
commit4cad085efbce8dcc5006b0d1034089758b4fc7ba (patch)
treef9aeb0e7eec115e56aada920eefa40b093aec434 /drivers/ide/ide-cd.c
parent5f25843fa79b7c35097b0ffe8b2c5cc2428d6495 (diff)
ide-cd: move cdrom_timer_expiry to ide-atapi.c
- cdrom_timer_expiry -> ide_cd_expiry - remove expiry-arg to ide_issue_pc as it is redundant now - ide_debug_log -> debug_log Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-cd.c')
-rw-r--r--drivers/ide/ide-cd.c38
1 files changed, 3 insertions, 35 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 8d3c7714682e..105e4d855e6e 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -511,38 +511,6 @@ end_request:
511 return 1; 511 return 1;
512} 512}
513 513
514static int cdrom_timer_expiry(ide_drive_t *drive)
515{
516 struct request *rq = HWGROUP(drive)->rq;
517 unsigned long wait = 0;
518
519 ide_debug_log(IDE_DBG_RQ, "Call %s: rq->cmd[0]: 0x%x\n", __func__,
520 rq->cmd[0]);
521
522 /*
523 * Some commands are *slow* and normally take a long time to complete.
524 * Usually we can use the ATAPI "disconnect" to bypass this, but not all
525 * commands/drives support that. Let ide_timer_expiry keep polling us
526 * for these.
527 */
528 switch (rq->cmd[0]) {
529 case GPCMD_BLANK:
530 case GPCMD_FORMAT_UNIT:
531 case GPCMD_RESERVE_RZONE_TRACK:
532 case GPCMD_CLOSE_TRACK:
533 case GPCMD_FLUSH_CACHE:
534 wait = ATAPI_WAIT_PC;
535 break;
536 default:
537 if (!(rq->cmd_flags & REQ_QUIET))
538 printk(KERN_INFO PFX "cmd 0x%x timed out\n",
539 rq->cmd[0]);
540 wait = 0;
541 break;
542 }
543 return wait;
544}
545
546/* 514/*
547 * Set up the device registers for transferring a packet command on DEV, 515 * Set up the device registers for transferring a packet command on DEV,
548 * expecting to later transfer XFERLEN bytes. HANDLER is the routine 516 * expecting to later transfer XFERLEN bytes. HANDLER is the routine
@@ -574,7 +542,7 @@ static ide_startstop_t cdrom_start_packet_command(ide_drive_t *drive,
574 542
575 /* packet command */ 543 /* packet command */
576 ide_execute_command(drive, ATA_CMD_PACKET, handler, 544 ide_execute_command(drive, ATA_CMD_PACKET, handler,
577 ATAPI_WAIT_PC, cdrom_timer_expiry); 545 ATAPI_WAIT_PC, ide_cd_expiry);
578 return ide_started; 546 return ide_started;
579 } else { 547 } else {
580 ide_execute_pkt_cmd(drive); 548 ide_execute_pkt_cmd(drive);
@@ -621,7 +589,7 @@ static ide_startstop_t cdrom_transfer_packet_command(ide_drive_t *drive,
621 } 589 }
622 590
623 /* arm the interrupt handler */ 591 /* arm the interrupt handler */
624 ide_set_handler(drive, handler, rq->timeout, cdrom_timer_expiry); 592 ide_set_handler(drive, handler, rq->timeout, ide_cd_expiry);
625 593
626 /* ATAPI commands get padded out to 12 bytes minimum */ 594 /* ATAPI commands get padded out to 12 bytes minimum */
627 cmd_len = COMMAND_SIZE(rq->cmd[0]); 595 cmd_len = COMMAND_SIZE(rq->cmd[0]);
@@ -1088,7 +1056,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
1088 } else { 1056 } else {
1089 timeout = ATAPI_WAIT_PC; 1057 timeout = ATAPI_WAIT_PC;
1090 if (!blk_fs_request(rq)) 1058 if (!blk_fs_request(rq))
1091 expiry = cdrom_timer_expiry; 1059 expiry = ide_cd_expiry;
1092 } 1060 }
1093 1061
1094 ide_set_handler(drive, cdrom_newpc_intr, timeout, expiry); 1062 ide_set_handler(drive, cdrom_newpc_intr, timeout, expiry);