Commit 71071b8e authored by Borislav Petkov's avatar Borislav Petkov Committed by Bartlomiej Zolnierkiewicz

ide-tape: remove struct idetape_id_gcw

Signed-off-by: default avatarBorislav Petkov <petkovbb@gmail.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 3c98bf34
...@@ -498,20 +498,6 @@ enum { ...@@ -498,20 +498,6 @@ enum {
#define IDETAPE_ERROR_FILEMARK 102 #define IDETAPE_ERROR_FILEMARK 102
#define IDETAPE_ERROR_EOD 103 #define IDETAPE_ERROR_EOD 103
/*
* The following is used to format the general configuration word of
* the ATAPI IDENTIFY DEVICE command.
*/
struct idetape_id_gcw {
unsigned packet_size :2; /* Packet Size */
unsigned reserved234 :3; /* Reserved */
unsigned drq_type :2; /* Command packet DRQ type */
unsigned removable :1; /* Removable media */
unsigned device_type :5; /* Device type */
unsigned reserved13 :1; /* Reserved */
unsigned protocol :2; /* Protocol type */
};
/* 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
...@@ -3254,37 +3240,39 @@ static int idetape_chrdev_release (struct inode *inode, struct file *filp) ...@@ -3254,37 +3240,39 @@ static int idetape_chrdev_release (struct inode *inode, struct file *filp)
} }
/* /*
* idetape_identify_device is called to check the contents of the * check the contents of the ATAPI IDENTIFY command results. We return:
* ATAPI IDENTIFY command results. We return:
* *
* 1 If the tape can be supported by us, based on the information * 1 - If the tape can be supported by us, based on the information we have so
* we have so far. * far.
* *
* 0 If this tape driver is not currently supported by us. * 0 - If this tape driver is not currently supported by us.
*/ */
static int idetape_identify_device (ide_drive_t *drive) static int idetape_identify_device(ide_drive_t *drive)
{ {
struct idetape_id_gcw gcw; u8 gcw[2], protocol, device_type, removable, packet_size;
struct hd_driveid *id = drive->id;
if (drive->id_read == 0) if (drive->id_read == 0)
return 1; return 1;
*((unsigned short *) &gcw) = id->config; *((unsigned short *) &gcw) = drive->id->config;
/* Check that we can support this device */ protocol = (gcw[1] & 0xC0) >> 6;
device_type = gcw[1] & 0x1F;
removable = !!(gcw[0] & 0x80);
packet_size = gcw[0] & 0x3;
if (gcw.protocol != 2) /* Check that we can support this device */
if (protocol != 2)
printk(KERN_ERR "ide-tape: Protocol (0x%02x) is not ATAPI\n", printk(KERN_ERR "ide-tape: Protocol (0x%02x) is not ATAPI\n",
gcw.protocol); protocol);
else if (gcw.device_type != 1) else if (device_type != 1)
printk(KERN_ERR "ide-tape: Device type (0x%02x) is not set " printk(KERN_ERR "ide-tape: Device type (0x%02x) is not set "
"to tape\n", gcw.device_type); "to tape\n", device_type);
else if (!gcw.removable) else if (!removable)
printk(KERN_ERR "ide-tape: The removable flag is not set\n"); printk(KERN_ERR "ide-tape: The removable flag is not set\n");
else if (gcw.packet_size != 0) { else if (packet_size != 0) {
printk(KERN_ERR "ide-tape: Packet size (0x%02x) is not 12 " printk(KERN_ERR "ide-tape: Packet size (0x%02x) is not 12 "
"bytes long\n", gcw.packet_size); "bytes long\n", packet_size);
} else } else
return 1; return 1;
return 0; return 0;
...@@ -3409,8 +3397,8 @@ static void idetape_setup (ide_drive_t *drive, idetape_tape_t *tape, int minor) ...@@ -3409,8 +3397,8 @@ static void idetape_setup (ide_drive_t *drive, idetape_tape_t *tape, int minor)
{ {
unsigned long t1, tmid, tn, t; unsigned long t1, tmid, tn, t;
int speed; int speed;
struct idetape_id_gcw gcw;
int stage_size; int stage_size;
u8 gcw[2];
struct sysinfo si; struct sysinfo si;
u16 *ctl = (u16 *)&tape->caps[12]; u16 *ctl = (u16 *)&tape->caps[12];
...@@ -3433,7 +3421,9 @@ static void idetape_setup (ide_drive_t *drive, idetape_tape_t *tape, int minor) ...@@ -3433,7 +3421,9 @@ static void idetape_setup (ide_drive_t *drive, idetape_tape_t *tape, int minor)
tape->max_insert_speed = 10000; tape->max_insert_speed = 10000;
tape->speed_control = 1; tape->speed_control = 1;
*((unsigned short *) &gcw) = drive->id->config; *((unsigned short *) &gcw) = drive->id->config;
if (gcw.drq_type == 1)
/* Command packet DRQ type */
if (((gcw[0] & 0x60) >> 5) == 1)
set_bit(IDETAPE_DRQ_INTERRUPT, &tape->flags); set_bit(IDETAPE_DRQ_INTERRUPT, &tape->flags);
tape->min_pipeline = tape->max_pipeline = tape->max_stages = 10; tape->min_pipeline = tape->max_pipeline = tape->max_stages = 10;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment