scsi.d revision a668b114487acbb725f522170849c39f8e844673
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer/*
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer * CDDL HEADER START
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer *
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer * The contents of this file are subject to the terms of the
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer * Common Development and Distribution License (the "License").
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer * You may not use this file except in compliance with the License.
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer *
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer * or http://www.opensolaris.org/os/licensing.
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer * See the License for the specific language governing permissions
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer * and limitations under the License.
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer *
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer * When distributing Covered Code, include this CDDL HEADER in each
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer * If applicable, add the following below this CDDL HEADER, with the
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer * fields enclosed by brackets "[]" replaced with your own identifying
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer * information: Portions Copyright [yyyy] [name of copyright owner]
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer *
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer * CDDL HEADER END
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer */
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer/*
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer * Use is subject to license terms.
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer */
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer
072f7b9522733fc23a3cd4622f84ee4b2f17115cSam Cramer#pragma D depends_on module genunix
072f7b9522733fc23a3cd4622f84ee4b2f17115cSam Cramer#pragma D depends_on module stmf
072f7b9522733fc23a3cd4622f84ee4b2f17115cSam Cramer
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer/*
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer * The scsicmd_t structure should be used by providers
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer * to represent a SCSI command block (cdb).
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer */
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramertypedef struct scsicmd {
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer uint64_t ic_len; /* CDB length */
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer uint8_t *ic_cdb; /* CDB data */
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer} scsicmd_t;
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer/*
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer * Translator for scsicmd_t, translating from a scsi_task_t
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer */
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer#pragma D binding "1.5" translator
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramertranslator scsicmd_t < scsi_task_t *T > {
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer ic_len = T->task_cdb_length;
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer ic_cdb = T->task_cdb;
d8c54e3d070f57cc1b4d6c8262f0868219c8ce7cSam Cramer};
a668b114487acbb725f522170849c39f8e844673Priya Krishnan
a668b114487acbb725f522170849c39f8e844673Priya Krishnan/*
a668b114487acbb725f522170849c39f8e844673Priya Krishnan * The xferinfo_t structure can be used by providers to
a668b114487acbb725f522170849c39f8e844673Priya Krishnan * represent transfer information related to a single
a668b114487acbb725f522170849c39f8e844673Priya Krishnan * buffer. The members describing the remote memory
a668b114487acbb725f522170849c39f8e844673Priya Krishnan * are only valid if the transport layer is an RDMA-
a668b114487acbb725f522170849c39f8e844673Priya Krishnan * capable transport like Infiniband
a668b114487acbb725f522170849c39f8e844673Priya Krishnan */
a668b114487acbb725f522170849c39f8e844673Priya Krishnantypedef struct xferinfo {
a668b114487acbb725f522170849c39f8e844673Priya Krishnan uintptr_t xfer_laddr; /* local buffer address */
a668b114487acbb725f522170849c39f8e844673Priya Krishnan uint32_t xfer_loffset;
a668b114487acbb725f522170849c39f8e844673Priya Krishnan uint32_t xfer_lkey; /* access control to local memory */
a668b114487acbb725f522170849c39f8e844673Priya Krishnan uintptr_t xfer_raddr; /* remote virtual address */
a668b114487acbb725f522170849c39f8e844673Priya Krishnan uint32_t xfer_roffset; /* offset from the remote address */
a668b114487acbb725f522170849c39f8e844673Priya Krishnan uint32_t xfer_rkey; /* access control to remote virtual address */
a668b114487acbb725f522170849c39f8e844673Priya Krishnan uint32_t xfer_len; /* transfer length */
a668b114487acbb725f522170849c39f8e844673Priya Krishnan uint32_t xfer_type; /* Read (0) or Write (1) */
a668b114487acbb725f522170849c39f8e844673Priya Krishnan} xferinfo_t;