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 _FCIO_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _FCIO_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/note.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/fibre-channel/fc_types.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/fibre-channel/fc_appif.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern "C" {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ioctl definitions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCTIO ('F'<< 8)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * New ioctl definitions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_CMD (FCTIO | 1998)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_SUB_CMD ('Z' << 8)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_GET_NUM_DEVS (FCIO_SUB_CMD + 0x01)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_GET_DEV_LIST (FCIO_SUB_CMD + 0x02)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_GET_SYM_PNAME (FCIO_SUB_CMD + 0x03)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_GET_SYM_NNAME (FCIO_SUB_CMD + 0x04)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_SET_SYM_PNAME (FCIO_SUB_CMD + 0x05)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_SET_SYM_NNAME (FCIO_SUB_CMD + 0x06)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_GET_LOGI_PARAMS (FCIO_SUB_CMD + 0x07)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_DEV_LOGIN (FCIO_SUB_CMD + 0x08)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_DEV_LOGOUT (FCIO_SUB_CMD + 0x09)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_GET_STATE (FCIO_SUB_CMD + 0x0A)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_DEV_REMOVE (FCIO_SUB_CMD + 0x0B)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_GET_FCODE_REV (FCIO_SUB_CMD + 0x0C)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_GET_FW_REV (FCIO_SUB_CMD + 0x0D)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_GET_DUMP_SIZE (FCIO_SUB_CMD + 0x0E)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_FORCE_DUMP (FCIO_SUB_CMD + 0x0F)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_GET_DUMP (FCIO_SUB_CMD + 0x10)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_GET_TOPOLOGY (FCIO_SUB_CMD + 0x11)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_RESET_LINK (FCIO_SUB_CMD + 0x12)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_RESET_HARD (FCIO_SUB_CMD + 0x13)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_RESET_HARD_CORE (FCIO_SUB_CMD + 0x14)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_DIAG (FCIO_SUB_CMD + 0x15)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_NS (FCIO_SUB_CMD + 0x16)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_DOWNLOAD_FW (FCIO_SUB_CMD + 0x17)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_GET_HOST_PARAMS (FCIO_SUB_CMD + 0x18)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_LINK_STATUS (FCIO_SUB_CMD + 0x19)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_DOWNLOAD_FCODE (FCIO_SUB_CMD + 0x1A)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_GET_NODE_ID (FCIO_SUB_CMD + 0x1B)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_SET_NODE_ID (FCIO_SUB_CMD + 0x1C)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_SEND_NODE_ID (FCIO_SUB_CMD + 0x1D)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * IOCTLs to handle T11's FC-HBA library
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_GET_ADAPTER_ATTRIBUTES (FCIO_SUB_CMD + 0x1E)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_GET_OTHER_ADAPTER_PORTS (FCIO_SUB_CMD + 0x1F)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_GET_ADAPTER_PORT_ATTRIBUTES (FCIO_SUB_CMD + 0x20)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_GET_DISCOVERED_PORT_ATTRIBUTES (FCIO_SUB_CMD + 0x21)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_GET_PORT_ATTRIBUTES (FCIO_SUB_CMD + 0x22)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_GET_ADAPTER_PORT_STATS (FCIO_SUB_CMD + 0x23)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_GET_ADAPTER_PORT_NPIV_ATTRIBUTES (FCIO_SUB_CMD + 0x24)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_CREATE_NPIV_PORT (FCIO_SUB_CMD + 0x25)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_GET_NPIV_ATTRIBUTES (FCIO_SUB_CMD + 0x26)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_GET_DISCOVERED_NPIV_ATTRIBUTES (FCIO_SUB_CMD + 0x27)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_GET_NPIV_PORT_LIST (FCIO_SUB_CMD + 0x28)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_DELETE_NPIV_PORT (FCIO_SUB_CMD + 0x29)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_NPIV_GET_ADAPTER_ATTRIBUTES (FCIO_SUB_CMD + 0x2a)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Fixed diag_codes for FCIO_DIAG. These is supported by all FCAs.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * No FCA should define ioctls in this range.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_DIAG_PORT_DISABLE (FCIO_SUB_CMD + 0x80)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_DIAG_PORT_ENABLE (FCIO_SUB_CMD + 0x81)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* cmd_flags for FCIO_LINK_STATUS ioctl */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_CFLAGS_RLS_DEST_NPORT 0x0000
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_CFLAGS_RLS_DEST_FPORT 0x0001
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Note about fc_port_dev_t structure : The dev_did.priv_lilp_posit field will
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * return the lilp map position of the port for diagnostics to use.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * It is important to note that dev_did.priv_lilp_posit field will only have
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * valid loop position for Private Loop devices ONLY and the value
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * contained in this field for other topologies will be undetermined.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct fc_port_dev {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t dev_dtype; /* SCSI device type */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t dev_type[8]; /* protocol specific */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t dev_state; /* port state */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fc_portid_t dev_did; /* Destination Identifier */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fc_hardaddr_t dev_hard_addr; /* Hard address */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte la_wwn_t dev_pwwn; /* port WWN */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte la_wwn_t dev_nwwn; /* node WWN */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} fc_port_dev_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 fc_port_dev32 {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t dev_dtype; /* SCSI device type */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t dev_type[8]; /* protocol specific */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t dev_state; /* port state */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fc_portid_t dev_did; /* Destination Identifier */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fc_hardaddr_t dev_hard_addr; /* Hard address */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte la_wwn_t dev_pwwn; /* port WWN */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte la_wwn_t dev_nwwn; /* node WWN */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} fc_port_dev32_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 Fortetypedef struct fc_port_dev fc_ns_map_entry_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fcio_xfer definitions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_XFER_NONE 0x00
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_XFER_READ 0x01
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_XFER_WRITE 0x02
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCIO_XFER_RW (FCIO_XFER_READ | FCIO_XFER_WRITE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct fcio {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t fcio_xfer; /* direction */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t fcio_cmd; /* sub command */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t fcio_flags; /* flags */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t fcio_cmd_flags; /* command specific flags */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte size_t fcio_ilen; /* Input buffer length */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte caddr_t fcio_ibuf; /* Input buffer */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte size_t fcio_olen; /* Output buffer length */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte caddr_t fcio_obuf; /* Output buffer */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte size_t fcio_alen; /* Auxillary buffer length */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte caddr_t fcio_abuf; /* Auxillary buffer */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int fcio_errno; /* FC internal error code */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} fcio_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * T11 FC-HBA exchange structures
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_LIST_VERSION 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct fc_hba_list {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t version; /* Set to FC_HBA_LIST_VERSION */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t numAdapters;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t reserved;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char hbaPaths[1][MAXPATHLEN]; /* numAdapters long */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} fc_hba_list_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_NPIV_PORT_LIST_VERSION 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct fc_hba_npiv_port_list {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t version;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t numAdapters;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t reserved;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char hbaPaths[1][MAXPATHLEN];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} fc_hba_npiv_port_list_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_NPIV_ATTRIBUTES_VERSION 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct fc_hba_npiv_attributes {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t version;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte la_wwn_t NodeWWN;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte la_wwn_t PortWWN;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fc_hba_state_change_t lastChange;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} fc_hba_npiv_attributes_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_PORT_NPIV_ATTRIBUTES_VERSION 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct fc_hba_port_npiv_attributes {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t version;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int npivflag;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fc_hba_state_change_t lastChange;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte la_wwn_t NodeWWN;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte la_wwn_t PortWWN;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t MaxNumberOfNPIVPorts;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t NumberOfNPIVPorts;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} fc_hba_port_npiv_attributes_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_SINGLE_VERSION 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct fc_hba_single {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t version; /* Set to FC_HBA_SINGLE_VERSION */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t reserved;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char hbaPath[MAXPATHLEN];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} fc_hba_single_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_ADAPTER_ATTRIBUTES_VERSION 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct fc_hba_adapter_attributes {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t version; /* Set to FC_HBA_ADAPTER_ATTRIBUTES_VERSION */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char Manufacturer[64];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char SerialNumber[64];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char Model[256];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char ModelDescription[256];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte la_wwn_t NodeWWN;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char NodeSymbolicName[256];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char HardwareVersion[256];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char DriverVersion[256];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char OptionROMVersion[256];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char FirmwareVersion[256];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t VendorSpecificID;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t NumberOfPorts;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char DriverName[256];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t reserved;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} fc_hba_adapter_attributes_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 fc_hba_adapter_attributes32 {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t version; /* Set to FC_HBA_ADAPTER_ATTRIBUTES_VERSION */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char Manufacturer[64];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char SerialNumber[64];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char Model[256];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char ModelDescription[256];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte la_wwn_t NodeWWN;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char NodeSymbolicName[256];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char HardwareVersion[256];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char DriverVersion[256];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char OptionROMVersion[256];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char FirmwareVersion[256];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t VendorSpecificID;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t NumberOfPorts;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char DriverName[256];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t reserved;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} fc_hba_adapter_attributes32_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 /* defined(_SYSCALL32) */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_PORT_ATTRIBUTES_VERSION 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct fc_hba_port_attributes {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t version; /* FC_HBA_PORT_ATTRIBUTES_VERSION */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fc_hba_state_change_t lastChange;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte minor_t fp_minor;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte la_wwn_t NodeWWN;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte la_wwn_t PortWWN;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t PortFcId;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t PortType;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t PortState;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t PortSupportedClassofService;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t PortSupportedFc4Types[32];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t PortActiveFc4Types[32];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char PortSymbolicName[256];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t PortSupportedSpeed;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t PortSpeed;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t PortMaxFrameSize;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte la_wwn_t FabricName;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t NumberofDiscoveredPorts;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t reserved;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} fc_hba_port_attributes_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 fc_hba_port_attributes32 {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t version; /* FC_HBA_PORT_ATTRIBUTES_VERSION */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fc_hba_state_change_t lastChange;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte minor_t fp_minor;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte la_wwn_t NodeWWN;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte la_wwn_t PortWWN;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t PortFcId;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t PortType;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t PortState;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t PortSupportedClassofService;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t PortSupportedFc4Types[32];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t PortActiveFc4Types[32];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char PortSymbolicName[256];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t PortSupportedSpeed;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t PortSpeed;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t PortMaxFrameSize;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte la_wwn_t FabricName;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t NumberofDiscoveredPorts;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t reserved;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} fc_hba_port_attributes32_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 /* defined(_SYSCALL32) */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_ADAPTER_PORT_STATS_VERSION 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct fc_hba_adapter_port_stats {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t version; /* FC_HBA_ADAPTER_PORT_STATS_VERSION */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t SecondsSinceLastReset;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t TxFrames;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t TxWords;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t RxFrames;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t RxWords;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t LIPCount;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t NOSCount;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t ErrorFrames;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t DumpedFrames;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t LinkFailureCount;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t LossOfSyncCount;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t LossOfSignalCount;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t PrimitiveSeqProtocolErrCount;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t InvalidTxWordCount;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t InvalidCRCCount;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint64_t reserved;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} fc_hba_adapter_port_stats_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Constant values derived from T11 FC-HBA
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_PORTTYPE_UNKNOWN 1 /* Unknown */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_PORTTYPE_OTHER 2 /* Other */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_PORTTYPE_NOTPRESENT 3 /* Not present */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_PORTTYPE_NPORT 5 /* Fabric */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_PORTTYPE_NLPORT 6 /* Public Loop */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_PORTTYPE_FLPORT 7
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_PORTTYPE_FPORT 8 /* Fabric Port */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_PORTTYPE_EPORT 9 /* Fabric expansion port */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_PORTTYPE_GPORT 10 /* Generic Fabric Port */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_PORTTYPE_LPORT 20 /* Private Loop */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_PORTTYPE_PTP 21 /* Point to Point */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_PORTSTATE_UNKNOWN 1 /* Unknown */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_PORTSTATE_ONLINE 2 /* Operational */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_PORTSTATE_OFFLINE 3 /* User Offline */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_PORTSTATE_BYPASSED 4 /* Bypassed */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_PORTSTATE_DIAGNOSTICS 5 /* In diagnostics mode */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_PORTSTATE_LINKDOWN 6 /* Link Down */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_PORTSTATE_ERROR 7 /* Port Error */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FC_HBA_PORTSTATE_LOOPBACK 8 /* Loopback */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#if defined(_SYSCALL32)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 32 bit varient of fcio_t; to be used
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * only in the driver and NOT applications
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestruct fcio32 {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t fcio_xfer; /* direction */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t fcio_cmd; /* sub command */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t fcio_flags; /* flags */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t fcio_cmd_flags; /* command specific flags */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte size32_t fcio_ilen; /* Input buffer length */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte caddr32_t fcio_ibuf; /* Input buffer */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte size32_t fcio_olen; /* Output buffer length */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte caddr32_t fcio_obuf; /* Output buffer */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte size32_t fcio_alen; /* Auxillary buffer length */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte caddr32_t fcio_abuf; /* Auxillary buffer */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int fcio_errno; /* FC internal error code */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte};
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#if !defined(__lint)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte_NOTE(SCHEME_PROTECTS_DATA("unique per request", fcio32))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* __lint */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _SYSCALL32 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#if !defined(__lint)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte_NOTE(SCHEME_PROTECTS_DATA("unique per request", fcio fc_port_dev))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* __lint */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _FCIO_H */