/*
* 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.
*/
#ifndef _G_STATE_H
#define _G_STATE_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* Include any headers you depend on.
*/
/*
* I18N message number ranges
* This file: 19000 - 19499
* Shared common messages: 1 - 1999
*/
#include <libdevice.h>
/*
* keeps from actually including the contents of sys/fc4/fcal_linkapp.h
*/
#define _SYS_FC4_FCAL_LINKAPP_H
#include <g_scsi.h>
#include <libnvpair.h>
#include <libdevinfo.h>
#include <gfc.h>
/* hotplug defines */
#define NON_SENA 0
/* format parameters to dump() */
/* Persistent Reservation */
/* Max number of retries */
/* Wait times in microseconds */
/* Defines for VS inq_port field on standard page (bit 5 Byte 6 */
/*
* Macro for deallocating memory pointed by dev_addr pointer
* of gfc_map_t structure.
* It is defined here to make available at any place from
* luxadm, liba5k and libg_fc.
*
* Note: The macro will try to free any non-NULL dev_addr.
* So, dev_addr ptr needs to be initialized to NULL.
*
* map.dev_addr = (gfc_port_dev_info_t *)NULL
* map->dev_addr = (gfc_port_dev_info_t *)NULL.
*/
}
/* Constants and macros used by the g_get_path_type() function */
/* Can do a strlen and generalize */
/* but this is is easier */
/* Defines for minor names used to append to devfs paths */
/* Defines for ssd driver name passed to root tree search routines */
/*
* Property names
*/
typedef struct read_keys_struct {
int rk_generation;
int rk_length;
} Read_keys;
typedef struct read_reserv_struct {
int rr_generation;
int rr_length;
} Read_reserv;
/*
* mplist structure typedef to support multipath
*/
typedef struct mplist_struct {
char *devpath;
} Mplist;
/* wwn_list_found to track previous calls to g_get_wwn */
typedef struct wwn_list_found_struct {
/* Function prototyes defined for libg_fc modules */
/* genf.c */
extern void *g_zalloc(int);
extern char *g_alloc_string(char *);
extern void g_destroy_data(void *);
extern int g_object_open(char *, int);
extern char *g_scsi_find_command_name(int);
extern void g_scsi_printerr(struct uscsi_cmd *,
struct scsi_extended_sense *, int, char msg_string[], char *);
extern int g_get_machineArch(int *);
extern boolean_t g_enclDiskChk(char *, char *);
/* hot.c */
extern void g_ll_to_str(uchar_t *, char *);
extern void g_free_hotplug_dlist(struct hotplug_disk_list **);
/* map.c */
extern int g_get_perf_statistics(char *, uchar_t *);
extern int g_get_port_multipath(char *, struct dlist **, int);
extern int g_device_in_map(gfc_map_t *, int);
extern int g_start(char *);
extern int g_stop(char *, int);
extern int g_reserve(char *);
extern int g_release(char *);
extern int g_issue_fcio_ioctl(int, fcio_t *, int);
extern void g_sort_wwn_list(struct wwn_list_struct **);
extern void g_free_wwn_list_found(struct wwn_list_found_struct **);
/* cmd.c */
/* io.c */
extern int g_scsi_send_diag_cmd(int, uchar_t *, int);
extern int g_scsi_writebuffer_cmd(int, int, uchar_t *, int, int, int);
extern int g_scsi_readbuffer_cmd(int, uchar_t *, int, int);
extern int g_scsi_inquiry_cmd(int, uchar_t *, int);
extern int g_scsi_read_capacity_cmd(int, uchar_t *, int);
extern int g_scsi_read_capacity_1016_cmd(int, struct scsi_capacity_16 *,
int);
extern int g_scsi_release_cmd(int);
extern int g_scsi_reserve_cmd(int);
extern int g_scsi_start_cmd(int);
extern int g_scsi_stop_cmd(int, int);
extern int g_scsi_tur(int);
extern int g_scsi_reset(int);
const char *);
/* mpath.c */
extern int g_get_lun_str(char *, char *, int);
extern int g_get_lun_number(char *);
extern int g_get_pathcount(char *);
extern int g_devices_get_all(struct wwn_list_struct **);
#ifdef __cplusplus
}
#endif
#endif /* _G_STATE_H */