/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Generic Fibre Channel Library definitions
*/
/*
* I18N message number ranges
* This file: 19500 - 19999
* Shared common messages: 1 - 1999
*/
#ifndef _GFC_H
#define _GFC_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* Put your include files here
*/
/*
* keeps from actually including the contents of sys/fc4/fcal_linkapp.h
*/
#define _SYS_FC4_FCAL_LINKAPP_H
/* Defines */
/* Constants used by g_wwn_in_dev_list() */
#define MATCH_NODE_WWN 0
/*
* The masks defined below are for the Fibre channel transport and FCAs.
* Mask names starting with FC4 are for the non-fabric fibre channel driver
* stack and those starting with FC are for the fabric fibre channel driver
* stack.
*
* The transport values are represented in the low order 16 bits and FCA
* values represented in the high order 16 bits.
*
* The notation used is as shown below :
* (starting from the low order byte)
* Byte 1 - holds the non-fabric FC transport driver defines
* Byte 2 - holds the fabric FC transport driver defines
* Byte 3 - holds the non-fabric FC FCA defines
* Byte 4 - holds the fabric FC FCA defines
*/
/* Recognized Transport categories */
/* Transport masks */
/* Recognized Fibre Channel Adapters */
/* FCA masks */
/*
* Disk ports
*/
/* Constants used by g_set_port_state() */
#define PORT_OFFLINE 0
/* Constants used by g_loopback_mode() */
/* Constants for port state */
/* Extended pathinfo node states */
/*
* Error inq dtype for g_get_dev_list partial failure.
* choose E0 since Solaris has #define DTYPE_MASK 0x1F.
*/
/* Exported Variables */
extern uchar_t g_switch_to_alpa[];
extern uchar_t g_sf_alpa_to_switch[];
/* Exported Structures */
/* Device Map */
typedef struct al_rls {
} AL_rls;
/* Multi path list */
struct dlist {
char *dev_path;
char *logical_path;
};
/* Individual drive state */
typedef struct g_disk_state_struct {
} G_disk_state;
typedef struct hotplug_disk_list {
int tid;
int slot;
int dev_type;
int busy_flag;
int reserve_flag;
typedef struct l_inquiry_inq_2 {
} L_inq_2;
typedef struct l_inquiry_inq_3 {
} L_inq_3;
typedef struct l_inquiry_struct {
/*
* byte 0
*
* Bits 7-5 are the Peripheral Device Qualifier
* Bits 4-0 are the Peripheral Device Type
*
*/
/* byte 1 */
/* byte 2 */
/* byte 3 */
: 1, /* reserved */
/* bytes 4-7 */
union {
} ui;
/* bytes 8-35 */
/*
* Bytes 36-55 are vendor-specific parameter bytes
*/
/* SSA specific definitions */
/* bytes 36 - 39 */
/* bytes 40 - 51 */
/* bytes 52-53 */
/* byte 54, 55 */
/*
* Bytes 56-95 are reserved.
*/
/*
* 96 to 'n' are vendor-specific parameter bytes
*/
} L_inquiry;
typedef struct wwn_list_struct {
char *logical_path;
char *physical_path;
} WWN_list;
/* HBA port list */
typedef struct portlist {
int hbacnt;
} portlist_t;
/* union for capturing sf and fp strucures */
typedef union gfc_port_dev_u {
/* FC device sturcure with topology */
typedef struct gfc_port_dev_info {
/* strucure for FC map */
typedef struct gfc_map {
int count;
} gfc_map_t;
/* g_dev_map_init related declaration */
#define MAP_FORMAT_STANDARD 0
/* property name for g_dev_prop_lookup */
/* property type for g_dev_prop_next */
#define GFC_PROP_TYPE_BOOLEAN 0
typedef struct mp_pathinfo {
/* structure for mpxio pathlist */
typedef struct mp_pathlist {
/*
* Prototypes of Exported functions which are defined in libg_fc
* They are all CONTRACT PRIVATE
*/
#if defined(__STDC__)
extern int g_dev_start(char *, int);
extern int g_dev_stop(char *, struct wwn_list_struct *, int);
extern int g_force_lip(char *, int);
extern int g_forcelip_all(struct hotplug_disk_list *);
extern void g_free_multipath(struct dlist *);
extern void g_free_wwn_list(struct wwn_list_struct **);
extern int g_get_dev_map(char *, gfc_map_t *, int);
extern int g_get_lilp_map(char *, gfc_map_t *, int);
extern int g_get_dev_list(char *, fc_port_dev_t **, int *);
extern int g_wwn_in_dev_list(char *, la_wwn_t, int);
extern char *g_get_dev_or_bus_phys_name(char *);
extern char *g_get_errString(int);
extern int g_get_inquiry(char *, L_inquiry *);
extern int g_get_limited_map(char *, struct lilpmap *, int);
extern int g_get_multipath(char *, struct dlist **,
struct wwn_list_struct *, int);
extern int g_get_nexus_path(char *, char **);
extern char *g_get_physical_name_from_link(char *);
extern char *g_get_physical_name(char *);
extern int g_get_wwn_list(struct wwn_list_struct **, int);
extern int g_i18n_catopen(void);
extern int g_offline_drive(struct dlist *, int);
extern void g_online_drive(struct dlist *, int);
extern uint_t g_get_path_type(char *);
extern int g_get_host_params(char *, fc_port_dev_t *, int);
extern int g_port_offline(char *);
extern int g_port_online(char *);
extern int g_get_port_path(char *, portlist_t *);
extern void g_free_portlist(portlist_t *);
extern int g_loopback_mode(char *, int);
extern int g_get_port_state(char *, int *, int);
extern int g_get_fca_port_topology(char *, uint32_t *, int);
extern int g_dev_login(char *, la_wwn_t);
extern int g_dev_logout(char *, la_wwn_t);
extern int g_get_pathlist(char *, struct mp_pathlist *);
extern int g_failover(char *, char *);
/* g_dev_map_init related routines. */
extern gfc_dev_t g_dev_map_init(char *, int *, int);
extern void g_dev_map_fini(gfc_dev_t);
extern int g_dev_prop_lookup_bytes(gfc_dev_t, const char *, int *,
uchar_t **);
extern int g_dev_prop_lookup_ints(gfc_dev_t, const char *, int **);
extern int g_dev_prop_lookup_strings(gfc_dev_t, const char *, char **);
extern char *g_get_dev_prop_name(gfc_prop_t, int *);
extern int g_get_dev_prop_type(gfc_prop_t, int *);
extern int g_get_dev_prop_ints(gfc_prop_t, int **);
extern int g_get_dev_prop_strings(gfc_prop_t, char **);
extern int g_stms_path_disable(char *, char *);
extern int g_stms_path_enable(char *, char *);
extern int g_stms_path_disable_all(char *);
extern int g_stms_path_enable_all(char *);
extern int g_stms_get_path_state(char *, char *, int *, int *);
#else /* __STDC__ */
extern int g_dev_start();
extern int g_dev_stop();
extern int g_force_lip();
extern int g_forcelip_all();
extern void g_free_multipath();
extern void g_free_wwn_list();
extern int g_get_inq_dtype();
extern int g_get_dev_list();
extern int g_wwn_in_dev_list();
extern int g_get_dev_map();
extern int g_get_lilp_map();
extern char *g_get_dev_or_bus_phys_name();
extern char *g_get_errString();
extern int g_get_inquiry();
extern int g_get_serial_number();
extern int g_get_limited_map();
extern int g_get_multipath();
extern int g_get_nexus_path();
extern int g_get_wwn_list();
extern int g_offline_drive();
extern void g_online_drive();
extern char *g_get_physical_name();
extern char *g_get_physical_name_from_link();
extern int g_get_wwn();
extern int g_i18n_catopen();
extern int g_rdls();
extern uint_t g_get_path_type();
extern int g_get_host_params();
extern int g_port_offline();
extern int g_port_online();
extern int g_get_port_path();
extern void g_free_portlist();
extern int g_loopback_mode();
extern int g_get_port_state();
extern int g_get_fca_port_topology();
extern int g_dev_login();
extern int g_dev_logout();
extern int g_get_pathlist();
extern int g_failover();
/* g_dev_map_init related routines. */
extern gfc_dev_t g_dev_map_init();
extern void g_dev_map_fini();
extern int g_get_map_topology();
extern gfc_dev_t g_get_first_dev();
extern gfc_dev_t g_get_next_dev();
extern int g_dev_prop_lookup_bytes();
extern int g_dev_prop_lookup_ints();
extern int g_dev_prop_lookup_strings();
extern gfc_prop_t g_get_first_dev_prop();
extern gfc_prop_t g_get_next_dev_prop();
extern char *g_get_dev_prop_name();
extern int g_get_dev_prop_type();
extern int g_get_dev_prop_bytes();
extern int g_get_dev_prop_ints();
extern int g_get_dev_prop_strings();
extern int g_stms_path_disable();
extern int g_stms_path_enable();
extern int g_stms_path_disable_all();
extern int g_stms_path_enable_all();
extern int g_stms_get_path_state();
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* _GFC_H */