xref: /onnv-gate/usr/src/lib/libdtrace/common/scsi.d (revision 10044:2643c1cd9e2a)
19578SSam.Cramer@Sun.COM /*
29578SSam.Cramer@Sun.COM  * CDDL HEADER START
39578SSam.Cramer@Sun.COM  *
49578SSam.Cramer@Sun.COM  * The contents of this file are subject to the terms of the
59578SSam.Cramer@Sun.COM  * Common Development and Distribution License (the "License").
69578SSam.Cramer@Sun.COM  * You may not use this file except in compliance with the License.
79578SSam.Cramer@Sun.COM  *
89578SSam.Cramer@Sun.COM  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
99578SSam.Cramer@Sun.COM  * or http://www.opensolaris.org/os/licensing.
109578SSam.Cramer@Sun.COM  * See the License for the specific language governing permissions
119578SSam.Cramer@Sun.COM  * and limitations under the License.
129578SSam.Cramer@Sun.COM  *
139578SSam.Cramer@Sun.COM  * When distributing Covered Code, include this CDDL HEADER in each
149578SSam.Cramer@Sun.COM  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
159578SSam.Cramer@Sun.COM  * If applicable, add the following below this CDDL HEADER, with the
169578SSam.Cramer@Sun.COM  * fields enclosed by brackets "[]" replaced with your own identifying
179578SSam.Cramer@Sun.COM  * information: Portions Copyright [yyyy] [name of copyright owner]
189578SSam.Cramer@Sun.COM  *
199578SSam.Cramer@Sun.COM  * CDDL HEADER END
209578SSam.Cramer@Sun.COM  */
219578SSam.Cramer@Sun.COM 
229578SSam.Cramer@Sun.COM /*
239578SSam.Cramer@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
249578SSam.Cramer@Sun.COM  * Use is subject to license terms.
259578SSam.Cramer@Sun.COM  */
269578SSam.Cramer@Sun.COM 
279625SSam.Cramer@Sun.COM #pragma	D depends_on module genunix
289625SSam.Cramer@Sun.COM #pragma	D depends_on module stmf
299625SSam.Cramer@Sun.COM 
309578SSam.Cramer@Sun.COM /*
319578SSam.Cramer@Sun.COM  * The scsicmd_t structure should be used by providers
329578SSam.Cramer@Sun.COM  * to represent a SCSI command block (cdb).
339578SSam.Cramer@Sun.COM  */
349578SSam.Cramer@Sun.COM typedef struct scsicmd {
359578SSam.Cramer@Sun.COM 	uint64_t ic_len;	/* CDB length */
369578SSam.Cramer@Sun.COM 	uint8_t  *ic_cdb;	/* CDB data */
379578SSam.Cramer@Sun.COM } scsicmd_t;
389578SSam.Cramer@Sun.COM 
399578SSam.Cramer@Sun.COM /*
409578SSam.Cramer@Sun.COM  * Translator for scsicmd_t, translating from a scsi_task_t
419578SSam.Cramer@Sun.COM  */
429578SSam.Cramer@Sun.COM #pragma D binding "1.5" translator
439578SSam.Cramer@Sun.COM translator scsicmd_t < scsi_task_t *T > {
449578SSam.Cramer@Sun.COM 	ic_len = T->task_cdb_length;
459578SSam.Cramer@Sun.COM 	ic_cdb = T->task_cdb;
469578SSam.Cramer@Sun.COM };
479721SPriya.Krishnan@Sun.COM 
489721SPriya.Krishnan@Sun.COM /*
499721SPriya.Krishnan@Sun.COM  * The xferinfo_t structure can be used by providers to
509721SPriya.Krishnan@Sun.COM  * represent transfer information related to a single
519721SPriya.Krishnan@Sun.COM  * buffer. The members describing the remote memory
529721SPriya.Krishnan@Sun.COM  * are only valid if the transport layer is an RDMA-
539721SPriya.Krishnan@Sun.COM  * capable transport like Infiniband
549721SPriya.Krishnan@Sun.COM  */
559721SPriya.Krishnan@Sun.COM typedef struct xferinfo {
569721SPriya.Krishnan@Sun.COM 	uintptr_t xfer_laddr;   /* local buffer address */
579721SPriya.Krishnan@Sun.COM 	uint32_t xfer_loffset;
589721SPriya.Krishnan@Sun.COM 	uint32_t xfer_lkey;     /* access control to local memory */
599721SPriya.Krishnan@Sun.COM 	uintptr_t xfer_raddr;   /* remote virtual address */
609721SPriya.Krishnan@Sun.COM 	uint32_t xfer_roffset;  /* offset from the remote address */
619721SPriya.Krishnan@Sun.COM 	uint32_t xfer_rkey;     /* access control to remote virtual address */
629721SPriya.Krishnan@Sun.COM 	uint32_t xfer_len;      /* transfer length */
639721SPriya.Krishnan@Sun.COM 	uint32_t xfer_type;     /* Read (0) or Write (1) */
649721SPriya.Krishnan@Sun.COM } xferinfo_t;
65*10044SPriya.Krishnan@Sun.COM 
66*10044SPriya.Krishnan@Sun.COM /*
67*10044SPriya.Krishnan@Sun.COM  * the iscsiinfo_t is used to provide identifying information about
68*10044SPriya.Krishnan@Sun.COM  * the target and the initiator and also some PDU level information
69*10044SPriya.Krishnan@Sun.COM  * such as lun, data length and sequence numbers.
70*10044SPriya.Krishnan@Sun.COM  */
71*10044SPriya.Krishnan@Sun.COM typedef struct iscsiinfo {
72*10044SPriya.Krishnan@Sun.COM 	string ii_target;	/* target iqn */
73*10044SPriya.Krishnan@Sun.COM 	string ii_initiator;	/* initiator iqn */
74*10044SPriya.Krishnan@Sun.COM 	string ii_isid;         /* initiator session identifier */
75*10044SPriya.Krishnan@Sun.COM 	string ii_tsih;         /* target session identifying handle */
76*10044SPriya.Krishnan@Sun.COM 	string ii_transport;    /* transport type ("iser-ib", "sockets") */
77*10044SPriya.Krishnan@Sun.COM 
78*10044SPriya.Krishnan@Sun.COM 	uint64_t ii_lun;	/* target logical unit number */
79*10044SPriya.Krishnan@Sun.COM 
80*10044SPriya.Krishnan@Sun.COM 	uint32_t ii_itt;	/* initiator task tag */
81*10044SPriya.Krishnan@Sun.COM 	uint32_t ii_ttt;	/* target transfer tag */
82*10044SPriya.Krishnan@Sun.COM 
83*10044SPriya.Krishnan@Sun.COM 	uint32_t ii_cmdsn;	/* command sequence number */
84*10044SPriya.Krishnan@Sun.COM 	uint32_t ii_statsn;	/* status sequence number */
85*10044SPriya.Krishnan@Sun.COM 	uint32_t ii_datasn;	/* data sequence number */
86*10044SPriya.Krishnan@Sun.COM 
87*10044SPriya.Krishnan@Sun.COM 	uint32_t ii_datalen;	/* length of data payload */
88*10044SPriya.Krishnan@Sun.COM 	uint32_t ii_flags;	/* probe-specific flags */
89*10044SPriya.Krishnan@Sun.COM } iscsiinfo_t;
90