1 #ifndef TARGET_CORE_PSCSI_H
2 #define TARGET_CORE_PSCSI_H
3 
4 #define PSCSI_VERSION		"v4.0"
5 
6 /* used in pscsi_find_alloc_len() */
7 #ifndef INQUIRY_DATA_SIZE
8 #define INQUIRY_DATA_SIZE	0x24
9 #endif
10 
11 /* used in pscsi_add_device_to_list() */
12 #define PSCSI_DEFAULT_QUEUEDEPTH	1
13 
14 #define PS_RETRY		5
15 #define PS_TIMEOUT_DISK		(15*HZ)
16 #define PS_TIMEOUT_OTHER	(500*HZ)
17 
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>
23 
24 struct pscsi_plugin_task {
25 	struct se_task pscsi_task;
26 	unsigned char *pscsi_cdb;
27 	unsigned char __pscsi_cdb[TCM_MAX_COMMAND_SIZE];
28 	unsigned char pscsi_sense[SCSI_SENSE_BUFFERSIZE];
29 	int	pscsi_direction;
30 	int	pscsi_result;
31 	u32	pscsi_resid;
32 	struct request *pscsi_req;
33 } ____cacheline_aligned;
34 
35 #define PDF_HAS_CHANNEL_ID	0x01
36 #define PDF_HAS_TARGET_ID	0x02
37 #define PDF_HAS_LUN_ID		0x04
38 #define PDF_HAS_VPD_UNIT_SERIAL 0x08
39 #define PDF_HAS_VPD_DEV_IDENT	0x10
40 #define PDF_HAS_VIRT_HOST_ID	0x20
41 
42 struct pscsi_dev_virt {
43 	int	pdv_flags;
44 	int	pdv_host_id;
45 	int	pdv_channel_id;
46 	int	pdv_target_id;
47 	int	pdv_lun_id;
48 	struct block_device *pdv_bd;
49 	struct scsi_device *pdv_sd;
50 	struct se_hba *pdv_se_hba;
51 } ____cacheline_aligned;
52 
53 typedef enum phv_modes {
54 	PHV_VIRUTAL_HOST_ID,
55 	PHV_LLD_SCSI_HOST_NO
56 } phv_modes_t;
57 
58 struct pscsi_hba_virt {
59 	int			phv_host_id;
60 	phv_modes_t		phv_mode;
61 	struct Scsi_Host	*phv_lld_host;
62 } ____cacheline_aligned;
63 
64 #endif   /*** TARGET_CORE_PSCSI_H ***/
65