Merge tag 'selinux-pr-20220801' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / include / scsi / scsi_cmnd.h
index e3a4c67..bac55de 100644 (file)
@@ -10,7 +10,6 @@
 #include <linux/timer.h>
 #include <linux/scatterlist.h>
 #include <scsi/scsi_device.h>
-#include <scsi/scsi_request.h>
 
 struct Scsi_Host;
 
@@ -27,9 +26,6 @@ struct Scsi_Host;
  * 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;
@@ -70,7 +66,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;
@@ -99,9 +94,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;
@@ -115,18 +108,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
@@ -137,10 +135,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. */
@@ -159,6 +153,7 @@ static inline void *scsi_cmd_priv(struct scsi_cmnd *cmd)
 }
 
 void scsi_done(struct scsi_cmnd *cmd);
+void scsi_done_direct(struct scsi_cmnd *cmd);
 
 extern void scsi_finish_command(struct scsi_cmnd *cmd);
 
@@ -194,12 +189,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)                   \
@@ -391,7 +386,7 @@ static inline unsigned scsi_transfer_length(struct scsi_cmnd *scmd)
 extern void scsi_build_sense(struct scsi_cmnd *scmd, int desc,
                             u8 key, u8 asc, u8 ascq);
 
-struct request *scsi_alloc_request(struct request_queue *q,
-               unsigned int op, blk_mq_req_flags_t flags);
+struct request *scsi_alloc_request(struct request_queue *q, blk_opf_t opf,
+                                  blk_mq_req_flags_t flags);
 
 #endif /* _SCSI_SCSI_CMND_H */