Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
[sfrench/cifs-2.6.git] / drivers / target / target_core_pscsi.h
1 #ifndef TARGET_CORE_PSCSI_H
2 #define TARGET_CORE_PSCSI_H
3
4 #define PSCSI_VERSION           "v4.0"
5 #define PSCSI_VIRTUAL_HBA_DEPTH 2048
6
7 /* used in pscsi_find_alloc_len() */
8 #ifndef INQUIRY_DATA_SIZE
9 #define INQUIRY_DATA_SIZE       0x24
10 #endif
11
12 /* used in pscsi_add_device_to_list() */
13 #define PSCSI_DEFAULT_QUEUEDEPTH        1
14
15 #define PS_RETRY                5
16 #define PS_TIMEOUT_DISK         (15*HZ)
17 #define PS_TIMEOUT_OTHER        (500*HZ)
18
19 #include <linux/device.h>
20 #include <scsi/scsi_driver.h>
21 #include <scsi/scsi_device.h>
22 #include <linux/kref.h>
23 #include <linux/kobject.h>
24
25 struct pscsi_plugin_task {
26         struct se_task pscsi_task;
27         unsigned char *pscsi_cdb;
28         unsigned char __pscsi_cdb[TCM_MAX_COMMAND_SIZE];
29         unsigned char pscsi_sense[SCSI_SENSE_BUFFERSIZE];
30         int     pscsi_direction;
31         int     pscsi_result;
32         u32     pscsi_resid;
33         struct request *pscsi_req;
34 } ____cacheline_aligned;
35
36 #define PDF_HAS_CHANNEL_ID      0x01
37 #define PDF_HAS_TARGET_ID       0x02
38 #define PDF_HAS_LUN_ID          0x04
39 #define PDF_HAS_VPD_UNIT_SERIAL 0x08
40 #define PDF_HAS_VPD_DEV_IDENT   0x10
41 #define PDF_HAS_VIRT_HOST_ID    0x20
42
43 struct pscsi_dev_virt {
44         int     pdv_flags;
45         int     pdv_host_id;
46         int     pdv_channel_id;
47         int     pdv_target_id;
48         int     pdv_lun_id;
49         struct block_device *pdv_bd;
50         struct scsi_device *pdv_sd;
51         struct se_hba *pdv_se_hba;
52 } ____cacheline_aligned;
53
54 typedef enum phv_modes {
55         PHV_VIRUTAL_HOST_ID,
56         PHV_LLD_SCSI_HOST_NO
57 } phv_modes_t;
58
59 struct pscsi_hba_virt {
60         int                     phv_host_id;
61         phv_modes_t             phv_mode;
62         struct Scsi_Host        *phv_lld_host;
63 } ____cacheline_aligned;
64
65 #endif   /*** TARGET_CORE_PSCSI_H ***/