]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
c66ac9db NB |
2 | #ifndef TARGET_CORE_PSCSI_H |
3 | #define TARGET_CORE_PSCSI_H | |
4 | ||
5 | #define PSCSI_VERSION "v4.0" | |
c66ac9db NB |
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 | ||
8dcf07be BVA |
19 | #include <linux/cache.h> /* ___cacheline_aligned */ |
20 | #include <target/target_core_base.h> /* struct se_device */ | |
c66ac9db | 21 | |
8dcf07be | 22 | struct block_device; |
ba929992 | 23 | struct scsi_device; |
8dcf07be | 24 | struct Scsi_Host; |
ba929992 | 25 | |
c66ac9db | 26 | struct pscsi_plugin_task { |
6708bb27 | 27 | unsigned char pscsi_cdb[0]; |
c66ac9db NB |
28 | } ____cacheline_aligned; |
29 | ||
30 | #define PDF_HAS_CHANNEL_ID 0x01 | |
31 | #define PDF_HAS_TARGET_ID 0x02 | |
32 | #define PDF_HAS_LUN_ID 0x04 | |
33 | #define PDF_HAS_VPD_UNIT_SERIAL 0x08 | |
34 | #define PDF_HAS_VPD_DEV_IDENT 0x10 | |
35 | #define PDF_HAS_VIRT_HOST_ID 0x20 | |
36 | ||
37 | struct pscsi_dev_virt { | |
0fd97ccf | 38 | struct se_device dev; |
c66ac9db NB |
39 | int pdv_flags; |
40 | int pdv_host_id; | |
41 | int pdv_channel_id; | |
42 | int pdv_target_id; | |
43 | int pdv_lun_id; | |
44 | struct block_device *pdv_bd; | |
45 | struct scsi_device *pdv_sd; | |
5a7125c6 | 46 | struct Scsi_Host *pdv_lld_host; |
c66ac9db NB |
47 | } ____cacheline_aligned; |
48 | ||
49 | typedef enum phv_modes { | |
e6a8a41a | 50 | PHV_VIRTUAL_HOST_ID, |
c66ac9db NB |
51 | PHV_LLD_SCSI_HOST_NO |
52 | } phv_modes_t; | |
53 | ||
54 | struct pscsi_hba_virt { | |
55 | int phv_host_id; | |
56 | phv_modes_t phv_mode; | |
57 | struct Scsi_Host *phv_lld_host; | |
58 | } ____cacheline_aligned; | |
59 | ||
60 | #endif /*** TARGET_CORE_PSCSI_H ***/ |