aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/scsi_cmnd.h21
-rw-r--r--include/scsi/scsi_eh.h4
2 files changed, 21 insertions, 4 deletions
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index 8d20e60a94b7..7ed883c8e48a 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -7,10 +7,28 @@
7#include <linux/types.h> 7#include <linux/types.h>
8#include <linux/timer.h> 8#include <linux/timer.h>
9#include <linux/scatterlist.h> 9#include <linux/scatterlist.h>
10#include <linux/blkdev.h>
10 11
11struct Scsi_Host; 12struct Scsi_Host;
12struct scsi_device; 13struct scsi_device;
13 14
15/*
16 * MAX_COMMAND_SIZE is:
17 * The longest fixed-length SCSI CDB as per the SCSI standard.
18 * fixed-length means: commands that their size can be determined
19 * by their opcode and the CDB does not carry a length specifier, (unlike
20 * the VARIABLE_LENGTH_CMD(0x7f) command). This is actually not exactly
21 * true and the SCSI standard also defines extended commands and
22 * vendor specific commands that can be bigger than 16 bytes. The kernel
23 * will support these using the same infrastructure used for VARLEN CDB's.
24 * So in effect MAX_COMMAND_SIZE means the maximum size command scsi-ml
25 * supports without specifying a cmd_len by ULD's
26 */
27#define MAX_COMMAND_SIZE 16
28#if (MAX_COMMAND_SIZE > BLK_MAX_CDB)
29# error MAX_COMMAND_SIZE can not be bigger than BLK_MAX_CDB
30#endif
31
14struct scsi_data_buffer { 32struct scsi_data_buffer {
15 struct sg_table table; 33 struct sg_table table;
16 unsigned length; 34 unsigned length;
@@ -64,8 +82,7 @@ struct scsi_cmnd {
64 enum dma_data_direction sc_data_direction; 82 enum dma_data_direction sc_data_direction;
65 83
66 /* These elements define the operation we are about to perform */ 84 /* These elements define the operation we are about to perform */
67#define MAX_COMMAND_SIZE 16 85 unsigned char *cmnd;
68 unsigned char cmnd[MAX_COMMAND_SIZE];
69 86
70 struct timer_list eh_timeout; /* Used to time out the command. */ 87 struct timer_list eh_timeout; /* Used to time out the command. */
71 88
diff --git a/include/scsi/scsi_eh.h b/include/scsi/scsi_eh.h
index d3a133b4a072..2a9add21267d 100644
--- a/include/scsi/scsi_eh.h
+++ b/include/scsi/scsi_eh.h
@@ -75,11 +75,11 @@ struct scsi_eh_save {
75 int result; 75 int result;
76 enum dma_data_direction data_direction; 76 enum dma_data_direction data_direction;
77 unsigned char cmd_len; 77 unsigned char cmd_len;
78 unsigned char cmnd[MAX_COMMAND_SIZE]; 78 unsigned char *cmnd;
79 struct scsi_data_buffer sdb; 79 struct scsi_data_buffer sdb;
80 struct request *next_rq; 80 struct request *next_rq;
81
82 /* new command support */ 81 /* new command support */
82 unsigned char eh_cmnd[BLK_MAX_CDB];
83 struct scatterlist sense_sgl; 83 struct scatterlist sense_sgl;
84}; 84};
85 85