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] / include / scsi / scsi_cmnd.h
index 07f5c69..1ace1b9 100644 (file)
@@ -4,6 +4,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/list.h>
 #include <linux/types.h>
+#include <linux/timer.h>
 
 struct request;
 struct scatterlist;
@@ -31,14 +32,11 @@ struct scsi_cmnd {
        int     sc_magic;
 
        struct scsi_device *device;
-       unsigned short state;
-       unsigned short owner;
        struct scsi_request *sc_request;
 
        struct list_head list;  /* scsi_cmnd participates in queue lists */
 
        struct list_head eh_entry; /* entry for the host eh_cmd_q */
-       int eh_state;           /* Used for state tracking in error handlr */
        int eh_eflags;          /* Used by error handlr */
        void (*done) (struct scsi_cmnd *);      /* Mid-level done function */
 
@@ -54,12 +52,16 @@ struct scsi_cmnd {
         * printk's to use ->pid, so that we can kill this field.
         */
        unsigned long serial_number;
+       /*
+        * This is set to jiffies as it was when the command was first
+        * allocated.  It is used to time how long the command has
+        * been outstanding
+        */
+       unsigned long jiffies_at_alloc;
 
        int retries;
        int allowed;
        int timeout_per_command;
-       int timeout_total;
-       int timeout;
 
        unsigned char cmd_len;
        unsigned char old_cmd_len;
@@ -80,8 +82,6 @@ struct scsi_cmnd {
                                         * sense info */
        unsigned short use_sg;  /* Number of pieces of scatter-gather */
        unsigned short sglist_len;      /* size of malloc'd scatter-gather list */
-       unsigned short abort_reason;    /* If the mid-level code requests an
-                                        * abort, this is the reason. */
        unsigned bufflen;       /* Size of data buffer */
        void *buffer;           /* Data buffer */
 
@@ -104,10 +104,10 @@ struct scsi_cmnd {
                                           working on */
 
 #define SCSI_SENSE_BUFFERSIZE  96
-       unsigned char sense_buffer[SCSI_SENSE_BUFFERSIZE];              /* obtained by REQUEST SENSE
-                                                * when CHECK CONDITION is
-                                                * received on original command 
-                                                * (auto-sense) */
+       unsigned char sense_buffer[SCSI_SENSE_BUFFERSIZE];
+                               /* obtained by REQUEST SENSE when
+                                * CHECK CONDITION is received on original
+                                * command (auto-sense) */
 
        /* Low-level done function - can be used by low-level driver to point
         *        to completion function.  Not used by mid/upper level code. */
@@ -120,12 +120,12 @@ struct scsi_cmnd {
        struct scsi_pointer SCp;        /* Scratchpad used by some host adapters */
 
        unsigned char *host_scribble;   /* The host adapter is allowed to
-                                          * call scsi_malloc and get some memory
-                                          * and hang it here.     The host adapter
-                                          * is also expected to call scsi_free
-                                          * to release this memory.  (The memory
-                                          * obtained by scsi_malloc is guaranteed
-                                          * to be at an address < 16Mb). */
+                                        * call scsi_malloc and get some memory
+                                        * and hang it here.  The host adapter
+                                        * is also expected to call scsi_free
+                                        * to release this memory.  (The memory
+                                        * obtained by scsi_malloc is guaranteed
+                                        * to be at an address < 16Mb). */
 
        int result;             /* Status code from lower level driver */
 
@@ -147,7 +147,7 @@ struct scsi_cmnd {
 #define SCSI_STATE_MLQUEUE         0x100b
 
 
-extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, int);
+extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t);
 extern void scsi_put_command(struct scsi_cmnd *);
 extern void scsi_io_completion(struct scsi_cmnd *, unsigned int, unsigned int);
 extern void scsi_finish_command(struct scsi_cmnd *cmd);