Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
tcm_vhost.h
Go to the documentation of this file.
1 #define TCM_VHOST_VERSION "v0.1"
2 #define TCM_VHOST_NAMELEN 256
3 #define TCM_VHOST_MAX_CDB_SIZE 32
4 
5 struct tcm_vhost_cmd {
6  /* Descriptor from vhost_get_vq_desc() for virt_queue segment */
8  /* virtio-scsi initiator task attribute */
10  /* virtio-scsi initiator data direction */
12  /* Expected data transfer length from virtio-scsi header */
14  /* The Tag from include/linux/virtio_scsi.h:struct virtio_scsi_cmd_req */
16  /* The number of scatterlists associated with this cmd */
18  /* Saved unpacked SCSI LUN for tcm_vhost_submission_work() */
20  /* Pointer to the SGL formatted memory from virtio-scsi */
22  /* Pointer to response */
24  /* Pointer to vhost_scsi for our device */
26  /* Pointer to vhost nexus memory */
28  /* The TCM I/O descriptor that is accessed via container_of() */
30  /* work item used for cmwq dispatch to tcm_vhost_submission_work() */
31  struct work_struct work;
32  /* Copy of the incoming SCSI command descriptor block (CDB) */
34  /* Sense buffer that will be mapped into outgoing status */
36  /* Completed commands list, serviced from vhost worker thread */
38 };
39 
41  /* Pointer to TCM session for I_T Nexus */
43 };
44 
46  /* Binary World Wide unique Port Name for Vhost Initiator port */
48  /* ASCII formatted WWPN for Sas Initiator port */
50  /* Returned by tcm_vhost_make_nodeacl() */
52 };
53 
54 struct tcm_vhost_tpg {
55  /* Vhost port target portal group tag for TCM */
57  /* Used to track number of TPG Port/Lun Links wrt to explict I_T Nexus shutdown */
59  /* Used for vhost_scsi device reference to tpg_nexus, protected by tv_tpg_mutex */
61  /* list for tcm_vhost_list */
63  /* Used to protect access for tpg_nexus */
65  /* Pointer to the TCM VHost I_T Nexus for this TPG endpoint */
67  /* Pointer back to tcm_vhost_tport */
69  /* Returned by tcm_vhost_make_tpg() */
71 };
72 
74  /* SCSI protocol the tport is providing */
76  /* Binary World Wide unique Port Name for Vhost Target port */
78  /* ASCII formatted WWPN for Vhost Target port */
80  /* Returned by tcm_vhost_make_tport() */
81  struct se_wwn tport_wwn;
82 };
83 
84 /*
85  * As per request from MST, keep TCM_VHOST related ioctl defines out of
86  * linux/vhost.h (user-space) for now..
87  */
88 
89 #include <linux/vhost.h>
90 
91 /*
92  * Used by QEMU userspace to ensure a consistent vhost-scsi ABI.
93  *
94  * ABI Rev 0: July 2012 version starting point for v3.6-rc merge candidate +
95  * RFC-v2 vhost-scsi userspace. Add GET_ABI_VERSION ioctl usage
96  */
97 
98 #define VHOST_SCSI_ABI_VERSION 0
99 
103  unsigned short vhost_tpgt;
104  unsigned short reserved;
105 };
106 
107 /* VHOST_SCSI specific defines */
108 #define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct vhost_scsi_target)
109 #define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target)
110 /* Changing this breaks userspace. */
111 #define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, int)