]> err.no Git - linux-2.6/blobdiff - include/scsi/scsi_cmnd.h
Auto-update from upstream
[linux-2.6] / include / scsi / scsi_cmnd.h
index 9d9871c28abdc2a3e8932a9819001aadf41cb0cd..e6b61fab66ddf69a66adc5f81f6647fe2ad11da9 100644 (file)
@@ -31,45 +31,36 @@ 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 */
 
        /*
-        * A SCSI Command is assigned a nonzero serial_number when internal_cmnd
-        * passes it to the driver's queue command function.  The serial_number
-        * is cleared when scsi_done is entered indicating that the command has
-        * been completed.  If a timeout occurs, the serial number at the moment
-        * of timeout is copied into serial_number_at_timeout.  By subsequently
-        * comparing the serial_number and serial_number_at_timeout fields
-        * during abort or reset processing, we can detect whether the command
-        * has already completed.  This also detects cases where the command has
-        * completed and the SCSI Command structure has already being reused
-        * for another command, so that we can avoid incorrectly aborting or
-        * resetting the new command.
-        * The serial number is only unique per host.
+        * A SCSI Command is assigned a nonzero serial_number before passed
+        * to the driver's queue command function.  The serial_number is
+        * cleared when scsi_done is entered indicating that the command
+        * has been completed.  It currently doesn't have much use other
+        * than printk's.  Some lldd's use this number for other purposes.
+        * It's almost certain that such usages are either incorrect or
+        * meaningless.  Please kill all usages other than printk's.  Also,
+        * as this number is always identical to ->pid, please convert
+        * printk's to use ->pid, so that we can kill this field.
         */
        unsigned long serial_number;
-       unsigned long serial_number_at_timeout;
+       /*
+        * 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;
-
-       /*
-        * We handle the timeout differently if it happens when a reset, 
-        * abort, etc are in process. 
-        */
-       unsigned volatile char internal_timeout;
 
        unsigned char cmd_len;
        unsigned char old_cmd_len;
@@ -90,8 +81,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 */
 
@@ -157,7 +146,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);