diff options
author | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-02-08 22:59:48 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-03-12 13:58:13 -0400 |
commit | f290f1970f01287eaaffc798a677594a57ebd65e (patch) | |
tree | 534b3ab262c3c791f80c8fd32dee7192395973dc | |
parent | 97218a1499391b174ea95e05b7a40fbb73e79813 (diff) |
[SCSI] Make scsi.h independent of the rest of the scsi includes
This allows it to compile and be used on the ps3 platform that wants
to use the #define values in scsi.h without actually having
CONFIG_SCSI set.
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r-- | block/cmd-filter.c | 1 | ||||
-rw-r--r-- | include/scsi/scsi.h | 19 | ||||
-rw-r--r-- | include/scsi/scsi_cmnd.h | 15 |
3 files changed, 18 insertions, 17 deletions
diff --git a/block/cmd-filter.c b/block/cmd-filter.c index 504b275e1b90..572bbc2f900d 100644 --- a/block/cmd-filter.c +++ b/block/cmd-filter.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/spinlock.h> | 22 | #include <linux/spinlock.h> |
23 | #include <linux/capability.h> | 23 | #include <linux/capability.h> |
24 | #include <linux/bitops.h> | 24 | #include <linux/bitops.h> |
25 | #include <linux/blkdev.h> | ||
25 | 26 | ||
26 | #include <scsi/scsi.h> | 27 | #include <scsi/scsi.h> |
27 | #include <linux/cdrom.h> | 28 | #include <linux/cdrom.h> |
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 80d7f60e2663..084478e14d24 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
@@ -9,7 +9,8 @@ | |||
9 | #define _SCSI_SCSI_H | 9 | #define _SCSI_SCSI_H |
10 | 10 | ||
11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
12 | #include <scsi/scsi_cmnd.h> | 12 | |
13 | struct scsi_cmnd; | ||
13 | 14 | ||
14 | /* | 15 | /* |
15 | * The maximum number of SG segments that we will put inside a | 16 | * The maximum number of SG segments that we will put inside a |
@@ -439,22 +440,6 @@ static inline int scsi_is_wlun(unsigned int lun) | |||
439 | #define host_byte(result) (((result) >> 16) & 0xff) | 440 | #define host_byte(result) (((result) >> 16) & 0xff) |
440 | #define driver_byte(result) (((result) >> 24) & 0xff) | 441 | #define driver_byte(result) (((result) >> 24) & 0xff) |
441 | 442 | ||
442 | static inline void set_msg_byte(struct scsi_cmnd *cmd, char status) | ||
443 | { | ||
444 | cmd->result |= status << 8; | ||
445 | } | ||
446 | |||
447 | static inline void set_host_byte(struct scsi_cmnd *cmd, char status) | ||
448 | { | ||
449 | cmd->result |= status << 16; | ||
450 | } | ||
451 | |||
452 | static inline void set_driver_byte(struct scsi_cmnd *cmd, char status) | ||
453 | { | ||
454 | cmd->result |= status << 24; | ||
455 | } | ||
456 | |||
457 | |||
458 | #define sense_class(sense) (((sense) >> 4) & 0x7) | 443 | #define sense_class(sense) (((sense) >> 4) & 0x7) |
459 | #define sense_error(sense) ((sense) & 0xf) | 444 | #define sense_error(sense) ((sense) & 0xf) |
460 | #define sense_valid(sense) ((sense) & 0x80); | 445 | #define sense_valid(sense) ((sense) & 0x80); |
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 855bf95963e7..43b50d36925c 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h | |||
@@ -291,4 +291,19 @@ static inline struct scsi_data_buffer *scsi_prot(struct scsi_cmnd *cmd) | |||
291 | #define scsi_for_each_prot_sg(cmd, sg, nseg, __i) \ | 291 | #define scsi_for_each_prot_sg(cmd, sg, nseg, __i) \ |
292 | for_each_sg(scsi_prot_sglist(cmd), sg, nseg, __i) | 292 | for_each_sg(scsi_prot_sglist(cmd), sg, nseg, __i) |
293 | 293 | ||
294 | static inline void set_msg_byte(struct scsi_cmnd *cmd, char status) | ||
295 | { | ||
296 | cmd->result |= status << 8; | ||
297 | } | ||
298 | |||
299 | static inline void set_host_byte(struct scsi_cmnd *cmd, char status) | ||
300 | { | ||
301 | cmd->result |= status << 16; | ||
302 | } | ||
303 | |||
304 | static inline void set_driver_byte(struct scsi_cmnd *cmd, char status) | ||
305 | { | ||
306 | cmd->result |= status << 24; | ||
307 | } | ||
308 | |||
294 | #endif /* _SCSI_SCSI_CMND_H */ | 309 | #endif /* _SCSI_SCSI_CMND_H */ |