[SCSI] libsas: unify domain_device sas_rphy lifetimes
[linux-2.6.git] / drivers / target / target_core_pscsi.h
blob43f1c419e8e53f071c8baef9d5c3fa17dbe52919
1 #ifndef TARGET_CORE_PSCSI_H
2 #define TARGET_CORE_PSCSI_H
4 #define PSCSI_VERSION "v4.0"
6 /* used in pscsi_find_alloc_len() */
7 #ifndef INQUIRY_DATA_SIZE
8 #define INQUIRY_DATA_SIZE 0x24
9 #endif
11 /* used in pscsi_add_device_to_list() */
12 #define PSCSI_DEFAULT_QUEUEDEPTH 1
14 #define PS_RETRY 5
15 #define PS_TIMEOUT_DISK (15*HZ)
16 #define PS_TIMEOUT_OTHER (500*HZ)
18 #include <linux/device.h>
19 #include <scsi/scsi_driver.h>
20 #include <scsi/scsi_device.h>
21 #include <linux/kref.h>
22 #include <linux/kobject.h>
24 struct pscsi_plugin_task {
25 struct se_task pscsi_task;
26 unsigned char pscsi_sense[SCSI_SENSE_BUFFERSIZE];
27 int pscsi_direction;
28 int pscsi_result;
29 u32 pscsi_resid;
30 unsigned char pscsi_cdb[0];
31 } ____cacheline_aligned;
33 #define PDF_HAS_CHANNEL_ID 0x01
34 #define PDF_HAS_TARGET_ID 0x02
35 #define PDF_HAS_LUN_ID 0x04
36 #define PDF_HAS_VPD_UNIT_SERIAL 0x08
37 #define PDF_HAS_VPD_DEV_IDENT 0x10
38 #define PDF_HAS_VIRT_HOST_ID 0x20
40 struct pscsi_dev_virt {
41 int pdv_flags;
42 int pdv_host_id;
43 int pdv_channel_id;
44 int pdv_target_id;
45 int pdv_lun_id;
46 struct block_device *pdv_bd;
47 struct scsi_device *pdv_sd;
48 struct se_hba *pdv_se_hba;
49 } ____cacheline_aligned;
51 typedef enum phv_modes {
52 PHV_VIRTUAL_HOST_ID,
53 PHV_LLD_SCSI_HOST_NO
54 } phv_modes_t;
56 struct pscsi_hba_virt {
57 int phv_host_id;
58 phv_modes_t phv_mode;
59 struct Scsi_Host *phv_lld_host;
60 } ____cacheline_aligned;
62 #endif /*** TARGET_CORE_PSCSI_H ***/