Commit cb406274 authored by Kai Mäkisara's avatar Kai Mäkisara Committed by James Bottomley

[PATCH] SCSI tape descriptor based sense data support

The patch at the end of this message converts the SCSI tape driver to support
also descriptor based sense data. Test for deferred sense data have been added
in a couple of places and the EOM tests have been unified. Some tests have been
simplified but the patch is not meant to change the current behavior. The
patch is against 2.6.11-rc4 and has been tested to some extent.

The patch also includes the msleep_interruptible change from from kernel
janitors.

Thanks to Doug Gilbert for doing a first version of this sense data
conversion.
Signed-off-by: default avatarKai Makisara <kai.makisara@kolumbus.fi>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 178a856d
This diff is collapsed.
...@@ -5,6 +5,18 @@ ...@@ -5,6 +5,18 @@
#include <linux/completion.h> #include <linux/completion.h>
/* Descriptor for analyzed sense data */
struct st_cmdstatus {
int midlevel_result;
struct scsi_sense_hdr sense_hdr;
int have_sense;
u64 uremainder64;
u8 flags;
u8 remainder_valid;
u8 fixed_format;
u8 deferred;
};
/* The tape buffer descriptor. */ /* The tape buffer descriptor. */
struct st_buffer { struct st_buffer {
unsigned char in_use; unsigned char in_use;
...@@ -15,9 +27,9 @@ struct st_buffer { ...@@ -15,9 +27,9 @@ struct st_buffer {
int buffer_bytes; int buffer_bytes;
int read_pointer; int read_pointer;
int writing; int writing;
int midlevel_result;
int syscall_result; int syscall_result;
struct scsi_request *last_SRpnt; struct scsi_request *last_SRpnt;
struct st_cmdstatus cmdstat;
unsigned char *b_data; unsigned char *b_data;
unsigned short use_sg; /* zero or max number of s/g segments for this adapter */ unsigned short use_sg; /* zero or max number of s/g segments for this adapter */
unsigned short sg_segs; /* number of segments in s/g list */ unsigned short sg_segs; /* number of segments in s/g list */
...@@ -192,4 +204,9 @@ struct scsi_tape { ...@@ -192,4 +204,9 @@ struct scsi_tape {
#define EXTENDED_SENSE_START 18 #define EXTENDED_SENSE_START 18
/* Masks for some conditions in the sense data */
#define SENSE_FMK 0x80
#define SENSE_EOM 0x40
#define SENSE_ILI 0x20
#endif #endif
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