2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A
2N/A/*
2N/A * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
2N/A * Use is subject to license terms.
2N/A */
2N/A
2N/A#pragma D depends_on library net.d
2N/A#pragma D depends_on library scsi.d
2N/A#pragma D depends_on module genunix
2N/A#pragma D depends_on module srpt
2N/A
2N/Atypedef struct srp_portinfo {
2N/A /* initiator */
2N/A string pi_initiator; /* Initiator: eui.xxxxxxxxxxxxxxx */
2N/A string pi_i_sid; /* Initiator session id */
2N/A
2N/A /* target */
2N/A string pi_target; /* Target: eui.xxxxxxxxxxxxxxx */
2N/A string pi_t_sid; /* Target session id */
2N/A
2N/A uintptr_t pi_chan_id; /* Channel identifier */
2N/A} srp_portinfo_t;
2N/A
2N/A#pragma D binding "1.5" translator
2N/Atranslator conninfo_t < srpt_session_t *P > {
2N/A ci_local = P->ss_t_gid;
2N/A ci_remote = P->ss_i_gid;
2N/A ci_protocol = "ib";
2N/A};
2N/A
2N/A#pragma D binding "1.5" translator
2N/Atranslator srp_portinfo_t < srpt_session_t *P > {
2N/A pi_initiator = P->ss_i_name;
2N/A pi_i_sid = P->ss_i_alias;
2N/A pi_target = P->ss_t_name;
2N/A pi_t_sid = P->ss_t_alias;
2N/A pi_chan_id = 0;
2N/A};
2N/A
2N/A#pragma D binding "1.5" translator
2N/Atranslator conninfo_t < srpt_channel_t *P > {
2N/A ci_local = P->ch_session->ss_i_gid;
2N/A ci_remote = P->ch_session->ss_t_gid;
2N/A};
2N/A
2N/A#pragma D binding "1.5" translator
2N/Atranslator srp_portinfo_t < srpt_channel_t *P > {
2N/A pi_initiator = P->ch_session->ss_i_name;
2N/A pi_i_sid = P->ch_session->ss_i_alias;
2N/A pi_target = P->ch_session->ss_t_name;
2N/A pi_t_sid = P->ch_session->ss_t_alias;
2N/A pi_chan_id = (uintptr_t)P->ch_chan_hdl;
2N/A};
2N/A
2N/Atypedef struct srp_logininfo {
2N/A uint64_t li_task_tag; /* SRP task tag */
2N/A uint32_t li_max_it_iu_len; /* Maximum iu length that initiator can
2N/A send to target */
2N/A uint32_t li_max_ti_iu_len; /* Maximum iu length that target can
2N/A send to initiator */
2N/A uint32_t li_request_limit; /* Maximun number of SRP requests
2N/A that initiator can send on a channel */
2N/A uint32_t li_reason_code; /* Reason code */
2N/A} srp_logininfo_t;
2N/A
2N/A#pragma D binding "1.5" translator
2N/Atranslator srp_logininfo_t < srp_login_req_t *P > {
2N/A li_task_tag = P->lreq_tag;
2N/A li_max_it_iu_len = ntohl(P->lreq_req_it_iu_len);
2N/A li_max_ti_iu_len = 0;
2N/A li_request_limit = 0;
2N/A li_reason_code = 0;
2N/A};
2N/A
2N/A#pragma D binding "1.5" translator
2N/Atranslator srp_logininfo_t < srp_login_rsp_t *P > {
2N/A li_task_tag = P->lrsp_tag;
2N/A li_max_it_iu_len = ntohl(P->lrsp_max_it_iu_len);
2N/A li_max_ti_iu_len = ntohl(P->lrsp_max_ti_iu_len);
2N/A li_request_limit = ntohl(P->lrsp_req_limit_delta);
2N/A li_reason_code = ntohl(((srp_login_rej_t *)arg2)->lrej_reason);
2N/A};
2N/A
2N/Atypedef struct srp_taskinfo {
2N/A uint64_t ti_task_tag; /* SRP task tag */
2N/A uint64_t ti_lun; /* Target logical unit number */
2N/A uint8_t ti_function; /* Task management function */
2N/A uint32_t ti_req_limit_delta; /* Increment of channel's request limit */
2N/A uint8_t ti_flag; /* bit 2: DOOVER */
2N/A /* bit 3: DOUNDER */
2N/A /* bit 4: DIOVER */
2N/A /* bit 5: DIUNDER */
2N/A uint32_t ti_do_resid_cnt; /* Data-out residual count */
2N/A uint32_t ti_di_resid_cnt; /* Data-in residual count */
2N/A uint8_t ti_status; /* Status of this task */
2N/A} srp_taskinfo_t;
2N/A
2N/A#pragma D binding "1.5" translator
2N/Atranslator srp_taskinfo_t < srp_cmd_req_t *P > {
2N/A ti_task_tag = P->cr_tag;
2N/A ti_lun = (ntohl(*((uint32_t *)P->cr_lun)) << 32) +
2N/A ntohl(*((uint32_t *)&P->cr_lun[4]));
2N/A ti_function = P->cr_type == 1 ? /* 1: MGMT CMD 2: SRP CMD */
2N/A ((srp_tsk_mgmt_t *)P)->tm_function : 0;
2N/A ti_req_limit_delta = 0;
2N/A ti_flag = 0;
2N/A ti_do_resid_cnt = 0;
2N/A ti_di_resid_cnt = 0;
2N/A ti_status = 0;
2N/A};
2N/A
2N/A#pragma D binding "1.5" translator
2N/Atranslator srp_taskinfo_t < srp_rsp_t *P > {
2N/A ti_task_tag = P->rsp_tag;
2N/A ti_lun = ntohll(*(uint64_t *)((scsi_task_t *)arg2)->task_lun_no);
2N/A ti_function = ((scsi_task_t *)arg2)->task_mgmt_function;
2N/A ti_req_limit_delta = ntohl(P->rsp_req_limit_delta);
2N/A ti_flag = P->rsp_flags;
2N/A ti_do_resid_cnt = ntohl(P->rsp_do_resid_cnt);
2N/A ti_di_resid_cnt = ntohl(P->rsp_di_resid_cnt);
2N/A ti_status = arg3;
2N/A};
2N/A
2N/A#pragma D binding "1.5" translator
2N/Atranslator srp_taskinfo_t < srpt_iu_t *P > {
2N/A ti_task_tag = P->iu_tag;
2N/A ti_lun = ntohll(*(uint64_t *)P->iu_stmf_task->task_lun_no);
2N/A ti_function = 0;
2N/A ti_req_limit_delta = 0;
2N/A ti_flag = 0;
2N/A ti_do_resid_cnt = 0;
2N/A ti_di_resid_cnt = 0;
2N/A ti_status = 0;
2N/A};
2N/A
2N/A#pragma D binding "1.5" translator
2N/Atranslator xferinfo_t < ibt_wr_ds_t *P > {
2N/A xfer_laddr = P->ds_va + arg4;
2N/A xfer_lkey = P->ds_key;
2N/A xfer_raddr = (arg3 == 0) ? 0 :
2N/A ((ibt_send_wr_t *)arg3)->wr.rc.rcwr.rdma.rdma_raddr;
2N/A xfer_rkey = (arg3 == 0) ? 0 :
2N/A ((ibt_send_wr_t *)arg3)->wr.rc.rcwr.rdma.rdma_rkey;
2N/A xfer_len = arg4;
2N/A xfer_loffset = arg5;
2N/A xfer_roffset = arg6;
2N/A xfer_type = arg7;
2N/A};