aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-tape.c
diff options
context:
space:
mode:
authorBorislav Petkov <petkovbb@gmail.com>2008-04-17 18:46:26 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-17 18:46:26 -0400
commit346331f82823682fb5c2df6e827db25d95cc2e92 (patch)
tree3df38f3a2c9bcfd51b44c2183fa18e1a5db82c3e /drivers/ide/ide-tape.c
parent03056b909b72c47cbba3605ea3b48a63ef031736 (diff)
ide-tape: remove atomic test/set macros for packet commands
Removing the atomic tests for pc's is unobjectionable. Since this driver will probably go to /dev/null soon, the atomic tests for tape->flags are left in place for there are some situations where they're needed (chrdev DSC handling, low level pipeline operation and so on). While at it, rename all test/set flag bit defines explicitly to *_FLAG_* for clarity. Signed-off-by: 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.c207
1 files changed, 110 insertions, 97 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index b34d1bb94e55..ce3a23e18ce9 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -209,21 +209,21 @@ typedef struct idetape_packet_command_s {
209 unsigned long flags; 209 unsigned long flags;
210} idetape_pc_t; 210} idetape_pc_t;
211 211
212/* 212/* Packet command flag bits. */
213 * Packet command flag bits. 213enum {
214 */ 214 /* Set when an error is considered normal - We won't retry */
215/* Set when an error is considered normal - We won't retry */ 215 PC_FLAG_ABORT = (1 << 0),
216#define PC_ABORT 0 216 /* 1 When polling for DSC on a media access command */
217/* 1 When polling for DSC on a media access command */ 217 PC_FLAG_WAIT_FOR_DSC = (1 << 1),
218#define PC_WAIT_FOR_DSC 1 218 /* 1 when we prefer to use DMA if possible */
219/* 1 when we prefer to use DMA if possible */ 219 PC_FLAG_DMA_RECOMMENDED = (1 << 2),
220#define PC_DMA_RECOMMENDED 2 220 /* 1 while DMA in progress */
221/* 1 while DMA in progress */ 221 PC_FLAG_DMA_IN_PROGRESS = (1 << 3),
222#define PC_DMA_IN_PROGRESS 3 222 /* 1 when encountered problem during DMA */
223/* 1 when encountered problem during DMA */ 223 PC_FLAG_DMA_ERROR = (1 << 4),
224#define PC_DMA_ERROR 4 224 /* Data direction */
225/* Data direction */ 225 PC_FLAG_WRITING = (1 << 5),
226#define PC_WRITING 5 226};
227 227
228/* Tape door status */ 228/* Tape door status */
229#define DOOR_UNLOCKED 0 229#define DOOR_UNLOCKED 0
@@ -262,6 +262,27 @@ enum {
262#define IDETAPE_BLOCK_DESCRIPTOR 0 262#define IDETAPE_BLOCK_DESCRIPTOR 0
263#define IDETAPE_CAPABILITIES_PAGE 0x2a 263#define IDETAPE_CAPABILITIES_PAGE 0x2a
264 264
265/* Tape flag bits values. */
266enum {
267 IDETAPE_FLAG_IGNORE_DSC = (1 << 0),
268 /* 0 When the tape position is unknown */
269 IDETAPE_FLAG_ADDRESS_VALID = (1 << 1),
270 /* Device already opened */
271 IDETAPE_FLAG_BUSY = (1 << 2),
272 /* Error detected in a pipeline stage */
273 IDETAPE_FLAG_PIPELINE_ERR = (1 << 3),
274 /* Attempt to auto-detect the current user block size */
275 IDETAPE_FLAG_DETECT_BS = (1 << 4),
276 /* Currently on a filemark */
277 IDETAPE_FLAG_FILEMARK = (1 << 5),
278 /* DRQ interrupt device */
279 IDETAPE_FLAG_DRQ_INTERRUPT = (1 << 6),
280 /* pipeline active */
281 IDETAPE_FLAG_PIPELINE_ACTIVE = (1 << 7),
282 /* 0 = no tape is loaded, so we don't rewind after ejecting */
283 IDETAPE_FLAG_MEDIUM_PRESENT = (1 << 8),
284};
285
265/* A pipeline stage. */ 286/* A pipeline stage. */
266typedef struct idetape_stage_s { 287typedef struct idetape_stage_s {
267 struct request rq; /* The corresponding request */ 288 struct request rq; /* The corresponding request */
@@ -484,21 +505,6 @@ static void ide_tape_put(struct ide_tape_obj *tape)
484} 505}
485 506
486/* 507/*
487 * Tape flag bits values.
488 */
489#define IDETAPE_IGNORE_DSC 0
490#define IDETAPE_ADDRESS_VALID 1 /* 0 When the tape position is unknown */
491#define IDETAPE_BUSY 2 /* Device already opened */
492#define IDETAPE_PIPELINE_ERROR 3 /* Error detected in a pipeline stage */
493#define IDETAPE_DETECT_BS 4 /* Attempt to auto-detect the current user block size */
494#define IDETAPE_FILEMARK 5 /* Currently on a filemark */
495#define IDETAPE_DRQ_INTERRUPT 6 /* DRQ interrupt device */
496#define IDETAPE_READ_ERROR 7
497#define IDETAPE_PIPELINE_ACTIVE 8 /* pipeline active */
498/* 0 = no tape is loaded, so we don't rewind after ejecting */
499#define IDETAPE_MEDIUM_PRESENT 9
500
501/*
502 * The variables below are used for the character device interface. Additional 508 * The variables below are used for the character device interface. Additional
503 * state variables are defined in our ide_drive_t structure. 509 * state variables are defined in our ide_drive_t structure.
504 */ 510 */
@@ -581,7 +587,7 @@ static void idetape_update_buffers(idetape_pc_t *pc)
581 int count; 587 int count;
582 unsigned int bcount = pc->actually_transferred; 588 unsigned int bcount = pc->actually_transferred;
583 589
584 if (test_bit(PC_WRITING, &pc->flags)) 590 if (pc->flags & PC_FLAG_WRITING)
585 return; 591 return;
586 while (bcount) { 592 while (bcount) {
587 if (bh == NULL) { 593 if (bh == NULL) {
@@ -668,7 +674,7 @@ static void idetape_analyze_error(ide_drive_t *drive, u8 *sense)
668 pc->c[0], tape->sense_key, tape->asc, tape->ascq); 674 pc->c[0], tape->sense_key, tape->asc, tape->ascq);
669 675
670 /* Correct pc->actually_transferred by asking the tape. */ 676 /* Correct pc->actually_transferred by asking the tape. */
671 if (test_bit(PC_DMA_ERROR, &pc->flags)) { 677 if (pc->flags & PC_FLAG_DMA_ERROR) {
672 pc->actually_transferred = pc->request_transfer - 678 pc->actually_transferred = pc->request_transfer -
673 tape->blk_size * 679 tape->blk_size *
674 be32_to_cpu(get_unaligned((u32 *)&sense[3])); 680 be32_to_cpu(get_unaligned((u32 *)&sense[3]));
@@ -687,26 +693,26 @@ static void idetape_analyze_error(ide_drive_t *drive, u8 *sense)
687 /* don't report an error, everything's ok */ 693 /* don't report an error, everything's ok */
688 pc->error = 0; 694 pc->error = 0;
689 /* don't retry read/write */ 695 /* don't retry read/write */
690 set_bit(PC_ABORT, &pc->flags); 696 pc->flags |= PC_FLAG_ABORT;
691 } 697 }
692 } 698 }
693 if (pc->c[0] == READ_6 && (sense[2] & 0x80)) { 699 if (pc->c[0] == READ_6 && (sense[2] & 0x80)) {
694 pc->error = IDETAPE_ERROR_FILEMARK; 700 pc->error = IDETAPE_ERROR_FILEMARK;
695 set_bit(PC_ABORT, &pc->flags); 701 pc->flags |= PC_FLAG_ABORT;
696 } 702 }
697 if (pc->c[0] == WRITE_6) { 703 if (pc->c[0] == WRITE_6) {
698 if ((sense[2] & 0x40) || (tape->sense_key == 0xd 704 if ((sense[2] & 0x40) || (tape->sense_key == 0xd
699 && tape->asc == 0x0 && tape->ascq == 0x2)) { 705 && tape->asc == 0x0 && tape->ascq == 0x2)) {
700 pc->error = IDETAPE_ERROR_EOD; 706 pc->error = IDETAPE_ERROR_EOD;
701 set_bit(PC_ABORT, &pc->flags); 707 pc->flags |= PC_FLAG_ABORT;
702 } 708 }
703 } 709 }
704 if (pc->c[0] == READ_6 || pc->c[0] == WRITE_6) { 710 if (pc->c[0] == READ_6 || pc->c[0] == WRITE_6) {
705 if (tape->sense_key == 8) { 711 if (tape->sense_key == 8) {
706 pc->error = IDETAPE_ERROR_EOD; 712 pc->error = IDETAPE_ERROR_EOD;
707 set_bit(PC_ABORT, &pc->flags); 713 pc->flags |= PC_FLAG_ABORT;
708 } 714 }
709 if (!test_bit(PC_ABORT, &pc->flags) && 715 if (!(pc->flags & PC_FLAG_ABORT) &&
710 pc->actually_transferred) 716 pc->actually_transferred)
711 pc->retries = IDETAPE_MAX_PC_RETRIES + 1; 717 pc->retries = IDETAPE_MAX_PC_RETRIES + 1;
712 } 718 }
@@ -862,14 +868,16 @@ static int idetape_end_request(ide_drive_t *drive, int uptodate, int nr_sects)
862 if (rq->cmd[0] & REQ_IDETAPE_WRITE) { 868 if (rq->cmd[0] & REQ_IDETAPE_WRITE) {
863 remove_stage = 1; 869 remove_stage = 1;
864 if (error) { 870 if (error) {
865 set_bit(IDETAPE_PIPELINE_ERROR, &tape->flags); 871 set_bit(IDETAPE_FLAG_PIPELINE_ERR,
872 &tape->flags);
866 if (error == IDETAPE_ERROR_EOD) 873 if (error == IDETAPE_ERROR_EOD)
867 idetape_abort_pipeline(drive, 874 idetape_abort_pipeline(drive,
868 active_stage); 875 active_stage);
869 } 876 }
870 } else if (rq->cmd[0] & REQ_IDETAPE_READ) { 877 } else if (rq->cmd[0] & REQ_IDETAPE_READ) {
871 if (error == IDETAPE_ERROR_EOD) { 878 if (error == IDETAPE_ERROR_EOD) {
872 set_bit(IDETAPE_PIPELINE_ERROR, &tape->flags); 879 set_bit(IDETAPE_FLAG_PIPELINE_ERR,
880 &tape->flags);
873 idetape_abort_pipeline(drive, active_stage); 881 idetape_abort_pipeline(drive, active_stage);
874 } 882 }
875 } 883 }
@@ -902,7 +910,7 @@ static int idetape_end_request(ide_drive_t *drive, int uptodate, int nr_sects)
902 if (remove_stage) 910 if (remove_stage)
903 idetape_remove_stage_head(drive); 911 idetape_remove_stage_head(drive);
904 if (tape->active_data_rq == NULL) 912 if (tape->active_data_rq == NULL)
905 clear_bit(IDETAPE_PIPELINE_ACTIVE, &tape->flags); 913 clear_bit(IDETAPE_FLAG_PIPELINE_ACTIVE, &tape->flags);
906 spin_unlock_irqrestore(&tape->lock, flags); 914 spin_unlock_irqrestore(&tape->lock, flags);
907 return 0; 915 return 0;
908} 916}
@@ -981,7 +989,7 @@ static ide_startstop_t idetape_retry_pc (ide_drive_t *drive)
981 pc = idetape_next_pc_storage(drive); 989 pc = idetape_next_pc_storage(drive);
982 rq = idetape_next_rq_storage(drive); 990 rq = idetape_next_rq_storage(drive);
983 idetape_create_request_sense_cmd(pc); 991 idetape_create_request_sense_cmd(pc);
984 set_bit(IDETAPE_IGNORE_DSC, &tape->flags); 992 set_bit(IDETAPE_FLAG_IGNORE_DSC, &tape->flags);
985 idetape_queue_pc_head(drive, pc, rq); 993 idetape_queue_pc_head(drive, pc, rq);
986 return ide_stopped; 994 return ide_stopped;
987} 995}
@@ -1028,7 +1036,7 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
1028 /* Clear the interrupt */ 1036 /* Clear the interrupt */
1029 stat = ide_read_status(drive); 1037 stat = ide_read_status(drive);
1030 1038
1031 if (test_bit(PC_DMA_IN_PROGRESS, &pc->flags)) { 1039 if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) {
1032 if (hwif->ide_dma_end(drive) || (stat & ERR_STAT)) { 1040 if (hwif->ide_dma_end(drive) || (stat & ERR_STAT)) {
1033 /* 1041 /*
1034 * A DMA error is sometimes expected. For example, 1042 * A DMA error is sometimes expected. For example,
@@ -1051,7 +1059,7 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
1051 * data transfer will occur, but no DMA error. 1059 * data transfer will occur, but no DMA error.
1052 * (AS, 19 Apr 2001) 1060 * (AS, 19 Apr 2001)
1053 */ 1061 */
1054 set_bit(PC_DMA_ERROR, &pc->flags); 1062 pc->flags |= PC_FLAG_DMA_ERROR;
1055 } else { 1063 } else {
1056 pc->actually_transferred = pc->request_transfer; 1064 pc->actually_transferred = pc->request_transfer;
1057 idetape_update_buffers(pc); 1065 idetape_update_buffers(pc);
@@ -1065,7 +1073,7 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
1065 debug_log(DBG_SENSE, "Packet command completed, %d bytes" 1073 debug_log(DBG_SENSE, "Packet command completed, %d bytes"
1066 " transferred\n", pc->actually_transferred); 1074 " transferred\n", pc->actually_transferred);
1067 1075
1068 clear_bit(PC_DMA_IN_PROGRESS, &pc->flags); 1076 pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS;
1069 local_irq_enable(); 1077 local_irq_enable();
1070 1078
1071#if SIMULATE_ERRORS 1079#if SIMULATE_ERRORS
@@ -1078,7 +1086,7 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
1078#endif 1086#endif
1079 if ((stat & ERR_STAT) && pc->c[0] == REQUEST_SENSE) 1087 if ((stat & ERR_STAT) && pc->c[0] == REQUEST_SENSE)
1080 stat &= ~ERR_STAT; 1088 stat &= ~ERR_STAT;
1081 if ((stat & ERR_STAT) || test_bit(PC_DMA_ERROR, &pc->flags)) { 1089 if ((stat & ERR_STAT) || (pc->flags & PC_FLAG_DMA_ERROR)) {
1082 /* Error detected */ 1090 /* Error detected */
1083 debug_log(DBG_ERR, "%s: I/O error\n", tape->name); 1091 debug_log(DBG_ERR, "%s: I/O error\n", tape->name);
1084 1092
@@ -1094,7 +1102,7 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
1094 return idetape_retry_pc(drive); 1102 return idetape_retry_pc(drive);
1095 } 1103 }
1096 pc->error = 0; 1104 pc->error = 0;
1097 if (test_bit(PC_WAIT_FOR_DSC, &pc->flags) && 1105 if ((pc->flags & PC_FLAG_WAIT_FOR_DSC) &&
1098 (stat & SEEK_STAT) == 0) { 1106 (stat & SEEK_STAT) == 0) {
1099 /* Media access command */ 1107 /* Media access command */
1100 tape->dsc_polling_start = jiffies; 1108 tape->dsc_polling_start = jiffies;
@@ -1109,7 +1117,9 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
1109 /* Command finished - Call the callback function */ 1117 /* Command finished - Call the callback function */
1110 return pc->callback(drive); 1118 return pc->callback(drive);
1111 } 1119 }
1112 if (test_and_clear_bit(PC_DMA_IN_PROGRESS, &pc->flags)) { 1120
1121 if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) {
1122 pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS;
1113 printk(KERN_ERR "ide-tape: The tape wants to issue more " 1123 printk(KERN_ERR "ide-tape: The tape wants to issue more "
1114 "interrupts in DMA mode\n"); 1124 "interrupts in DMA mode\n");
1115 printk(KERN_ERR "ide-tape: DMA disabled, reverting to PIO\n"); 1125 printk(KERN_ERR "ide-tape: DMA disabled, reverting to PIO\n");
@@ -1126,7 +1136,7 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
1126 printk(KERN_ERR "ide-tape: CoD != 0 in %s\n", __func__); 1136 printk(KERN_ERR "ide-tape: CoD != 0 in %s\n", __func__);
1127 return ide_do_reset(drive); 1137 return ide_do_reset(drive);
1128 } 1138 }
1129 if (((ireason & IO) == IO) == test_bit(PC_WRITING, &pc->flags)) { 1139 if (((ireason & IO) == IO) == !!(pc->flags & PC_FLAG_WRITING)) {
1130 /* Hopefully, we will never get here */ 1140 /* Hopefully, we will never get here */
1131 printk(KERN_ERR "ide-tape: We wanted to %s, ", 1141 printk(KERN_ERR "ide-tape: We wanted to %s, ",
1132 (ireason & IO) ? "Write" : "Read"); 1142 (ireason & IO) ? "Write" : "Read");
@@ -1134,7 +1144,7 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
1134 (ireason & IO) ? "Read" : "Write"); 1144 (ireason & IO) ? "Read" : "Write");
1135 return ide_do_reset(drive); 1145 return ide_do_reset(drive);
1136 } 1146 }
1137 if (!test_bit(PC_WRITING, &pc->flags)) { 1147 if (!(pc->flags & PC_FLAG_WRITING)) {
1138 /* Reading - Check that we have enough space */ 1148 /* Reading - Check that we have enough space */
1139 temp = pc->actually_transferred + bcount; 1149 temp = pc->actually_transferred + bcount;
1140 if (temp > pc->request_transfer) { 1150 if (temp > pc->request_transfer) {
@@ -1246,7 +1256,7 @@ static ide_startstop_t idetape_transfer_pc(ide_drive_t *drive)
1246 ide_set_handler(drive, &idetape_pc_intr, IDETAPE_WAIT_CMD, NULL); 1256 ide_set_handler(drive, &idetape_pc_intr, IDETAPE_WAIT_CMD, NULL);
1247#ifdef CONFIG_BLK_DEV_IDEDMA 1257#ifdef CONFIG_BLK_DEV_IDEDMA
1248 /* Begin DMA, if necessary */ 1258 /* Begin DMA, if necessary */
1249 if (test_bit(PC_DMA_IN_PROGRESS, &pc->flags)) 1259 if (pc->flags & PC_FLAG_DMA_IN_PROGRESS)
1250 hwif->dma_start(drive); 1260 hwif->dma_start(drive);
1251#endif 1261#endif
1252 /* Send the actual packet */ 1262 /* Send the actual packet */
@@ -1273,13 +1283,13 @@ static ide_startstop_t idetape_issue_pc(ide_drive_t *drive, idetape_pc_t *pc)
1273 tape->pc = pc; 1283 tape->pc = pc;
1274 1284
1275 if (pc->retries > IDETAPE_MAX_PC_RETRIES || 1285 if (pc->retries > IDETAPE_MAX_PC_RETRIES ||
1276 test_bit(PC_ABORT, &pc->flags)) { 1286 (pc->flags & PC_FLAG_ABORT)) {
1277 /* 1287 /*
1278 * We will "abort" retrying a packet command in case legitimate 1288 * We will "abort" retrying a packet command in case legitimate
1279 * error code was received (crossing a filemark, or end of the 1289 * error code was received (crossing a filemark, or end of the
1280 * media, for example). 1290 * media, for example).
1281 */ 1291 */
1282 if (!test_bit(PC_ABORT, &pc->flags)) { 1292 if (!(pc->flags & PC_FLAG_ABORT)) {
1283 if (!(pc->c[0] == TEST_UNIT_READY && 1293 if (!(pc->c[0] == TEST_UNIT_READY &&
1284 tape->sense_key == 2 && tape->asc == 4 && 1294 tape->sense_key == 2 && tape->asc == 4 &&
1285 (tape->ascq == 1 || tape->ascq == 8))) { 1295 (tape->ascq == 1 || tape->ascq == 8))) {
@@ -1305,20 +1315,22 @@ static ide_startstop_t idetape_issue_pc(ide_drive_t *drive, idetape_pc_t *pc)
1305 /* Request to transfer the entire buffer at once */ 1315 /* Request to transfer the entire buffer at once */
1306 bcount = pc->request_transfer; 1316 bcount = pc->request_transfer;
1307 1317
1308 if (test_and_clear_bit(PC_DMA_ERROR, &pc->flags)) { 1318 if (pc->flags & PC_FLAG_DMA_ERROR) {
1319 pc->flags &= ~PC_FLAG_DMA_ERROR;
1309 printk(KERN_WARNING "ide-tape: DMA disabled, " 1320 printk(KERN_WARNING "ide-tape: DMA disabled, "
1310 "reverting to PIO\n"); 1321 "reverting to PIO\n");
1311 ide_dma_off(drive); 1322 ide_dma_off(drive);
1312 } 1323 }
1313 if (test_bit(PC_DMA_RECOMMENDED, &pc->flags) && drive->using_dma) 1324 if ((pc->flags & PC_FLAG_DMA_RECOMMENDED) && drive->using_dma)
1314 dma_ok = !hwif->dma_setup(drive); 1325 dma_ok = !hwif->dma_setup(drive);
1315 1326
1316 ide_pktcmd_tf_load(drive, IDE_TFLAG_NO_SELECT_MASK | 1327 ide_pktcmd_tf_load(drive, IDE_TFLAG_NO_SELECT_MASK |
1317 IDE_TFLAG_OUT_DEVICE, bcount, dma_ok); 1328 IDE_TFLAG_OUT_DEVICE, bcount, dma_ok);
1318 1329
1319 if (dma_ok) /* Will begin DMA later */ 1330 if (dma_ok)
1320 set_bit(PC_DMA_IN_PROGRESS, &pc->flags); 1331 /* Will begin DMA later */
1321 if (test_bit(IDETAPE_DRQ_INTERRUPT, &tape->flags)) { 1332 pc->flags |= PC_FLAG_DMA_IN_PROGRESS;
1333 if (test_bit(IDETAPE_FLAG_DRQ_INTERRUPT, &tape->flags)) {
1322 ide_execute_command(drive, WIN_PACKETCMD, &idetape_transfer_pc, 1334 ide_execute_command(drive, WIN_PACKETCMD, &idetape_transfer_pc,
1323 IDETAPE_WAIT_CMD, NULL); 1335 IDETAPE_WAIT_CMD, NULL);
1324 return ide_started; 1336 return ide_started;
@@ -1506,7 +1518,7 @@ static void idetape_create_read_cmd(idetape_tape_t *tape, idetape_pc_t *pc,
1506 pc->buffer_size = length * tape->blk_size; 1518 pc->buffer_size = length * tape->blk_size;
1507 pc->request_transfer = pc->buffer_size; 1519 pc->request_transfer = pc->buffer_size;
1508 if (pc->request_transfer == tape->stage_size) 1520 if (pc->request_transfer == tape->stage_size)
1509 set_bit(PC_DMA_RECOMMENDED, &pc->flags); 1521 pc->flags |= PC_FLAG_DMA_RECOMMENDED;
1510} 1522}
1511 1523
1512static void idetape_create_write_cmd(idetape_tape_t *tape, idetape_pc_t *pc, 1524static void idetape_create_write_cmd(idetape_tape_t *tape, idetape_pc_t *pc,
@@ -1517,7 +1529,7 @@ static void idetape_create_write_cmd(idetape_tape_t *tape, idetape_pc_t *pc,
1517 put_unaligned(cpu_to_be32(length), (unsigned int *) &pc->c[1]); 1529 put_unaligned(cpu_to_be32(length), (unsigned int *) &pc->c[1]);
1518 pc->c[1] = 1; 1530 pc->c[1] = 1;
1519 pc->callback = &idetape_rw_callback; 1531 pc->callback = &idetape_rw_callback;
1520 set_bit(PC_WRITING, &pc->flags); 1532 pc->flags |= PC_FLAG_WRITING;
1521 pc->bh = bh; 1533 pc->bh = bh;
1522 pc->b_data = bh->b_data; 1534 pc->b_data = bh->b_data;
1523 pc->b_count = atomic_read(&bh->b_count); 1535 pc->b_count = atomic_read(&bh->b_count);
@@ -1525,7 +1537,7 @@ static void idetape_create_write_cmd(idetape_tape_t *tape, idetape_pc_t *pc,
1525 pc->buffer_size = length * tape->blk_size; 1537 pc->buffer_size = length * tape->blk_size;
1526 pc->request_transfer = pc->buffer_size; 1538 pc->request_transfer = pc->buffer_size;
1527 if (pc->request_transfer == tape->stage_size) 1539 if (pc->request_transfer == tape->stage_size)
1528 set_bit(PC_DMA_RECOMMENDED, &pc->flags); 1540 pc->flags |= PC_FLAG_DMA_RECOMMENDED;
1529} 1541}
1530 1542
1531static ide_startstop_t idetape_do_request(ide_drive_t *drive, 1543static ide_startstop_t idetape_do_request(ide_drive_t *drive,
@@ -1569,10 +1581,10 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
1569 stat = ide_read_status(drive); 1581 stat = ide_read_status(drive);
1570 1582
1571 if (!drive->dsc_overlap && !(rq->cmd[0] & REQ_IDETAPE_PC2)) 1583 if (!drive->dsc_overlap && !(rq->cmd[0] & REQ_IDETAPE_PC2))
1572 set_bit(IDETAPE_IGNORE_DSC, &tape->flags); 1584 set_bit(IDETAPE_FLAG_IGNORE_DSC, &tape->flags);
1573 1585
1574 if (drive->post_reset == 1) { 1586 if (drive->post_reset == 1) {
1575 set_bit(IDETAPE_IGNORE_DSC, &tape->flags); 1587 set_bit(IDETAPE_FLAG_IGNORE_DSC, &tape->flags);
1576 drive->post_reset = 0; 1588 drive->post_reset = 0;
1577 } 1589 }
1578 1590
@@ -1580,7 +1592,7 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
1580 tape->insert_speed = tape->insert_size / 1024 * HZ / 1592 tape->insert_speed = tape->insert_size / 1024 * HZ /
1581 (jiffies - tape->insert_time); 1593 (jiffies - tape->insert_time);
1582 idetape_calculate_speeds(drive); 1594 idetape_calculate_speeds(drive);
1583 if (!test_and_clear_bit(IDETAPE_IGNORE_DSC, &tape->flags) && 1595 if (!test_and_clear_bit(IDETAPE_FLAG_IGNORE_DSC, &tape->flags) &&
1584 (stat & SEEK_STAT) == 0) { 1596 (stat & SEEK_STAT) == 0) {
1585 if (postponed_rq == NULL) { 1597 if (postponed_rq == NULL) {
1586 tape->dsc_polling_start = jiffies; 1598 tape->dsc_polling_start = jiffies;
@@ -1638,7 +1650,7 @@ static inline int idetape_pipeline_active(idetape_tape_t *tape)
1638{ 1650{
1639 int rc1, rc2; 1651 int rc1, rc2;
1640 1652
1641 rc1 = test_bit(IDETAPE_PIPELINE_ACTIVE, &tape->flags); 1653 rc1 = test_bit(IDETAPE_FLAG_PIPELINE_ACTIVE, &tape->flags);
1642 rc2 = (tape->active_data_rq != NULL); 1654 rc2 = (tape->active_data_rq != NULL);
1643 return rc1; 1655 return rc1;
1644} 1656}
@@ -1884,7 +1896,7 @@ static ide_startstop_t idetape_read_position_callback(ide_drive_t *drive)
1884 if (readpos[0] & 0x4) { 1896 if (readpos[0] & 0x4) {
1885 printk(KERN_INFO "ide-tape: Block location is unknown" 1897 printk(KERN_INFO "ide-tape: Block location is unknown"
1886 "to the tape\n"); 1898 "to the tape\n");
1887 clear_bit(IDETAPE_ADDRESS_VALID, &tape->flags); 1899 clear_bit(IDETAPE_FLAG_ADDRESS_VALID, &tape->flags);
1888 idetape_end_request(drive, 0, 0); 1900 idetape_end_request(drive, 0, 0);
1889 } else { 1901 } else {
1890 debug_log(DBG_SENSE, "Block Location - %u\n", 1902 debug_log(DBG_SENSE, "Block Location - %u\n",
@@ -1893,7 +1905,7 @@ static ide_startstop_t idetape_read_position_callback(ide_drive_t *drive)
1893 tape->partition = readpos[1]; 1905 tape->partition = readpos[1];
1894 tape->first_frame = 1906 tape->first_frame =
1895 be32_to_cpu(*(u32 *)&readpos[4]); 1907 be32_to_cpu(*(u32 *)&readpos[4]);
1896 set_bit(IDETAPE_ADDRESS_VALID, &tape->flags); 1908 set_bit(IDETAPE_FLAG_ADDRESS_VALID, &tape->flags);
1897 idetape_end_request(drive, 1, 0); 1909 idetape_end_request(drive, 1, 0);
1898 } 1910 }
1899 } else { 1911 } else {
@@ -1912,7 +1924,7 @@ static void idetape_create_write_filemark_cmd(ide_drive_t *drive,
1912 idetape_init_pc(pc); 1924 idetape_init_pc(pc);
1913 pc->c[0] = WRITE_FILEMARKS; 1925 pc->c[0] = WRITE_FILEMARKS;
1914 pc->c[4] = write_filemark; 1926 pc->c[4] = write_filemark;
1915 set_bit(PC_WAIT_FOR_DSC, &pc->flags); 1927 pc->flags |= PC_FLAG_WAIT_FOR_DSC;
1916 pc->callback = &idetape_pc_callback; 1928 pc->callback = &idetape_pc_callback;
1917} 1929}
1918 1930
@@ -1953,7 +1965,7 @@ static void idetape_create_load_unload_cmd(ide_drive_t *drive, idetape_pc_t *pc,
1953 idetape_init_pc(pc); 1965 idetape_init_pc(pc);
1954 pc->c[0] = START_STOP; 1966 pc->c[0] = START_STOP;
1955 pc->c[4] = cmd; 1967 pc->c[4] = cmd;
1956 set_bit(PC_WAIT_FOR_DSC, &pc->flags); 1968 pc->flags |= PC_FLAG_WAIT_FOR_DSC;
1957 pc->callback = &idetape_pc_callback; 1969 pc->callback = &idetape_pc_callback;
1958} 1970}
1959 1971
@@ -1964,7 +1976,7 @@ static int idetape_wait_ready(ide_drive_t *drive, unsigned long timeout)
1964 int load_attempted = 0; 1976 int load_attempted = 0;
1965 1977
1966 /* Wait for the tape to become ready */ 1978 /* Wait for the tape to become ready */
1967 set_bit(IDETAPE_MEDIUM_PRESENT, &tape->flags); 1979 set_bit(IDETAPE_FLAG_MEDIUM_PRESENT, &tape->flags);
1968 timeout += jiffies; 1980 timeout += jiffies;
1969 while (time_before(jiffies, timeout)) { 1981 while (time_before(jiffies, timeout)) {
1970 idetape_create_test_unit_ready_cmd(&pc); 1982 idetape_create_test_unit_ready_cmd(&pc);
@@ -2037,7 +2049,7 @@ static void idetape_create_locate_cmd(ide_drive_t *drive, idetape_pc_t *pc,
2037 pc->c[1] = 2; 2049 pc->c[1] = 2;
2038 put_unaligned(cpu_to_be32(block), (unsigned int *) &pc->c[3]); 2050 put_unaligned(cpu_to_be32(block), (unsigned int *) &pc->c[3]);
2039 pc->c[8] = partition; 2051 pc->c[8] = partition;
2040 set_bit(PC_WAIT_FOR_DSC, &pc->flags); 2052 pc->flags |= PC_FLAG_WAIT_FOR_DSC;
2041 pc->callback = &idetape_pc_callback; 2053 pc->callback = &idetape_pc_callback;
2042} 2054}
2043 2055
@@ -2068,7 +2080,7 @@ static int __idetape_discard_read_pipeline(ide_drive_t *drive)
2068 2080
2069 /* Remove merge stage. */ 2081 /* Remove merge stage. */
2070 cnt = tape->merge_stage_size / tape->blk_size; 2082 cnt = tape->merge_stage_size / tape->blk_size;
2071 if (test_and_clear_bit(IDETAPE_FILEMARK, &tape->flags)) 2083 if (test_and_clear_bit(IDETAPE_FLAG_FILEMARK, &tape->flags))
2072 ++cnt; /* Filemarks count as 1 sector */ 2084 ++cnt; /* Filemarks count as 1 sector */
2073 tape->merge_stage_size = 0; 2085 tape->merge_stage_size = 0;
2074 if (tape->merge_stage != NULL) { 2086 if (tape->merge_stage != NULL) {
@@ -2077,7 +2089,7 @@ static int __idetape_discard_read_pipeline(ide_drive_t *drive)
2077 } 2089 }
2078 2090
2079 /* Clear pipeline flags. */ 2091 /* Clear pipeline flags. */
2080 clear_bit(IDETAPE_PIPELINE_ERROR, &tape->flags); 2092 clear_bit(IDETAPE_FLAG_PIPELINE_ERR, &tape->flags);
2081 tape->chrdev_dir = IDETAPE_DIR_NONE; 2093 tape->chrdev_dir = IDETAPE_DIR_NONE;
2082 2094
2083 /* Remove pipeline stages. */ 2095 /* Remove pipeline stages. */
@@ -2191,7 +2203,7 @@ static void idetape_plug_pipeline(ide_drive_t *drive)
2191 if (tape->next_stage == NULL) 2203 if (tape->next_stage == NULL)
2192 return; 2204 return;
2193 if (!idetape_pipeline_active(tape)) { 2205 if (!idetape_pipeline_active(tape)) {
2194 set_bit(IDETAPE_PIPELINE_ACTIVE, &tape->flags); 2206 set_bit(IDETAPE_FLAG_PIPELINE_ACTIVE, &tape->flags);
2195 idetape_activate_next_stage(drive); 2207 idetape_activate_next_stage(drive);
2196 (void) ide_do_drive_cmd(drive, tape->active_data_rq, ide_end); 2208 (void) ide_do_drive_cmd(drive, tape->active_data_rq, ide_end);
2197 } 2209 }
@@ -2210,7 +2222,7 @@ static void idetape_create_rewind_cmd(ide_drive_t *drive, idetape_pc_t *pc)
2210{ 2222{
2211 idetape_init_pc(pc); 2223 idetape_init_pc(pc);
2212 pc->c[0] = REZERO_UNIT; 2224 pc->c[0] = REZERO_UNIT;
2213 set_bit(PC_WAIT_FOR_DSC, &pc->flags); 2225 pc->flags |= PC_FLAG_WAIT_FOR_DSC;
2214 pc->callback = &idetape_pc_callback; 2226 pc->callback = &idetape_pc_callback;
2215} 2227}
2216 2228
@@ -2219,7 +2231,7 @@ static void idetape_create_erase_cmd(idetape_pc_t *pc)
2219 idetape_init_pc(pc); 2231 idetape_init_pc(pc);
2220 pc->c[0] = ERASE; 2232 pc->c[0] = ERASE;
2221 pc->c[1] = 1; 2233 pc->c[1] = 1;
2222 set_bit(PC_WAIT_FOR_DSC, &pc->flags); 2234 pc->flags |= PC_FLAG_WAIT_FOR_DSC;
2223 pc->callback = &idetape_pc_callback; 2235 pc->callback = &idetape_pc_callback;
2224} 2236}
2225 2237
@@ -2229,7 +2241,7 @@ static void idetape_create_space_cmd(idetape_pc_t *pc, int count, u8 cmd)
2229 pc->c[0] = SPACE; 2241 pc->c[0] = SPACE;
2230 put_unaligned(cpu_to_be32(count), (unsigned int *) &pc->c[1]); 2242 put_unaligned(cpu_to_be32(count), (unsigned int *) &pc->c[1]);
2231 pc->c[1] = cmd; 2243 pc->c[1] = cmd;
2232 set_bit(PC_WAIT_FOR_DSC, &pc->flags); 2244 pc->flags |= PC_FLAG_WAIT_FOR_DSC;
2233 pc->callback = &idetape_pc_callback; 2245 pc->callback = &idetape_pc_callback;
2234} 2246}
2235 2247
@@ -2316,7 +2328,7 @@ static int idetape_add_chrdev_write_request(ide_drive_t *drive, int blocks)
2316 idetape_plug_pipeline(drive); 2328 idetape_plug_pipeline(drive);
2317 } 2329 }
2318 } 2330 }
2319 if (test_and_clear_bit(IDETAPE_PIPELINE_ERROR, &tape->flags)) 2331 if (test_and_clear_bit(IDETAPE_FLAG_PIPELINE_ERR, &tape->flags))
2320 /* Return a deferred error */ 2332 /* Return a deferred error */
2321 return -EIO; 2333 return -EIO;
2322 return blocks; 2334 return blocks;
@@ -2392,7 +2404,7 @@ static void idetape_empty_write_pipeline(ide_drive_t *drive)
2392 __idetape_kfree_stage(tape->merge_stage); 2404 __idetape_kfree_stage(tape->merge_stage);
2393 tape->merge_stage = NULL; 2405 tape->merge_stage = NULL;
2394 } 2406 }
2395 clear_bit(IDETAPE_PIPELINE_ERROR, &tape->flags); 2407 clear_bit(IDETAPE_FLAG_PIPELINE_ERR, &tape->flags);
2396 tape->chrdev_dir = IDETAPE_DIR_NONE; 2408 tape->chrdev_dir = IDETAPE_DIR_NONE;
2397 2409
2398 /* 2410 /*
@@ -2480,7 +2492,7 @@ static int idetape_init_read(ide_drive_t *drive, int max_stages)
2480 rq.sector = tape->first_frame; 2492 rq.sector = tape->first_frame;
2481 rq.nr_sectors = blocks; 2493 rq.nr_sectors = blocks;
2482 rq.current_nr_sectors = blocks; 2494 rq.current_nr_sectors = blocks;
2483 if (!test_bit(IDETAPE_PIPELINE_ERROR, &tape->flags) && 2495 if (!test_bit(IDETAPE_FLAG_PIPELINE_ERR, &tape->flags) &&
2484 tape->nr_stages < max_stages) { 2496 tape->nr_stages < max_stages) {
2485 new_stage = idetape_kmalloc_stage(tape); 2497 new_stage = idetape_kmalloc_stage(tape);
2486 while (new_stage != NULL) { 2498 while (new_stage != NULL) {
@@ -2517,13 +2529,13 @@ static int idetape_add_chrdev_read_request(ide_drive_t *drive, int blocks)
2517 debug_log(DBG_PROCS, "Enter %s, %d blocks\n", __func__, blocks); 2529 debug_log(DBG_PROCS, "Enter %s, %d blocks\n", __func__, blocks);
2518 2530
2519 /* If we are at a filemark, return a read length of 0 */ 2531 /* If we are at a filemark, return a read length of 0 */
2520 if (test_bit(IDETAPE_FILEMARK, &tape->flags)) 2532 if (test_bit(IDETAPE_FLAG_FILEMARK, &tape->flags))
2521 return 0; 2533 return 0;
2522 2534
2523 /* Wait for the next block to reach the head of the pipeline. */ 2535 /* Wait for the next block to reach the head of the pipeline. */
2524 idetape_init_read(drive, tape->max_stages); 2536 idetape_init_read(drive, tape->max_stages);
2525 if (tape->first_stage == NULL) { 2537 if (tape->first_stage == NULL) {
2526 if (test_bit(IDETAPE_PIPELINE_ERROR, &tape->flags)) 2538 if (test_bit(IDETAPE_FLAG_PIPELINE_ERR, &tape->flags))
2527 return 0; 2539 return 0;
2528 return idetape_queue_rw_tail(drive, REQ_IDETAPE_READ, blocks, 2540 return idetape_queue_rw_tail(drive, REQ_IDETAPE_READ, blocks,
2529 tape->merge_stage->bh); 2541 tape->merge_stage->bh);
@@ -2540,7 +2552,7 @@ static int idetape_add_chrdev_read_request(ide_drive_t *drive, int blocks)
2540 else { 2552 else {
2541 idetape_switch_buffers(tape, tape->first_stage); 2553 idetape_switch_buffers(tape, tape->first_stage);
2542 if (rq_ptr->errors == IDETAPE_ERROR_FILEMARK) 2554 if (rq_ptr->errors == IDETAPE_ERROR_FILEMARK)
2543 set_bit(IDETAPE_FILEMARK, &tape->flags); 2555 set_bit(IDETAPE_FLAG_FILEMARK, &tape->flags);
2544 spin_lock_irqsave(&tape->lock, flags); 2556 spin_lock_irqsave(&tape->lock, flags);
2545 idetape_remove_stage_head(drive); 2557 idetape_remove_stage_head(drive);
2546 spin_unlock_irqrestore(&tape->lock, flags); 2558 spin_unlock_irqrestore(&tape->lock, flags);
@@ -2687,12 +2699,13 @@ static int idetape_space_over_filemarks(ide_drive_t *drive, short mt_op,
2687 if (tape->chrdev_dir == IDETAPE_DIR_READ) { 2699 if (tape->chrdev_dir == IDETAPE_DIR_READ) {
2688 /* its a read-ahead buffer, scan it for crossed filemarks. */ 2700 /* its a read-ahead buffer, scan it for crossed filemarks. */
2689 tape->merge_stage_size = 0; 2701 tape->merge_stage_size = 0;
2690 if (test_and_clear_bit(IDETAPE_FILEMARK, &tape->flags)) 2702 if (test_and_clear_bit(IDETAPE_FLAG_FILEMARK, &tape->flags))
2691 ++count; 2703 ++count;
2692 while (tape->first_stage != NULL) { 2704 while (tape->first_stage != NULL) {
2693 if (count == mt_count) { 2705 if (count == mt_count) {
2694 if (mt_op == MTFSFM) 2706 if (mt_op == MTFSFM)
2695 set_bit(IDETAPE_FILEMARK, &tape->flags); 2707 set_bit(IDETAPE_FLAG_FILEMARK,
2708 &tape->flags);
2696 return 0; 2709 return 0;
2697 } 2710 }
2698 spin_lock_irqsave(&tape->lock, flags); 2711 spin_lock_irqsave(&tape->lock, flags);
@@ -2776,7 +2789,7 @@ static ssize_t idetape_chrdev_read(struct file *file, char __user *buf,
2776 debug_log(DBG_CHRDEV, "Enter %s, count %Zd\n", __func__, count); 2789 debug_log(DBG_CHRDEV, "Enter %s, count %Zd\n", __func__, count);
2777 2790
2778 if (tape->chrdev_dir != IDETAPE_DIR_READ) { 2791 if (tape->chrdev_dir != IDETAPE_DIR_READ) {
2779 if (test_bit(IDETAPE_DETECT_BS, &tape->flags)) 2792 if (test_bit(IDETAPE_FLAG_DETECT_BS, &tape->flags))
2780 if (count > tape->blk_size && 2793 if (count > tape->blk_size &&
2781 (count % tape->blk_size) == 0) 2794 (count % tape->blk_size) == 0)
2782 tape->user_bs_factor = count / tape->blk_size; 2795 tape->user_bs_factor = count / tape->blk_size;
@@ -2819,7 +2832,7 @@ static ssize_t idetape_chrdev_read(struct file *file, char __user *buf,
2819 tape->merge_stage_size = bytes_read-temp; 2832 tape->merge_stage_size = bytes_read-temp;
2820 } 2833 }
2821finish: 2834finish:
2822 if (!actually_read && test_bit(IDETAPE_FILEMARK, &tape->flags)) { 2835 if (!actually_read && test_bit(IDETAPE_FLAG_FILEMARK, &tape->flags)) {
2823 debug_log(DBG_SENSE, "%s: spacing over filemark\n", tape->name); 2836 debug_log(DBG_SENSE, "%s: spacing over filemark\n", tape->name);
2824 2837
2825 idetape_space_over_filemarks(drive, MTFSF, 1); 2838 idetape_space_over_filemarks(drive, MTFSF, 1);
@@ -3012,7 +3025,7 @@ static int idetape_mtioctop(ide_drive_t *drive, short mt_op, int mt_count)
3012 !IDETAPE_LU_LOAD_MASK); 3025 !IDETAPE_LU_LOAD_MASK);
3013 retval = idetape_queue_pc_tail(drive, &pc); 3026 retval = idetape_queue_pc_tail(drive, &pc);
3014 if (!retval) 3027 if (!retval)
3015 clear_bit(IDETAPE_MEDIUM_PRESENT, &tape->flags); 3028 clear_bit(IDETAPE_FLAG_MEDIUM_PRESENT, &tape->flags);
3016 return retval; 3029 return retval;
3017 case MTNOP: 3030 case MTNOP:
3018 idetape_discard_read_pipeline(drive, 0); 3031 idetape_discard_read_pipeline(drive, 0);
@@ -3035,9 +3048,9 @@ static int idetape_mtioctop(ide_drive_t *drive, short mt_op, int mt_count)
3035 mt_count % tape->blk_size) 3048 mt_count % tape->blk_size)
3036 return -EIO; 3049 return -EIO;
3037 tape->user_bs_factor = mt_count / tape->blk_size; 3050 tape->user_bs_factor = mt_count / tape->blk_size;
3038 clear_bit(IDETAPE_DETECT_BS, &tape->flags); 3051 clear_bit(IDETAPE_FLAG_DETECT_BS, &tape->flags);
3039 } else 3052 } else
3040 set_bit(IDETAPE_DETECT_BS, &tape->flags); 3053 set_bit(IDETAPE_FLAG_DETECT_BS, &tape->flags);
3041 return 0; 3054 return 0;
3042 case MTSEEK: 3055 case MTSEEK:
3043 idetape_discard_read_pipeline(drive, 0); 3056 idetape_discard_read_pipeline(drive, 0);
@@ -3185,24 +3198,24 @@ static int idetape_chrdev_open(struct inode *inode, struct file *filp)
3185 3198
3186 filp->private_data = tape; 3199 filp->private_data = tape;
3187 3200
3188 if (test_and_set_bit(IDETAPE_BUSY, &tape->flags)) { 3201 if (test_and_set_bit(IDETAPE_FLAG_BUSY, &tape->flags)) {
3189 retval = -EBUSY; 3202 retval = -EBUSY;
3190 goto out_put_tape; 3203 goto out_put_tape;
3191 } 3204 }
3192 3205
3193 retval = idetape_wait_ready(drive, 60 * HZ); 3206 retval = idetape_wait_ready(drive, 60 * HZ);
3194 if (retval) { 3207 if (retval) {
3195 clear_bit(IDETAPE_BUSY, &tape->flags); 3208 clear_bit(IDETAPE_FLAG_BUSY, &tape->flags);
3196 printk(KERN_ERR "ide-tape: %s: drive not ready\n", tape->name); 3209 printk(KERN_ERR "ide-tape: %s: drive not ready\n", tape->name);
3197 goto out_put_tape; 3210 goto out_put_tape;
3198 } 3211 }
3199 3212
3200 idetape_read_position(drive); 3213 idetape_read_position(drive);
3201 if (!test_bit(IDETAPE_ADDRESS_VALID, &tape->flags)) 3214 if (!test_bit(IDETAPE_FLAG_ADDRESS_VALID, &tape->flags))
3202 (void)idetape_rewind_tape(drive); 3215 (void)idetape_rewind_tape(drive);
3203 3216
3204 if (tape->chrdev_dir != IDETAPE_DIR_READ) 3217 if (tape->chrdev_dir != IDETAPE_DIR_READ)
3205 clear_bit(IDETAPE_PIPELINE_ERROR, &tape->flags); 3218 clear_bit(IDETAPE_FLAG_PIPELINE_ERR, &tape->flags);
3206 3219
3207 /* Read block size and write protect status from drive. */ 3220 /* Read block size and write protect status from drive. */
3208 ide_tape_get_bsize_from_bdesc(drive); 3221 ide_tape_get_bsize_from_bdesc(drive);
@@ -3217,7 +3230,7 @@ static int idetape_chrdev_open(struct inode *inode, struct file *filp)
3217 if (tape->write_prot) { 3230 if (tape->write_prot) {
3218 if ((filp->f_flags & O_ACCMODE) == O_WRONLY || 3231 if ((filp->f_flags & O_ACCMODE) == O_WRONLY ||
3219 (filp->f_flags & O_ACCMODE) == O_RDWR) { 3232 (filp->f_flags & O_ACCMODE) == O_RDWR) {
3220 clear_bit(IDETAPE_BUSY, &tape->flags); 3233 clear_bit(IDETAPE_FLAG_BUSY, &tape->flags);
3221 retval = -EROFS; 3234 retval = -EROFS;
3222 goto out_put_tape; 3235 goto out_put_tape;
3223 } 3236 }
@@ -3282,7 +3295,7 @@ static int idetape_chrdev_release(struct inode *inode, struct file *filp)
3282 __idetape_kfree_stage(tape->cache_stage); 3295 __idetape_kfree_stage(tape->cache_stage);
3283 tape->cache_stage = NULL; 3296 tape->cache_stage = NULL;
3284 } 3297 }
3285 if (minor < 128 && test_bit(IDETAPE_MEDIUM_PRESENT, &tape->flags)) 3298 if (minor < 128 && test_bit(IDETAPE_FLAG_MEDIUM_PRESENT, &tape->flags))
3286 (void) idetape_rewind_tape(drive); 3299 (void) idetape_rewind_tape(drive);
3287 if (tape->chrdev_dir == IDETAPE_DIR_NONE) { 3300 if (tape->chrdev_dir == IDETAPE_DIR_NONE) {
3288 if (tape->door_locked == DOOR_LOCKED) { 3301 if (tape->door_locked == DOOR_LOCKED) {
@@ -3292,7 +3305,7 @@ static int idetape_chrdev_release(struct inode *inode, struct file *filp)
3292 } 3305 }
3293 } 3306 }
3294 } 3307 }
3295 clear_bit(IDETAPE_BUSY, &tape->flags); 3308 clear_bit(IDETAPE_FLAG_BUSY, &tape->flags);
3296 ide_tape_put(tape); 3309 ide_tape_put(tape);
3297 unlock_kernel(); 3310 unlock_kernel();
3298 return 0; 3311 return 0;
@@ -3496,7 +3509,7 @@ static void idetape_setup(ide_drive_t *drive, idetape_tape_t *tape, int minor)
3496 3509
3497 /* Command packet DRQ type */ 3510 /* Command packet DRQ type */
3498 if (((gcw[0] & 0x60) >> 5) == 1) 3511 if (((gcw[0] & 0x60) >> 5) == 1)
3499 set_bit(IDETAPE_DRQ_INTERRUPT, &tape->flags); 3512 set_bit(IDETAPE_FLAG_DRQ_INTERRUPT, &tape->flags);
3500 3513
3501 tape->min_pipeline = 10; 3514 tape->min_pipeline = 10;
3502 tape->max_pipeline = 10; 3515 tape->max_pipeline = 10;