Linux Audio

Check our new training course

Linux kernel drivers training

May 6-19, 2025
Register
Loading...
v3.1
 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
24struct 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	struct request *pscsi_req;
31	unsigned char pscsi_cdb[0];
32} ____cacheline_aligned;
33
34#define PDF_HAS_CHANNEL_ID	0x01
35#define PDF_HAS_TARGET_ID	0x02
36#define PDF_HAS_LUN_ID		0x04
37#define PDF_HAS_VPD_UNIT_SERIAL 0x08
38#define PDF_HAS_VPD_DEV_IDENT	0x10
39#define PDF_HAS_VIRT_HOST_ID	0x20
40
41struct pscsi_dev_virt {
 
42	int	pdv_flags;
43	int	pdv_host_id;
44	int	pdv_channel_id;
45	int	pdv_target_id;
46	int	pdv_lun_id;
47	struct block_device *pdv_bd;
48	struct scsi_device *pdv_sd;
49	struct se_hba *pdv_se_hba;
50} ____cacheline_aligned;
51
52typedef enum phv_modes {
53	PHV_VIRUTAL_HOST_ID,
54	PHV_LLD_SCSI_HOST_NO
55} phv_modes_t;
56
57struct pscsi_hba_virt {
58	int			phv_host_id;
59	phv_modes_t		phv_mode;
60	struct Scsi_Host	*phv_lld_host;
61} ____cacheline_aligned;
62
63#endif   /*** TARGET_CORE_PSCSI_H ***/
v4.10.11
 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/cache.h>             /* ___cacheline_aligned */
19#include <target/target_core_base.h> /* struct se_device */
20
21struct block_device;
22struct scsi_device;
23struct Scsi_Host;
24
25struct pscsi_plugin_task {
26	unsigned char pscsi_sense[TRANSPORT_SENSE_BUFFER];
 
27	int	pscsi_direction;
28	int	pscsi_result;
29	u32	pscsi_resid;
 
30	unsigned char pscsi_cdb[0];
31} ____cacheline_aligned;
32
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
39
40struct pscsi_dev_virt {
41	struct se_device dev;
42	int	pdv_flags;
43	int	pdv_host_id;
44	int	pdv_channel_id;
45	int	pdv_target_id;
46	int	pdv_lun_id;
47	struct block_device *pdv_bd;
48	struct scsi_device *pdv_sd;
49	struct Scsi_Host *pdv_lld_host;
50} ____cacheline_aligned;
51
52typedef enum phv_modes {
53	PHV_VIRTUAL_HOST_ID,
54	PHV_LLD_SCSI_HOST_NO
55} phv_modes_t;
56
57struct pscsi_hba_virt {
58	int			phv_host_id;
59	phv_modes_t		phv_mode;
60	struct Scsi_Host	*phv_lld_host;
61} ____cacheline_aligned;
62
63#endif   /*** TARGET_CORE_PSCSI_H ***/