ide-tape: remove struct idetape_read_position_result_t
There should be no functional changes resulting from this patch. Bart: - remove needless "!!" Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
committed by
Bartlomiej Zolnierkiewicz
parent
8004a8c974
commit
a2f5b7f42a
@@ -571,24 +571,6 @@ struct idetape_id_gcw {
|
|||||||
unsigned protocol :2; /* Protocol type */
|
unsigned protocol :2; /* Protocol type */
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
* READ POSITION packet command - Data Format (From Table 6-57)
|
|
||||||
*/
|
|
||||||
typedef struct {
|
|
||||||
unsigned reserved0_10 :2; /* Reserved */
|
|
||||||
unsigned bpu :1; /* Block Position Unknown */
|
|
||||||
unsigned reserved0_543 :3; /* Reserved */
|
|
||||||
unsigned eop :1; /* End Of Partition */
|
|
||||||
unsigned bop :1; /* Beginning Of Partition */
|
|
||||||
u8 partition; /* Partition Number */
|
|
||||||
u8 reserved2, reserved3; /* Reserved */
|
|
||||||
u32 first_block; /* First Block Location */
|
|
||||||
u32 last_block; /* Last Block Location (Optional) */
|
|
||||||
u8 reserved12; /* Reserved */
|
|
||||||
u8 blocks_in_buffer[3]; /* Blocks In Buffer - (Optional) */
|
|
||||||
u32 bytes_in_buffer; /* Bytes In Buffer (Optional) */
|
|
||||||
} idetape_read_position_result_t;
|
|
||||||
|
|
||||||
/* Structures related to the SELECT SENSE / MODE SENSE packet commands. */
|
/* Structures related to the SELECT SENSE / MODE SENSE packet commands. */
|
||||||
#define IDETAPE_BLOCK_DESCRIPTOR 0
|
#define IDETAPE_BLOCK_DESCRIPTOR 0
|
||||||
#define IDETAPE_CAPABILITIES_PAGE 0x2a
|
#define IDETAPE_CAPABILITIES_PAGE 0x2a
|
||||||
@@ -2000,30 +1982,34 @@ static void idetape_wait_for_request (ide_drive_t *drive, struct request *rq)
|
|||||||
spin_lock_irq(&tape->spinlock);
|
spin_lock_irq(&tape->spinlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ide_startstop_t idetape_read_position_callback (ide_drive_t *drive)
|
static ide_startstop_t idetape_read_position_callback(ide_drive_t *drive)
|
||||||
{
|
{
|
||||||
idetape_tape_t *tape = drive->driver_data;
|
idetape_tape_t *tape = drive->driver_data;
|
||||||
idetape_read_position_result_t *result;
|
u8 *readpos = tape->pc->buffer;
|
||||||
|
|
||||||
debug_log(DBG_PROCS, "Enter %s\n", __func__);
|
debug_log(DBG_PROCS, "Enter %s\n", __func__);
|
||||||
|
|
||||||
if (!tape->pc->error) {
|
if (!tape->pc->error) {
|
||||||
result = (idetape_read_position_result_t *) tape->pc->buffer;
|
debug_log(DBG_SENSE, "BOP - %s\n",
|
||||||
debug_log(DBG_SENSE, "BOP - %s\n", result->bop ? "Yes" : "No");
|
(readpos[0] & 0x80) ? "Yes" : "No");
|
||||||
debug_log(DBG_SENSE, "EOP - %s\n", result->eop ? "Yes" : "No");
|
debug_log(DBG_SENSE, "EOP - %s\n",
|
||||||
|
(readpos[0] & 0x40) ? "Yes" : "No");
|
||||||
|
|
||||||
if (result->bpu) {
|
if (readpos[0] & 0x4) {
|
||||||
printk(KERN_INFO "ide-tape: Block location is unknown to the tape\n");
|
printk(KERN_INFO "ide-tape: Block location is unknown"
|
||||||
|
"to the tape\n");
|
||||||
clear_bit(IDETAPE_ADDRESS_VALID, &tape->flags);
|
clear_bit(IDETAPE_ADDRESS_VALID, &tape->flags);
|
||||||
idetape_end_request(drive, 0, 0);
|
idetape_end_request(drive, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
debug_log(DBG_SENSE, "Block Location - %u\n",
|
debug_log(DBG_SENSE, "Block Location - %u\n",
|
||||||
ntohl(result->first_block));
|
be32_to_cpu(*(u32 *)&readpos[4]));
|
||||||
|
|
||||||
tape->partition = result->partition;
|
tape->partition = readpos[1];
|
||||||
tape->first_frame_position = ntohl(result->first_block);
|
tape->first_frame_position =
|
||||||
tape->last_frame_position = ntohl(result->last_block);
|
be32_to_cpu(*(u32 *)&readpos[4]);
|
||||||
tape->blocks_in_buffer = result->blocks_in_buffer[2];
|
tape->last_frame_position =
|
||||||
|
be32_to_cpu(*(u32 *)&readpos[8]);
|
||||||
|
tape->blocks_in_buffer = readpos[15];
|
||||||
set_bit(IDETAPE_ADDRESS_VALID, &tape->flags);
|
set_bit(IDETAPE_ADDRESS_VALID, &tape->flags);
|
||||||
idetape_end_request(drive, 1, 0);
|
idetape_end_request(drive, 1, 0);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user