diff options
Diffstat (limited to 'include/scsi/scsi_cmnd.h')
-rw-r--r-- | include/scsi/scsi_cmnd.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index a5e885a111df..377df4a28512 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h | |||
@@ -10,6 +10,7 @@ | |||
10 | 10 | ||
11 | struct Scsi_Host; | 11 | struct Scsi_Host; |
12 | struct scsi_device; | 12 | struct scsi_device; |
13 | struct scsi_driver; | ||
13 | 14 | ||
14 | /* | 15 | /* |
15 | * MAX_COMMAND_SIZE is: | 16 | * MAX_COMMAND_SIZE is: |
@@ -131,6 +132,11 @@ struct scsi_cmnd { | |||
131 | unsigned char tag; /* SCSI-II queued command tag */ | 132 | unsigned char tag; /* SCSI-II queued command tag */ |
132 | }; | 133 | }; |
133 | 134 | ||
135 | static inline struct scsi_driver *scsi_cmd_to_driver(struct scsi_cmnd *cmd) | ||
136 | { | ||
137 | return *(struct scsi_driver **)cmd->request->rq_disk->private_data; | ||
138 | } | ||
139 | |||
134 | extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t); | 140 | extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t); |
135 | extern struct scsi_cmnd *__scsi_get_command(struct Scsi_Host *, gfp_t); | 141 | extern struct scsi_cmnd *__scsi_get_command(struct Scsi_Host *, gfp_t); |
136 | extern void scsi_put_command(struct scsi_cmnd *); | 142 | extern void scsi_put_command(struct scsi_cmnd *); |
@@ -289,17 +295,17 @@ static inline struct scsi_data_buffer *scsi_prot(struct scsi_cmnd *cmd) | |||
289 | 295 | ||
290 | static inline void set_msg_byte(struct scsi_cmnd *cmd, char status) | 296 | static inline void set_msg_byte(struct scsi_cmnd *cmd, char status) |
291 | { | 297 | { |
292 | cmd->result |= status << 8; | 298 | cmd->result = (cmd->result & 0xffff00ff) | (status << 8); |
293 | } | 299 | } |
294 | 300 | ||
295 | static inline void set_host_byte(struct scsi_cmnd *cmd, char status) | 301 | static inline void set_host_byte(struct scsi_cmnd *cmd, char status) |
296 | { | 302 | { |
297 | cmd->result |= status << 16; | 303 | cmd->result = (cmd->result & 0xff00ffff) | (status << 16); |
298 | } | 304 | } |
299 | 305 | ||
300 | static inline void set_driver_byte(struct scsi_cmnd *cmd, char status) | 306 | static inline void set_driver_byte(struct scsi_cmnd *cmd, char status) |
301 | { | 307 | { |
302 | cmd->result |= status << 24; | 308 | cmd->result = (cmd->result & 0x00ffffff) | (status << 24); |
303 | } | 309 | } |
304 | 310 | ||
305 | #endif /* _SCSI_SCSI_CMND_H */ | 311 | #endif /* _SCSI_SCSI_CMND_H */ |