Nicholas Bellinger | c66ac9d | 2010-12-17 11:11:26 -0800 | [diff] [blame] | 1 | #ifndef TARGET_CORE_PSCSI_H |
| 2 | #define TARGET_CORE_PSCSI_H |
| 3 | |
| 4 | #define PSCSI_VERSION "v4.0" |
Nicholas Bellinger | c66ac9d | 2010-12-17 11:11:26 -0800 | [diff] [blame] | 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> |
Nicholas Bellinger | c66ac9d | 2010-12-17 11:11:26 -0800 | [diff] [blame] | 19 | #include <linux/kref.h> |
| 20 | #include <linux/kobject.h> |
| 21 | |
Bart Van Assche | ba92999 | 2015-05-08 10:11:12 +0200 | [diff] [blame] | 22 | struct scsi_device; |
| 23 | |
Nicholas Bellinger | c66ac9d | 2010-12-17 11:11:26 -0800 | [diff] [blame] | 24 | struct pscsi_plugin_task { |
Bart Van Assche | ba92999 | 2015-05-08 10:11:12 +0200 | [diff] [blame] | 25 | unsigned char pscsi_sense[TRANSPORT_SENSE_BUFFER]; |
Nicholas Bellinger | c66ac9d | 2010-12-17 11:11:26 -0800 | [diff] [blame] | 26 | int pscsi_direction; |
| 27 | int pscsi_result; |
| 28 | u32 pscsi_resid; |
Andy Grover | 6708bb2 | 2011-06-08 10:36:43 -0700 | [diff] [blame] | 29 | unsigned char pscsi_cdb[0]; |
Nicholas Bellinger | c66ac9d | 2010-12-17 11:11:26 -0800 | [diff] [blame] | 30 | } ____cacheline_aligned; |
| 31 | |
| 32 | #define PDF_HAS_CHANNEL_ID 0x01 |
| 33 | #define PDF_HAS_TARGET_ID 0x02 |
| 34 | #define PDF_HAS_LUN_ID 0x04 |
| 35 | #define PDF_HAS_VPD_UNIT_SERIAL 0x08 |
| 36 | #define PDF_HAS_VPD_DEV_IDENT 0x10 |
| 37 | #define PDF_HAS_VIRT_HOST_ID 0x20 |
| 38 | |
| 39 | struct pscsi_dev_virt { |
Christoph Hellwig | 0fd97cc | 2012-10-08 00:03:19 -0400 | [diff] [blame] | 40 | struct se_device dev; |
Nicholas Bellinger | c66ac9d | 2010-12-17 11:11:26 -0800 | [diff] [blame] | 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; |
Andy Grover | 5a7125c | 2015-05-22 14:07:44 -0700 | [diff] [blame] | 48 | struct Scsi_Host *pdv_lld_host; |
Nicholas Bellinger | c66ac9d | 2010-12-17 11:11:26 -0800 | [diff] [blame] | 49 | } ____cacheline_aligned; |
| 50 | |
| 51 | typedef enum phv_modes { |
Stefan Hajnoczi | e6a8a41 | 2012-02-23 18:15:26 +0000 | [diff] [blame] | 52 | PHV_VIRTUAL_HOST_ID, |
Nicholas Bellinger | c66ac9d | 2010-12-17 11:11:26 -0800 | [diff] [blame] | 53 | PHV_LLD_SCSI_HOST_NO |
| 54 | } phv_modes_t; |
| 55 | |
| 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; |
| 61 | |
| 62 | #endif /*** TARGET_CORE_PSCSI_H ***/ |