diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/scsi/scsi_cmnd.h | 19 | ||||
-rw-r--r-- | include/scsi/scsi_eh.h | 1 |
2 files changed, 19 insertions, 1 deletions
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index c6478bb6f963..de28aab820b0 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h | |||
@@ -2,12 +2,12 @@ | |||
2 | #define _SCSI_SCSI_CMND_H | 2 | #define _SCSI_SCSI_CMND_H |
3 | 3 | ||
4 | #include <linux/dma-mapping.h> | 4 | #include <linux/dma-mapping.h> |
5 | #include <linux/blkdev.h> | ||
5 | #include <linux/list.h> | 6 | #include <linux/list.h> |
6 | #include <linux/types.h> | 7 | #include <linux/types.h> |
7 | #include <linux/timer.h> | 8 | #include <linux/timer.h> |
8 | #include <linux/scatterlist.h> | 9 | #include <linux/scatterlist.h> |
9 | 10 | ||
10 | struct request; | ||
11 | struct Scsi_Host; | 11 | struct Scsi_Host; |
12 | struct scsi_device; | 12 | struct scsi_device; |
13 | 13 | ||
@@ -158,4 +158,21 @@ static inline int scsi_get_resid(struct scsi_cmnd *cmd) | |||
158 | #define scsi_for_each_sg(cmd, sg, nseg, __i) \ | 158 | #define scsi_for_each_sg(cmd, sg, nseg, __i) \ |
159 | for_each_sg(scsi_sglist(cmd), sg, nseg, __i) | 159 | for_each_sg(scsi_sglist(cmd), sg, nseg, __i) |
160 | 160 | ||
161 | static inline int scsi_bidi_cmnd(struct scsi_cmnd *cmd) | ||
162 | { | ||
163 | return blk_bidi_rq(cmd->request) && | ||
164 | (cmd->request->next_rq->special != NULL); | ||
165 | } | ||
166 | |||
167 | static inline struct scsi_data_buffer *scsi_in(struct scsi_cmnd *cmd) | ||
168 | { | ||
169 | return scsi_bidi_cmnd(cmd) ? | ||
170 | cmd->request->next_rq->special : &cmd->sdb; | ||
171 | } | ||
172 | |||
173 | static inline struct scsi_data_buffer *scsi_out(struct scsi_cmnd *cmd) | ||
174 | { | ||
175 | return &cmd->sdb; | ||
176 | } | ||
177 | |||
161 | #endif /* _SCSI_SCSI_CMND_H */ | 178 | #endif /* _SCSI_SCSI_CMND_H */ |
diff --git a/include/scsi/scsi_eh.h b/include/scsi/scsi_eh.h index 1e08be1466ee..25071d5d9bf8 100644 --- a/include/scsi/scsi_eh.h +++ b/include/scsi/scsi_eh.h | |||
@@ -74,6 +74,7 @@ struct scsi_eh_save { | |||
74 | unsigned char cmd_len; | 74 | unsigned char cmd_len; |
75 | unsigned char cmnd[MAX_COMMAND_SIZE]; | 75 | unsigned char cmnd[MAX_COMMAND_SIZE]; |
76 | struct scsi_data_buffer sdb; | 76 | struct scsi_data_buffer sdb; |
77 | struct request *next_rq; | ||
77 | 78 | ||
78 | /* new command support */ | 79 | /* new command support */ |
79 | struct scatterlist sense_sgl; | 80 | struct scatterlist sense_sgl; |