aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-tape.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-tape.c')
-rw-r--r--drivers/ide/ide-tape.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index d6555984ee88..e3b4c1c39d37 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -152,11 +152,6 @@ struct idetape_bh {
152#define IDETAPE_LU_RETENSION_MASK 2 152#define IDETAPE_LU_RETENSION_MASK 2
153#define IDETAPE_LU_EOT_MASK 4 153#define IDETAPE_LU_EOT_MASK 4
154 154
155/* Error codes returned in rq->errors to the higher part of the driver. */
156#define IDETAPE_ERROR_GENERAL 101
157#define IDETAPE_ERROR_FILEMARK 102
158#define IDETAPE_ERROR_EOD 103
159
160/* Structures related to the SELECT SENSE / MODE SENSE packet commands. */ 155/* Structures related to the SELECT SENSE / MODE SENSE packet commands. */
161#define IDETAPE_BLOCK_DESCRIPTOR 0 156#define IDETAPE_BLOCK_DESCRIPTOR 0
162#define IDETAPE_CAPABILITIES_PAGE 0x2a 157#define IDETAPE_CAPABILITIES_PAGE 0x2a
@@ -422,19 +417,19 @@ static void idetape_analyze_error(ide_drive_t *drive, u8 *sense)
422 } 417 }
423 } 418 }
424 if (pc->c[0] == READ_6 && (sense[2] & 0x80)) { 419 if (pc->c[0] == READ_6 && (sense[2] & 0x80)) {
425 pc->error = IDETAPE_ERROR_FILEMARK; 420 pc->error = IDE_DRV_ERROR_FILEMARK;
426 pc->flags |= PC_FLAG_ABORT; 421 pc->flags |= PC_FLAG_ABORT;
427 } 422 }
428 if (pc->c[0] == WRITE_6) { 423 if (pc->c[0] == WRITE_6) {
429 if ((sense[2] & 0x40) || (tape->sense_key == 0xd 424 if ((sense[2] & 0x40) || (tape->sense_key == 0xd
430 && tape->asc == 0x0 && tape->ascq == 0x2)) { 425 && tape->asc == 0x0 && tape->ascq == 0x2)) {
431 pc->error = IDETAPE_ERROR_EOD; 426 pc->error = IDE_DRV_ERROR_EOD;
432 pc->flags |= PC_FLAG_ABORT; 427 pc->flags |= PC_FLAG_ABORT;
433 } 428 }
434 } 429 }
435 if (pc->c[0] == READ_6 || pc->c[0] == WRITE_6) { 430 if (pc->c[0] == READ_6 || pc->c[0] == WRITE_6) {
436 if (tape->sense_key == 8) { 431 if (tape->sense_key == 8) {
437 pc->error = IDETAPE_ERROR_EOD; 432 pc->error = IDE_DRV_ERROR_EOD;
438 pc->flags |= PC_FLAG_ABORT; 433 pc->flags |= PC_FLAG_ABORT;
439 } 434 }
440 if (!(pc->flags & PC_FLAG_ABORT) && 435 if (!(pc->flags & PC_FLAG_ABORT) &&
@@ -474,7 +469,7 @@ static int idetape_end_request(ide_drive_t *drive, int uptodate, int nr_sects)
474 debug_log(DBG_PROCS, "Enter %s\n", __func__); 469 debug_log(DBG_PROCS, "Enter %s\n", __func__);
475 470
476 switch (uptodate) { 471 switch (uptodate) {
477 case 0: error = IDETAPE_ERROR_GENERAL; break; 472 case 0: error = IDE_DRV_ERROR_GENERAL; break;
478 case 1: error = 0; break; 473 case 1: error = 0; break;
479 default: error = uptodate; 474 default: error = uptodate;
480 } 475 }
@@ -669,7 +664,7 @@ static ide_startstop_t idetape_issue_pc(ide_drive_t *drive,
669 tape->ascq); 664 tape->ascq);
670 } 665 }
671 /* Giving up */ 666 /* Giving up */
672 pc->error = IDETAPE_ERROR_GENERAL; 667 pc->error = IDE_DRV_ERROR_GENERAL;
673 } 668 }
674 drive->failed_pc = NULL; 669 drive->failed_pc = NULL;
675 drive->pc_callback(drive, 0); 670 drive->pc_callback(drive, 0);
@@ -730,7 +725,7 @@ static ide_startstop_t idetape_media_access_finished(ide_drive_t *drive)
730 } 725 }
731 pc->error = 0; 726 pc->error = 0;
732 } else { 727 } else {
733 pc->error = IDETAPE_ERROR_GENERAL; 728 pc->error = IDE_DRV_ERROR_GENERAL;
734 drive->failed_pc = NULL; 729 drive->failed_pc = NULL;
735 } 730 }
736 drive->pc_callback(drive, 0); 731 drive->pc_callback(drive, 0);
@@ -1210,7 +1205,7 @@ static int idetape_queue_rw_tail(ide_drive_t *drive, int cmd, int blocks,
1210 1205
1211 if (tape->merge_bh) 1206 if (tape->merge_bh)
1212 idetape_init_merge_buffer(tape); 1207 idetape_init_merge_buffer(tape);
1213 if (errors == IDETAPE_ERROR_GENERAL) 1208 if (errors == IDE_DRV_ERROR_GENERAL)
1214 return -EIO; 1209 return -EIO;
1215 return ret; 1210 return ret;
1216} 1211}