ide-tape: remove struct idetape_mode_parameter_header_t

Bart:
- remove 'capabilities->speed' chunk
- re-add brackets to block_descrp assignment

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
Borislav Petkov 2008-02-02 19:56:48 +01:00 committed by Bartlomiej Zolnierkiewicz
parent 1b5db434f4
commit 47314fa429
1 changed files with 13 additions and 24 deletions

View File

@ -747,16 +747,6 @@ typedef struct {
#define IDETAPE_BLOCK_SIZE_PAGE 0x30 #define IDETAPE_BLOCK_SIZE_PAGE 0x30
#define IDETAPE_BUFFER_FILLING_PAGE 0x33 #define IDETAPE_BUFFER_FILLING_PAGE 0x33
/*
* Mode Parameter Header for the MODE SENSE packet command
*/
typedef struct {
__u8 mode_data_length; /* Length of the following data transfer */
__u8 medium_type; /* Medium Type */
__u8 dsp; /* Device Specific Parameter */
__u8 bdl; /* Block Descriptor Length */
} idetape_mode_parameter_header_t;
/* /*
* Mode Parameter Block Descriptor the MODE SENSE packet command * Mode Parameter Block Descriptor the MODE SENSE packet command
* *
@ -3914,7 +3904,6 @@ static void idetape_get_mode_sense_results (ide_drive_t *drive)
{ {
idetape_tape_t *tape = drive->driver_data; idetape_tape_t *tape = drive->driver_data;
idetape_pc_t pc; idetape_pc_t pc;
idetape_mode_parameter_header_t *header;
idetape_capabilities_page_t *capabilities; idetape_capabilities_page_t *capabilities;
idetape_create_mode_sense_cmd(&pc, IDETAPE_CAPABILITIES_PAGE); idetape_create_mode_sense_cmd(&pc, IDETAPE_CAPABILITIES_PAGE);
@ -3926,8 +3915,8 @@ static void idetape_get_mode_sense_results (ide_drive_t *drive)
tape->capabilities.buffer_size = 6 * 52; tape->capabilities.buffer_size = 6 * 52;
return; return;
} }
header = (idetape_mode_parameter_header_t *) pc.buffer; capabilities = (idetape_capabilities_page_t *)
capabilities = (idetape_capabilities_page_t *) (pc.buffer + sizeof(idetape_mode_parameter_header_t) + header->bdl); (pc.buffer + 4 + pc.buffer[3]);
capabilities->max_speed = ntohs(capabilities->max_speed); capabilities->max_speed = ntohs(capabilities->max_speed);
capabilities->ctl = ntohs(capabilities->ctl); capabilities->ctl = ntohs(capabilities->ctl);
@ -3952,10 +3941,12 @@ static void idetape_get_mode_sense_results (ide_drive_t *drive)
#if IDETAPE_DEBUG_INFO #if IDETAPE_DEBUG_INFO
printk(KERN_INFO "ide-tape: Dumping the results of the MODE SENSE packet command\n"); printk(KERN_INFO "ide-tape: Dumping the results of the MODE SENSE packet command\n");
printk(KERN_INFO "ide-tape: Mode Parameter Header:\n"); printk(KERN_INFO "ide-tape: Mode Parameter Header:\n");
printk(KERN_INFO "ide-tape: Mode Data Length - %d\n",header->mode_data_length); printk(KERN_INFO "ide-tape: Mode Data Length - %d\n", pc.buffer[0]);
printk(KERN_INFO "ide-tape: Medium Type - %d\n",header->medium_type); printk(KERN_INFO "ide-tape: Medium Type - %d\n", pc.buffer[1]);
printk(KERN_INFO "ide-tape: Device Specific Parameter - %d\n",header->dsp); printk(KERN_INFO "ide-tape: Device Specific Parameter - %d\n",
printk(KERN_INFO "ide-tape: Block Descriptor Length - %d\n",header->bdl); pc.buffer[2]);
printk(KERN_INFO "ide-tape: Block Descriptor Length - %d\n",
pc.buffer[3]);
printk(KERN_INFO "ide-tape: Capabilities and Mechanical Status Page:\n"); printk(KERN_INFO "ide-tape: Capabilities and Mechanical Status Page:\n");
printk(KERN_INFO "ide-tape: Page code - %d\n",capabilities->page_code); printk(KERN_INFO "ide-tape: Page code - %d\n",capabilities->page_code);
@ -3989,7 +3980,6 @@ static void idetape_get_blocksize_from_block_descriptor(ide_drive_t *drive)
idetape_tape_t *tape = drive->driver_data; idetape_tape_t *tape = drive->driver_data;
idetape_pc_t pc; idetape_pc_t pc;
idetape_mode_parameter_header_t *header;
idetape_parameter_block_descriptor_t *block_descrp; idetape_parameter_block_descriptor_t *block_descrp;
idetape_create_mode_sense_cmd(&pc, IDETAPE_BLOCK_DESCRIPTOR); idetape_create_mode_sense_cmd(&pc, IDETAPE_BLOCK_DESCRIPTOR);
@ -4001,10 +3991,9 @@ static void idetape_get_blocksize_from_block_descriptor(ide_drive_t *drive)
} }
return; return;
} }
header = (idetape_mode_parameter_header_t *) pc.buffer; block_descrp = (idetape_parameter_block_descriptor_t *)(pc.buffer + 4);
block_descrp = (idetape_parameter_block_descriptor_t *) (pc.buffer + sizeof(idetape_mode_parameter_header_t));
tape->tape_block_size =( block_descrp->length[0]<<16) + (block_descrp->length[1]<<8) + block_descrp->length[2]; tape->tape_block_size =( block_descrp->length[0]<<16) + (block_descrp->length[1]<<8) + block_descrp->length[2];
tape->drv_write_prot = (header->dsp & 0x80) >> 7; tape->drv_write_prot = (pc.buffer[2] & 0x80) >> 7;
#if IDETAPE_DEBUG_INFO #if IDETAPE_DEBUG_INFO
printk(KERN_INFO "ide-tape: Adjusted block size - %d\n", tape->tape_block_size); printk(KERN_INFO "ide-tape: Adjusted block size - %d\n", tape->tape_block_size);