fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
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 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
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 * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Generic Fibre Channel Library definitions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * I18N message number ranges
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * This file: 19500 - 19999
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Shared common messages: 1 - 1999
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Put your include files here
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * sys/fc4/fcio.h includes sys/fc4/fcal_linkapp.h. The following #define
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * keeps from actually including the contents of sys/fc4/fcal_linkapp.h
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * since that file contains the same structure definitions as sys/fc4/fcio.h.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Defines */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Constants used by g_wwn_in_dev_list() */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The masks defined below are for the Fibre channel transport and FCAs.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Mask names starting with FC4 are for the non-fabric fibre channel driver
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * stack and those starting with FC are for the fabric fibre channel driver
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The transport values are represented in the low order 16 bits and FCA
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * values represented in the high order 16 bits.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The notation used is as shown below :
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * (starting from the low order byte)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Byte 1 - holds the non-fabric FC transport driver defines
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Byte 2 - holds the fabric FC transport driver defines
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Byte 3 - holds the non-fabric FC FCA defines
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Byte 4 - holds the fabric FC FCA defines
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Recognized Transport categories */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Transport masks */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define XPORT_MASK (FC_XPORT_MASK | FC4_XPORT_MASK)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Recognized Fibre Channel Adapters */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* FCA masks */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Disk ports
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Constants used by g_set_port_state() */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Constants used by g_loopback_mode() */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Constants for port state */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Extended pathinfo node states */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define MDI_PATHINFO_STATE_USER_DISABLE 0x00100000
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define MDI_PATHINFO_STATE_DRV_DISABLE_TRANSIENT 0x00400000
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Error inq dtype for g_get_dev_list partial failure.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * choose E0 since Solaris has #define DTYPE_MASK 0x1F.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Exported Variables */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Exported Structures */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Device Map */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Multi path list */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Individual drive state */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char physical_path[MAXNAMELEN]; /* First one found */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char node_wwn_s[WWN_S_LEN]; /* NULL terminated str */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char port_a_wwn_s[WWN_S_LEN]; /* NULL terminated string */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char port_b_wwn_s[WWN_S_LEN]; /* NULL terminated string */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t inq_2_reladdr : 1, /* relative addressing */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t inq_3_reladdr : 1, /* relative addressing */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Bits 7-5 are the Peripheral Device Qualifier
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Bits 4-0 are the Peripheral Device Type
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* byte 1 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* byte 2 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* byte 3 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t inq_aenc : 1, /* async event notification cap. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte inq_trmiop : 1, /* supports TERMINATE I/O PROC msg */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* bytes 4-7 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* bytes 8-35 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t inq_revision[4]; /* product revision level */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Bytes 36-55 are vendor-specific parameter bytes
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* SSA specific definitions */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* bytes 36 - 39 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t inq_firmware_rev[4]; /* firmware revision level */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* bytes 40 - 51 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t inq_serial[12]; /* serial number, not used any more */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* bytes 52-53 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* byte 54, 55 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Bytes 56-95 are reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 96 to 'n' are vendor-specific parameter bytes
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char node_wwn_s[WWN_S_LEN]; /* NULL terminated string */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char port_wwn_s[WWN_S_LEN]; /* NULL terminated string */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t device_type; /* disk or tape (Peripheral Device Type) */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* HBA port list */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* union for capturing sf and fp strucures */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* FC device sturcure with topology */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* strucure for FC map */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* g_dev_map_init related declaration */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef void *gfc_dev_t; /* opaque type for map device */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef void *gfc_prop_t; /* opaque type for map device property */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* property name for g_dev_prop_lookup */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* property type for g_dev_prop_next */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* structure for mpxio pathlist */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Prototypes of Exported functions which are defined in libg_fc
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * They are all CONTRACT PRIVATE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_dev_start(char *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_dev_stop(char *, struct wwn_list_struct *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_force_lip(char *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_forcelip_all(struct hotplug_disk_list *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern void g_free_wwn_list(struct wwn_list_struct **);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_get_dev_map(char *, gfc_map_t *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_get_lilp_map(char *, gfc_map_t *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_get_inq_dtype(char *, la_wwn_t, uchar_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_get_dev_list(char *, fc_port_dev_t **, int *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_wwn_in_dev_list(char *, la_wwn_t, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern char *g_get_dev_or_bus_phys_name(char *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern char *g_get_errString(int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_get_serial_number(char *, uchar_t *, size_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_get_limited_map(char *, struct lilpmap *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_get_multipath(char *, struct dlist **,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct wwn_list_struct *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_get_nexus_path(char *, char **);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern char *g_get_physical_name_from_link(char *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern char *g_get_physical_name(char *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_get_wwn(char *, uchar_t *, uchar_t *, int *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_get_wwn_list(struct wwn_list_struct **, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_i18n_catopen(void);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_get_host_params(char *, fc_port_dev_t *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_port_offline(char *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_port_online(char *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_loopback_mode(char *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_get_port_state(char *, int *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_get_fca_port_topology(char *, uint32_t *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_get_pathlist(char *, struct mp_pathlist *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_failover(char *, char *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* g_dev_map_init related routines. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern gfc_dev_t g_dev_map_init(char *, int *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_get_map_topology(gfc_dev_t, uint_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern gfc_dev_t g_get_first_dev(gfc_dev_t, int *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern gfc_dev_t g_get_next_dev(gfc_dev_t, int *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_dev_prop_lookup_bytes(gfc_dev_t, const char *, int *,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_dev_prop_lookup_ints(gfc_dev_t, const char *, int **);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_dev_prop_lookup_strings(gfc_dev_t, const char *, char **);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern gfc_prop_t g_get_first_dev_prop(gfc_dev_t, int *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern gfc_prop_t g_get_next_dev_prop(gfc_prop_t, int *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern char *g_get_dev_prop_name(gfc_prop_t, int *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_get_dev_prop_type(gfc_prop_t, int *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_get_dev_prop_bytes(gfc_prop_t, int *, uchar_t **);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_get_dev_prop_ints(gfc_prop_t, int **);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_get_dev_prop_strings(gfc_prop_t, char **);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_stms_path_disable(char *, char *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_stms_path_enable(char *, char *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_stms_path_disable_all(char *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_stms_path_enable_all(char *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_stms_get_path_state(char *, char *, int *, int *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#else /* __STDC__ */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int g_rdls();
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* g_dev_map_init related routines. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* __STDC__ */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _GFC_H */