fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * or http://www.opensolaris.org/os/licensing.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifndef _FC_APPIF_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _FC_APPIF_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/note.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern "C" {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#if !defined(_BIT_FIELDS_LTOH) && !defined(_BIT_FIELDS_HTOL)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#error One of _BIT_FIELDS_LTOH or _BIT_FIELDS_HTOL must be defined
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _BIT_FIELDS_LTOH */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Local port topology definitions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fp/fctl use these a lot with the fp_topology field in the fc_port_t struct,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * but use is not limited to fp_topology. These are also understood by ULPs.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_TOP_UNKNOWN 0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_TOP_PRIVATE_LOOP 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_TOP_PUBLIC_LOOP 2
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_TOP_FABRIC 3
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_TOP_PT_PT 4
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_TOP_NO_NS 5
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Macros used with the preceeding topology #defines.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fp/fctl use these a lot with the fp_topology field in the fc_port_t struct,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * but use is not limited to fp_topology. These are also understood by ULPs.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_TOP_EXTERNAL(t) FC_IS_TOP_SWITCH(t)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_IS_TOP_SWITCH(t) (((t) == FC_TOP_FABRIC) ||\
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((t) == FC_TOP_PUBLIC_LOOP))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fc_remote_port state (map_state) definitions.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Used with the pd_state field in the fc_remote_port_t struct.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define PORT_DEVICE_INVALID 0 /* State when created or login failed */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define PORT_DEVICE_VALID 1 /* Logged out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define PORT_DEVICE_LOGGED_IN 2 /* Logged in */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Firmware, FCode revision field lengths
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_FCODE_REV_SIZE 25
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_FW_REV_SIZE 25
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct ct_header {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#if defined(_BIT_FIELDS_LTOH)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t ct_inid : 24, /* Initial Node ID */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ct_rev : 8; /* Revision */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t ct_reserved1 : 8,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ct_options : 8,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ct_fcssubtype : 8,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ct_fcstype : 8;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t ct_aiusize : 16,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ct_cmdrsp : 16;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t ct_vendor : 8,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ct_expln : 8,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ct_reason : 8,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ct_reserved2 : 8;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#else
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t ct_rev : 8, /* revision */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ct_inid : 24; /* initial node ID */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t ct_fcstype : 8, /* type of service */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ct_fcssubtype : 8, /* subtype of service */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ct_options : 8, /* options */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ct_reserved1 : 8; /* reserved */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t ct_cmdrsp : 16, /* command/response code */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ct_aiusize : 16; /* AIU/residual size */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t ct_reserved2 : 8, /* reserved */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ct_reason : 8, /* reason code */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ct_expln : 8, /* reason explanation */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ct_vendor : 8; /* vendor unique */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _BIT_FIELDS_LTOH */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} fc_ct_header_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* World Wide Name format */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef union la_wwn {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t raw_wwn[8];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t i_wwn[2];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#if defined(_BIT_FIELDS_LTOH)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t wwn_hi : 16,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte nport_id : 12,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte naa_id : 4;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t wwn_lo;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }w;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#else
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t naa_id : 4,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte nport_id : 12,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte wwn_hi : 16;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t wwn_lo;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }w;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _BIT_FIELDS_LTOH */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} la_wwn_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Values for naa_id
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NAA_ID_IEEE 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NAA_ID_IEEE_EXTENDED 2
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifndef FC_WWN_SIZE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_WWN_SIZE (sizeof (la_wwn_t))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* FC_WWN_SIZE */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct service_param {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t class_opt;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t initiator_ctl;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t recipient_ctl;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t rcv_size;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t conc_sequences;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t n_port_e_to_e_credit;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t open_seq_per_xchng;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t rsvd;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} svc_param_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct common_service {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t fcph_version;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t btob_credit;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t cmn_features;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t rx_bufsize;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t conc_sequences;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t relative_offset;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t e_d_tov;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} com_svc_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct ls_code {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#if defined(_BIT_FIELDS_LTOH)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t mbz : 24,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ls_code : 8;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#else
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t ls_code : 8,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte mbz : 24;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _BIT_FIELDS_LTOH */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} ls_code_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Login Payload. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct la_els_logi {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ls_code_t ls_code;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte com_svc_t common_service;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte la_wwn_t nport_ww_name;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte la_wwn_t node_ww_name;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte svc_param_t class_1;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte svc_param_t class_2;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte svc_param_t class_3;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t reserved[16];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t vendor_version[16];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} la_els_logi_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct fc_ns_cmd {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t ns_flags; /* for future use */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t ns_cmd; /* NS command type */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t ns_req_len;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte caddr_t ns_req_payload; /* No CT header */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t ns_resp_len;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte caddr_t ns_resp_payload; /* no CT header */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte void *ns_fctl_private; /* Transport private */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fc_ct_header_t ns_resp_hdr; /* for the curious */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} fc_ns_cmd_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#if defined(_SYSCALL32)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#pragma pack(4)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct la_els_logi32 {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ls_code_t ls_code;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte com_svc_t common_service;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte la_wwn_t nport_ww_name;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte la_wwn_t node_ww_name;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte svc_param_t class_1;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte svc_param_t class_2;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte svc_param_t class_3;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t reserved[16];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t vendor_version[16];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} la_els_logi32_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct fc_ns_cmd32 {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t ns_flags; /* for future use */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t ns_cmd; /* NS command type */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t ns_req_len;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte caddr_t ns_req_payload; /* No CT header */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t ns_resp_len;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte caddr_t ns_resp_payload; /* no CT header */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte void *ns_fctl_private; /* Transport private */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fc_ct_header_t ns_resp_hdr; /* for the curious */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} fc_ns_cmd32_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#pragma pack()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _SYSCALL32 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Link Error Parameters in the RLS Accept payload */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct fc_rls_acc_params {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t rls_link_fail; /* link failure count */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t rls_sync_loss; /* loss of sync count */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t rls_sig_loss; /* loss of signal count */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t rls_prim_seq_err; /* primitive seq error */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t rls_invalid_word; /* invalid tx word */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t rls_invalid_crc; /* invalid CRC count */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} fc_rls_acc_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* RLS Payload. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct la_els_rls {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ls_code_t ls_code;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fc_portid_t rls_portid; /* port identifier */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} la_els_rls_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* RLS accept payload */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct la_els_rls_acc {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ls_code_t ls_code;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fc_rls_acc_t rls_link_params; /* link error status block */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} la_els_rls_acc_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Node Id Parameters in the RNID Get/Set Accept/Request payload */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct fc_rnid_params {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t global_id[16]; /* global name */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t unit_type; /* unit type */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t port_id; /* port id */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t num_attached; /* number of attached nodes */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t ip_version; /* ip version */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t udp_port; /* udp port number */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t ip_addr[16]; /* ip address */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t specific_id_resv; /* reserved */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t topo_flags; /* topology discovery flags */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} fc_rnid_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* RNID get data format flag */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_CFLAGS_RNID_GET_GENERAL_TOPOLOGY 0xDF
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_CFLAGS_RNID_GET_VENDOR_SPECIFIC 0xE0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* RNID maximum data length - common data(16) + specific data(252) */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_RNID_MAX_DATA_LEN 268
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* RNID Payload. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct la_els_rnid {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ls_code_t ls_code;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t data_format; /* data format returned */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t resv[3];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} la_els_rnid_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ELS RNID header
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * - cmn_len can be 0 or 16 - if it is 0 then specific data starts at
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * offset 8 else specific data starts at offset 24 in the RNID els response
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct fc_rnid_hdr {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t data_format;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t cmn_len;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t resv;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t specific_len;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}fc_rnid_hdr_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct la_els_rnid_acc {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ls_code_t ls_code;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fc_rnid_hdr_t hdr;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t data[FCIO_RNID_MAX_DATA_LEN];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} la_els_rnid_acc_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct la_npiv_create_entry {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte la_wwn_t VNodeWWN;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte la_wwn_t VPortWWN;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t vindex;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} la_npiv_create_entry_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#if !defined(__lint)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte_NOTE(SCHEME_PROTECTS_DATA("unique per request", fc_ns_cmd))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte_NOTE(SCHEME_PROTECTS_DATA("unique per request", ct_header))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte_NOTE(SCHEME_PROTECTS_DATA("unique per request", la_els_logi))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte_NOTE(SCHEME_PROTECTS_DATA("unique per request", la_wwn))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte_NOTE(SCHEME_PROTECTS_DATA("unique per request", fc_rls_acc_params))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte_NOTE(SCHEME_PROTECTS_DATA("unique per request", la_els_rls))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte_NOTE(SCHEME_PROTECTS_DATA("unique per request", la_els_rls_acc))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte_NOTE(SCHEME_PROTECTS_DATA("unique per request", fc_rnid_params))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte_NOTE(SCHEME_PROTECTS_DATA("unique per request", la_els_rnid))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte_NOTE(SCHEME_PROTECTS_DATA("unique per request", la_els_rnid_acc))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* __lint */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _FC_APPIF_H */