[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>
This commit is contained in:
Родитель
97218a1499
Коммит
f290f1970f
|
@ -22,6 +22,7 @@
|
||||||
#include <linux/spinlock.h>
|
#include <linux/spinlock.h>
|
||||||
#include <linux/capability.h>
|
#include <linux/capability.h>
|
||||||
#include <linux/bitops.h>
|
#include <linux/bitops.h>
|
||||||
|
#include <linux/blkdev.h>
|
||||||
|
|
||||||
#include <scsi/scsi.h>
|
#include <scsi/scsi.h>
|
||||||
#include <linux/cdrom.h>
|
#include <linux/cdrom.h>
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
#define _SCSI_SCSI_H
|
#define _SCSI_SCSI_H
|
||||||
|
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <scsi/scsi_cmnd.h>
|
|
||||||
|
struct scsi_cmnd;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The maximum number of SG segments that we will put inside a
|
* 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)
|
||||||
#define host_byte(result) (((result) >> 16) & 0xff)
|
#define host_byte(result) (((result) >> 16) & 0xff)
|
||||||
#define driver_byte(result) (((result) >> 24) & 0xff)
|
#define driver_byte(result) (((result) >> 24) & 0xff)
|
||||||
|
|
||||||
static inline void set_msg_byte(struct scsi_cmnd *cmd, char status)
|
|
||||||
{
|
|
||||||
cmd->result |= status << 8;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void set_host_byte(struct scsi_cmnd *cmd, char status)
|
|
||||||
{
|
|
||||||
cmd->result |= status << 16;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void set_driver_byte(struct scsi_cmnd *cmd, char status)
|
|
||||||
{
|
|
||||||
cmd->result |= status << 24;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#define sense_class(sense) (((sense) >> 4) & 0x7)
|
#define sense_class(sense) (((sense) >> 4) & 0x7)
|
||||||
#define sense_error(sense) ((sense) & 0xf)
|
#define sense_error(sense) ((sense) & 0xf)
|
||||||
#define sense_valid(sense) ((sense) & 0x80);
|
#define sense_valid(sense) ((sense) & 0x80);
|
||||||
|
|
|
@ -291,4 +291,19 @@ static inline struct scsi_data_buffer *scsi_prot(struct scsi_cmnd *cmd)
|
||||||
#define scsi_for_each_prot_sg(cmd, sg, nseg, __i) \
|
#define scsi_for_each_prot_sg(cmd, sg, nseg, __i) \
|
||||||
for_each_sg(scsi_prot_sglist(cmd), sg, nseg, __i)
|
for_each_sg(scsi_prot_sglist(cmd), sg, nseg, __i)
|
||||||
|
|
||||||
|
static inline void set_msg_byte(struct scsi_cmnd *cmd, char status)
|
||||||
|
{
|
||||||
|
cmd->result |= status << 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void set_host_byte(struct scsi_cmnd *cmd, char status)
|
||||||
|
{
|
||||||
|
cmd->result |= status << 16;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void set_driver_byte(struct scsi_cmnd *cmd, char status)
|
||||||
|
{
|
||||||
|
cmd->result |= status << 24;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* _SCSI_SCSI_CMND_H */
|
#endif /* _SCSI_SCSI_CMND_H */
|
||||||
|
|
Загрузка…
Ссылка в новой задаче