0001
0002 #ifndef TARGET_CORE_PSCSI_H
0003 #define TARGET_CORE_PSCSI_H
0004
0005 #define PSCSI_VERSION "v4.0"
0006
0007
0008 #ifndef INQUIRY_DATA_SIZE
0009 #define INQUIRY_DATA_SIZE 0x24
0010 #endif
0011
0012
0013 #define PSCSI_DEFAULT_QUEUEDEPTH 1
0014
0015 #define PS_RETRY 5
0016 #define PS_TIMEOUT_DISK (15*HZ)
0017 #define PS_TIMEOUT_OTHER (500*HZ)
0018
0019 #include <linux/cache.h> /* ___cacheline_aligned */
0020 #include <target/target_core_base.h> /* struct se_device */
0021
0022 struct block_device;
0023 struct scsi_device;
0024 struct Scsi_Host;
0025
0026 #define PDF_HAS_CHANNEL_ID 0x01
0027 #define PDF_HAS_TARGET_ID 0x02
0028 #define PDF_HAS_LUN_ID 0x04
0029 #define PDF_HAS_VPD_UNIT_SERIAL 0x08
0030 #define PDF_HAS_VPD_DEV_IDENT 0x10
0031 #define PDF_HAS_VIRT_HOST_ID 0x20
0032
0033 struct pscsi_dev_virt {
0034 struct se_device dev;
0035 int pdv_flags;
0036 int pdv_host_id;
0037 int pdv_channel_id;
0038 int pdv_target_id;
0039 int pdv_lun_id;
0040 struct block_device *pdv_bd;
0041 struct scsi_device *pdv_sd;
0042 struct Scsi_Host *pdv_lld_host;
0043 } ____cacheline_aligned;
0044
0045 typedef enum phv_modes {
0046 PHV_VIRTUAL_HOST_ID,
0047 PHV_LLD_SCSI_HOST_NO
0048 } phv_modes_t;
0049
0050 struct pscsi_hba_virt {
0051 int phv_host_id;
0052 phv_modes_t phv_mode;
0053 struct Scsi_Host *phv_lld_host;
0054 } ____cacheline_aligned;
0055
0056 #endif