Skip to content

Commit f290f19

Browse files
committed
[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>
1 parent 97218a1 commit f290f19

3 files changed

Lines changed: 18 additions & 17 deletions

File tree

‎block/cmd-filter.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <linux/spinlock.h>
2323
#include <linux/capability.h>
2424
#include <linux/bitops.h>
25+
#include <linux/blkdev.h>
2526

2627
#include <scsi/scsi.h>
2728
#include <linux/cdrom.h>

‎include/scsi/scsi.h‎

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
#define _SCSI_SCSI_H
1010

1111
#include <linux/types.h>
12-
#include <scsi/scsi_cmnd.h>
12+
13+
struct scsi_cmnd;
1314

1415
/*
1516
* 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)
439440
#define host_byte(result) (((result) >> 16) & 0xff)
440441
#define driver_byte(result) (((result) >> 24) & 0xff)
441442

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-
458443
#define sense_class(sense) (((sense) >> 4) & 0x7)
459444
#define sense_error(sense) ((sense) & 0xf)
460445
#define sense_valid(sense) ((sense) & 0x80);

‎include/scsi/scsi_cmnd.h‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,4 +291,19 @@ static inline struct scsi_data_buffer *scsi_prot(struct scsi_cmnd *cmd)
291291
#define scsi_for_each_prot_sg(cmd, sg, nseg, __i) \
292292
for_each_sg(scsi_prot_sglist(cmd), sg, nseg, __i)
293293

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+
294309
#endif /* _SCSI_SCSI_CMND_H */

0 commit comments

Comments
 (0)