scsi: core: Remove struct scsi_request
[sfrench/cifs-2.6.git] / include / scsi / scsi_cmnd.h
index ff1c4b51f7aef88cc097a4229e0612cb1a6bc2d2..4b33ca6a7c7d6e3bac8371c3b4af2e61acb145cc 100644 (file)
@@ -28,9 +28,6 @@ struct scsi_driver;
  * supports without specifying a cmd_len by ULD's
  */
 #define MAX_COMMAND_SIZE 16
-#if (MAX_COMMAND_SIZE > BLK_MAX_CDB)
-# error MAX_COMMAND_SIZE can not be bigger than BLK_MAX_CDB
-#endif
 
 struct scsi_data_buffer {
        struct sg_table table;
@@ -71,7 +68,6 @@ enum scsi_cmnd_submitter {
 } __packed;
 
 struct scsi_cmnd {
-       struct scsi_request req;
        struct scsi_device *device;
        struct list_head eh_entry; /* entry for the host eh_abort_list/eh_cmd_q */
        struct delayed_work abort_work;
@@ -100,9 +96,7 @@ struct scsi_cmnd {
        unsigned short cmd_len;
        enum dma_data_direction sc_data_direction;
 
-       /* These elements define the operation we are about to perform */
-       unsigned char *cmnd;
-
+       unsigned char cmnd[32]; /* SCSI CDB */
 
        /* These elements define the operation we ultimately want to perform */
        struct scsi_data_buffer sdb;
@@ -116,18 +110,23 @@ struct scsi_cmnd {
                                   (ie, between disconnect / 
                                   reconnects.   Probably == sector
                                   size */
-
+       unsigned resid_len;     /* residual count */
+       unsigned sense_len;
        unsigned char *sense_buffer;
                                /* obtained by REQUEST SENSE when
                                 * CHECK CONDITION is received on original
                                 * command (auto-sense). Length must be
                                 * SCSI_SENSE_BUFFERSIZE bytes. */
 
+       int flags;              /* Command flags */
+       unsigned long state;    /* Command completion state */
+
+       unsigned int extra_len; /* length of alignment and padding */
+
        /*
-        * The following fields can be written to by the host specific code. 
-        * Everything else should be left alone. 
+        * The fields below can be modified by the LLD but the fields above
+        * must not be modified.
         */
-       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
@@ -138,10 +137,6 @@ struct scsi_cmnd {
                                         * to be at an address < 16Mb). */
 
        int result;             /* Status code from lower level driver */
-       int flags;              /* Command flags */
-       unsigned long state;    /* Command completion state */
-
-       unsigned int extra_len; /* length of alignment and padding */
 };
 
 /* Variant of blk_mq_rq_from_pdu() that verifies the type of its argument. */
@@ -204,12 +199,12 @@ static inline unsigned scsi_bufflen(struct scsi_cmnd *cmd)
 
 static inline void scsi_set_resid(struct scsi_cmnd *cmd, unsigned int resid)
 {
-       cmd->req.resid_len = resid;
+       cmd->resid_len = resid;
 }
 
 static inline unsigned int scsi_get_resid(struct scsi_cmnd *cmd)
 {
-       return cmd->req.resid_len;
+       return cmd->resid_len;
 }
 
 #define scsi_for_each_sg(cmd, sg, nseg, __i)                   \