diff options
author | Borislav Petkov <petkovbb@googlemail.com> | 2008-07-23 13:56:00 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:56:00 -0400 |
commit | 83dd573513471c67f9cc93a88795c25a91ebf4b3 (patch) | |
tree | db90247d658de714477bcf27cd6b2018180e44fc /drivers/ide/ide-tape.c | |
parent | 20cd93be67f967c57e5abf62bf5652a00c66b9f0 (diff) |
ide-tape: make room for packet command ids in rq->cmd
ide-tape uses rq->cmd for special commands from the chrdev interface so move
those to byte 13 (BLK_MAX_CDB = 16) since a packet cmd is max 12 bytes.
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/ide-tape.c')
-rw-r--r-- | drivers/ide/ide-tape.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 38ca7b1b7cf9..f43ffb88d844 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -703,7 +703,7 @@ static void idetape_init_rq(struct request *rq, u8 cmd) | |||
703 | { | 703 | { |
704 | blk_rq_init(NULL, rq); | 704 | blk_rq_init(NULL, rq); |
705 | rq->cmd_type = REQ_TYPE_SPECIAL; | 705 | rq->cmd_type = REQ_TYPE_SPECIAL; |
706 | rq->cmd[0] = cmd; | 706 | rq->cmd[13] = cmd; |
707 | } | 707 | } |
708 | 708 | ||
709 | /* | 709 | /* |
@@ -1019,7 +1019,7 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive, | |||
1019 | */ | 1019 | */ |
1020 | stat = hwif->tp_ops->read_status(hwif); | 1020 | stat = hwif->tp_ops->read_status(hwif); |
1021 | 1021 | ||
1022 | if (!drive->dsc_overlap && !(rq->cmd[0] & REQ_IDETAPE_PC2)) | 1022 | if (!drive->dsc_overlap && !(rq->cmd[13] & REQ_IDETAPE_PC2)) |
1023 | set_bit(IDETAPE_FLAG_IGNORE_DSC, &tape->flags); | 1023 | set_bit(IDETAPE_FLAG_IGNORE_DSC, &tape->flags); |
1024 | 1024 | ||
1025 | if (drive->post_reset == 1) { | 1025 | if (drive->post_reset == 1) { |
@@ -1036,7 +1036,7 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive, | |||
1036 | } else if (time_after(jiffies, tape->dsc_timeout)) { | 1036 | } else if (time_after(jiffies, tape->dsc_timeout)) { |
1037 | printk(KERN_ERR "ide-tape: %s: DSC timeout\n", | 1037 | printk(KERN_ERR "ide-tape: %s: DSC timeout\n", |
1038 | tape->name); | 1038 | tape->name); |
1039 | if (rq->cmd[0] & REQ_IDETAPE_PC2) { | 1039 | if (rq->cmd[13] & REQ_IDETAPE_PC2) { |
1040 | idetape_media_access_finished(drive); | 1040 | idetape_media_access_finished(drive); |
1041 | return ide_stopped; | 1041 | return ide_stopped; |
1042 | } else { | 1042 | } else { |
@@ -1049,27 +1049,27 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive, | |||
1049 | idetape_postpone_request(drive); | 1049 | idetape_postpone_request(drive); |
1050 | return ide_stopped; | 1050 | return ide_stopped; |
1051 | } | 1051 | } |
1052 | if (rq->cmd[0] & REQ_IDETAPE_READ) { | 1052 | if (rq->cmd[13] & REQ_IDETAPE_READ) { |
1053 | pc = idetape_next_pc_storage(drive); | 1053 | pc = idetape_next_pc_storage(drive); |
1054 | ide_tape_create_rw_cmd(tape, pc, rq->current_nr_sectors, | 1054 | ide_tape_create_rw_cmd(tape, pc, rq->current_nr_sectors, |
1055 | (struct idetape_bh *)rq->special, | 1055 | (struct idetape_bh *)rq->special, |
1056 | READ_6); | 1056 | READ_6); |
1057 | goto out; | 1057 | goto out; |
1058 | } | 1058 | } |
1059 | if (rq->cmd[0] & REQ_IDETAPE_WRITE) { | 1059 | if (rq->cmd[13] & REQ_IDETAPE_WRITE) { |
1060 | pc = idetape_next_pc_storage(drive); | 1060 | pc = idetape_next_pc_storage(drive); |
1061 | ide_tape_create_rw_cmd(tape, pc, rq->current_nr_sectors, | 1061 | ide_tape_create_rw_cmd(tape, pc, rq->current_nr_sectors, |
1062 | (struct idetape_bh *)rq->special, | 1062 | (struct idetape_bh *)rq->special, |
1063 | WRITE_6); | 1063 | WRITE_6); |
1064 | goto out; | 1064 | goto out; |
1065 | } | 1065 | } |
1066 | if (rq->cmd[0] & REQ_IDETAPE_PC1) { | 1066 | if (rq->cmd[13] & REQ_IDETAPE_PC1) { |
1067 | pc = (struct ide_atapi_pc *) rq->buffer; | 1067 | pc = (struct ide_atapi_pc *) rq->buffer; |
1068 | rq->cmd[0] &= ~(REQ_IDETAPE_PC1); | 1068 | rq->cmd[13] &= ~(REQ_IDETAPE_PC1); |
1069 | rq->cmd[0] |= REQ_IDETAPE_PC2; | 1069 | rq->cmd[13] |= REQ_IDETAPE_PC2; |
1070 | goto out; | 1070 | goto out; |
1071 | } | 1071 | } |
1072 | if (rq->cmd[0] & REQ_IDETAPE_PC2) { | 1072 | if (rq->cmd[13] & REQ_IDETAPE_PC2) { |
1073 | idetape_media_access_finished(drive); | 1073 | idetape_media_access_finished(drive); |
1074 | return ide_stopped; | 1074 | return ide_stopped; |
1075 | } | 1075 | } |
@@ -1281,7 +1281,7 @@ static int idetape_queue_pc_tail(ide_drive_t *drive, struct ide_atapi_pc *pc) | |||
1281 | 1281 | ||
1282 | rq = blk_get_request(drive->queue, READ, __GFP_WAIT); | 1282 | rq = blk_get_request(drive->queue, READ, __GFP_WAIT); |
1283 | rq->cmd_type = REQ_TYPE_SPECIAL; | 1283 | rq->cmd_type = REQ_TYPE_SPECIAL; |
1284 | rq->cmd[0] = REQ_IDETAPE_PC1; | 1284 | rq->cmd[13] = REQ_IDETAPE_PC1; |
1285 | rq->buffer = (char *)pc; | 1285 | rq->buffer = (char *)pc; |
1286 | error = blk_execute_rq(drive->queue, tape->disk, rq, 0); | 1286 | error = blk_execute_rq(drive->queue, tape->disk, rq, 0); |
1287 | blk_put_request(rq); | 1287 | blk_put_request(rq); |
@@ -1465,7 +1465,7 @@ static int idetape_queue_rw_tail(ide_drive_t *drive, int cmd, int blocks, | |||
1465 | 1465 | ||
1466 | rq = blk_get_request(drive->queue, READ, __GFP_WAIT); | 1466 | rq = blk_get_request(drive->queue, READ, __GFP_WAIT); |
1467 | rq->cmd_type = REQ_TYPE_SPECIAL; | 1467 | rq->cmd_type = REQ_TYPE_SPECIAL; |
1468 | rq->cmd[0] = cmd; | 1468 | rq->cmd[13] = cmd; |
1469 | rq->rq_disk = tape->disk; | 1469 | rq->rq_disk = tape->disk; |
1470 | rq->special = (void *)bh; | 1470 | rq->special = (void *)bh; |
1471 | rq->sector = tape->first_frame; | 1471 | rq->sector = tape->first_frame; |