14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/*
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * CDDL HEADER START
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * The contents of this file are subject to the terms of the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Common Development and Distribution License (the "License").
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * You may not use this file except in compliance with the License.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * or http://www.opensolaris.org/os/licensing.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * See the License for the specific language governing permissions
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * and limitations under the License.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * When distributing Covered Code, include this CDDL HEADER in each
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * If applicable, add the following below this CDDL HEADER, with the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * fields enclosed by brackets "[]" replaced with your own identifying
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * information: Portions Copyright [yyyy] [name of copyright owner]
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * CDDL HEADER END
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/*
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Use is subject to license terms.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D depends_on module genunix
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D depends_on module stmf
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/*
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * The scsicmd_t structure should be used by providers
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * to represent a SCSI command block (cdb).
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsynctypedef struct scsicmd {
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync uint64_t ic_len; /* CDB length */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync uint8_t *ic_cdb; /* CDB data */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync} scsicmd_t;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/*
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Translator for scsicmd_t, translating from a scsi_task_t
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D binding "1.5" translator
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsynctranslator scsicmd_t < scsi_task_t *T > {
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync ic_len = T->task_cdb_length;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync ic_cdb = T->task_cdb;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync};
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/*
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * The xferinfo_t structure can be used by providers to
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * represent transfer information related to a single
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * buffer. The members describing the remote memory
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * are only valid if the transport layer is an RDMA-
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * capable transport like Infiniband
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsynctypedef struct xferinfo {
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync uintptr_t xfer_laddr; /* local buffer address */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync uint32_t xfer_loffset;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync uint32_t xfer_lkey; /* access control to local memory */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync uintptr_t xfer_raddr; /* remote virtual address */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync uint32_t xfer_roffset; /* offset from the remote address */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync uint32_t xfer_rkey; /* access control to remote virtual address */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync uint32_t xfer_len; /* transfer length */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync uint32_t xfer_type; /* Read (0) or Write (1) */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync} xferinfo_t;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/*
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * the iscsiinfo_t is used to provide identifying information about
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * the target and the initiator and also some PDU level information
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * such as lun, data length and sequence numbers.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsynctypedef struct iscsiinfo {
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync string ii_target; /* target iqn */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync string ii_initiator; /* initiator iqn */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync string ii_isid; /* initiator session identifier */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync string ii_tsih; /* target session identifying handle */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync string ii_transport; /* transport type ("iser-ib", "sockets") */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync uint64_t ii_lun; /* target logical unit number */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync uint32_t ii_itt; /* initiator task tag */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync uint32_t ii_ttt; /* target transfer tag */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync uint32_t ii_cmdsn; /* command sequence number */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync uint32_t ii_statsn; /* status sequence number */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync uint32_t ii_datasn; /* data sequence number */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync uint32_t ii_datalen; /* length of data payload */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync uint32_t ii_flags; /* probe-specific flags */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync} iscsiinfo_t;