xref: /titanic_51/usr/src/lib/libdtrace/common/scsi.d (revision be6802e44a2dc59129ccfb75410526d5c1d023ee)
1d8c54e3dSSam Cramer /*
2d8c54e3dSSam Cramer  * CDDL HEADER START
3d8c54e3dSSam Cramer  *
4d8c54e3dSSam Cramer  * The contents of this file are subject to the terms of the
5d8c54e3dSSam Cramer  * Common Development and Distribution License (the "License").
6d8c54e3dSSam Cramer  * You may not use this file except in compliance with the License.
7d8c54e3dSSam Cramer  *
8d8c54e3dSSam Cramer  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9d8c54e3dSSam Cramer  * or http://www.opensolaris.org/os/licensing.
10d8c54e3dSSam Cramer  * See the License for the specific language governing permissions
11d8c54e3dSSam Cramer  * and limitations under the License.
12d8c54e3dSSam Cramer  *
13d8c54e3dSSam Cramer  * When distributing Covered Code, include this CDDL HEADER in each
14d8c54e3dSSam Cramer  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15d8c54e3dSSam Cramer  * If applicable, add the following below this CDDL HEADER, with the
16d8c54e3dSSam Cramer  * fields enclosed by brackets "[]" replaced with your own identifying
17d8c54e3dSSam Cramer  * information: Portions Copyright [yyyy] [name of copyright owner]
18d8c54e3dSSam Cramer  *
19d8c54e3dSSam Cramer  * CDDL HEADER END
20d8c54e3dSSam Cramer  */
21d8c54e3dSSam Cramer 
22d8c54e3dSSam Cramer /*
23d8c54e3dSSam Cramer  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24d8c54e3dSSam Cramer  * Use is subject to license terms.
25d8c54e3dSSam Cramer  */
26d8c54e3dSSam Cramer 
27072f7b95SSam Cramer #pragma	D depends_on module genunix
28072f7b95SSam Cramer #pragma	D depends_on module stmf
29072f7b95SSam Cramer 
30d8c54e3dSSam Cramer /*
31d8c54e3dSSam Cramer  * The scsicmd_t structure should be used by providers
32d8c54e3dSSam Cramer  * to represent a SCSI command block (cdb).
33d8c54e3dSSam Cramer  */
34d8c54e3dSSam Cramer typedef struct scsicmd {
35d8c54e3dSSam Cramer 	uint64_t ic_len;	/* CDB length */
36d8c54e3dSSam Cramer 	uint8_t  *ic_cdb;	/* CDB data */
37d8c54e3dSSam Cramer } scsicmd_t;
38d8c54e3dSSam Cramer 
39d8c54e3dSSam Cramer /*
40d8c54e3dSSam Cramer  * Translator for scsicmd_t, translating from a scsi_task_t
41d8c54e3dSSam Cramer  */
42d8c54e3dSSam Cramer #pragma D binding "1.5" translator
43d8c54e3dSSam Cramer translator scsicmd_t < scsi_task_t *T > {
44d8c54e3dSSam Cramer 	ic_len = T->task_cdb_length;
45d8c54e3dSSam Cramer 	ic_cdb = T->task_cdb;
46d8c54e3dSSam Cramer };
47a668b114SPriya Krishnan 
48a668b114SPriya Krishnan /*
49a668b114SPriya Krishnan  * The xferinfo_t structure can be used by providers to
50a668b114SPriya Krishnan  * represent transfer information related to a single
51a668b114SPriya Krishnan  * buffer. The members describing the remote memory
52a668b114SPriya Krishnan  * are only valid if the transport layer is an RDMA-
53a668b114SPriya Krishnan  * capable transport like Infiniband
54a668b114SPriya Krishnan  */
55a668b114SPriya Krishnan typedef struct xferinfo {
56a668b114SPriya Krishnan 	uintptr_t xfer_laddr;   /* local buffer address */
57a668b114SPriya Krishnan 	uint32_t xfer_loffset;
58a668b114SPriya Krishnan 	uint32_t xfer_lkey;     /* access control to local memory */
59a668b114SPriya Krishnan 	uintptr_t xfer_raddr;   /* remote virtual address */
60a668b114SPriya Krishnan 	uint32_t xfer_roffset;  /* offset from the remote address */
61a668b114SPriya Krishnan 	uint32_t xfer_rkey;     /* access control to remote virtual address */
62a668b114SPriya Krishnan 	uint32_t xfer_len;      /* transfer length */
63a668b114SPriya Krishnan 	uint32_t xfer_type;     /* Read (0) or Write (1) */
64a668b114SPriya Krishnan } xferinfo_t;
65*be6802e4SPriya Krishnan 
66*be6802e4SPriya Krishnan /*
67*be6802e4SPriya Krishnan  * the iscsiinfo_t is used to provide identifying information about
68*be6802e4SPriya Krishnan  * the target and the initiator and also some PDU level information
69*be6802e4SPriya Krishnan  * such as lun, data length and sequence numbers.
70*be6802e4SPriya Krishnan  */
71*be6802e4SPriya Krishnan typedef struct iscsiinfo {
72*be6802e4SPriya Krishnan 	string ii_target;	/* target iqn */
73*be6802e4SPriya Krishnan 	string ii_initiator;	/* initiator iqn */
74*be6802e4SPriya Krishnan 	string ii_isid;         /* initiator session identifier */
75*be6802e4SPriya Krishnan 	string ii_tsih;         /* target session identifying handle */
76*be6802e4SPriya Krishnan 	string ii_transport;    /* transport type ("iser-ib", "sockets") */
77*be6802e4SPriya Krishnan 
78*be6802e4SPriya Krishnan 	uint64_t ii_lun;	/* target logical unit number */
79*be6802e4SPriya Krishnan 
80*be6802e4SPriya Krishnan 	uint32_t ii_itt;	/* initiator task tag */
81*be6802e4SPriya Krishnan 	uint32_t ii_ttt;	/* target transfer tag */
82*be6802e4SPriya Krishnan 
83*be6802e4SPriya Krishnan 	uint32_t ii_cmdsn;	/* command sequence number */
84*be6802e4SPriya Krishnan 	uint32_t ii_statsn;	/* status sequence number */
85*be6802e4SPriya Krishnan 	uint32_t ii_datasn;	/* data sequence number */
86*be6802e4SPriya Krishnan 
87*be6802e4SPriya Krishnan 	uint32_t ii_datalen;	/* length of data payload */
88*be6802e4SPriya Krishnan 	uint32_t ii_flags;	/* probe-specific flags */
89*be6802e4SPriya Krishnan } iscsiinfo_t;
90