Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / scsi / st.h
index 0e6dd5d..4112090 100644 (file)
@@ -3,7 +3,31 @@
 #define _ST_H
 
 #include <linux/completion.h>
+#include <linux/kref.h>
+#include <scsi/scsi_cmnd.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;
+};
+
+struct scsi_tape;
+
+/* scsi tape command */
+struct st_request {
+       unsigned char cmd[MAX_COMMAND_SIZE];
+       unsigned char sense[SCSI_SENSE_BUFFERSIZE];
+       int result;
+       struct scsi_tape *stp;
+       struct completion *waiting;
+};
 
 /* The tape buffer descriptor. */
 struct st_buffer {
@@ -15,9 +39,9 @@ struct st_buffer {
        int buffer_bytes;
        int read_pointer;
        int writing;
-       int midlevel_result;
        int syscall_result;
-       struct scsi_request *last_SRpnt;
+       struct st_request *last_SRpnt;
+       struct st_cmdstatus cmdstat;
        unsigned char *b_data;
        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 */
@@ -144,6 +168,7 @@ struct scsi_tape {
        unsigned char last_sense[16];
 #endif
        struct gendisk *disk;
+       struct kref     kref;
 };
 
 /* Bit masks for use_pf */
@@ -192,4 +217,9 @@ struct scsi_tape {
 
 #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