devid_cache.h revision 83c4dfe9546fd839e7a52bca7e9920da918f916e
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_DEVID_CACHE_H
#define _SYS_DEVID_CACHE_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* The top-level nvpair identifiers in the
* /etc/devices/devid_cache nvlist format
*/
#define DP_DEVID_ID "devid"
#ifdef _KERNEL
/* devid-specific list element */
typedef struct nvp_devid {
int nvp_flags;
char *nvp_devpath;
} nvp_devid_t;
/*
* nvp_flags - devid
*/
/*
* tunables - see devid_cache.c for more details
*/
extern int devid_discovery_boot;
extern int devid_discovery_postboot;
extern int devid_discovery_postboot_always;
extern int devid_discovery_secs;
extern int devid_cache_read_disable;
extern int devid_cache_write_disable;
/*
* More thorough error reporting available both debug &
* non-debug kernels, but turned off by default.
*/
extern int devid_report_error; /* devid cache operations */
/*
* function prototypes
*/
static void devid_list_free(nvf_handle_t);
#ifdef DEBUG
#define NVP_DEVID_DEBUG_PATH(arg) { \
if (nvp_devid_debug) \
}
#define NVP_DEVID_DEBUG_DEVID(arg) { \
if (nvp_devid_debug) { \
ddi_devid_str_free(ds); \
} \
}
static void devid_log(char *, ddi_devid_t, char *);
#else
#define DEVID_DEBUG(args)
#define DEVID_DEBUG1(args)
#define DEVID_DEBUG2(args)
#define DEVID_DUMP(args)
#define DEVID_LOG_REG(args)
#define DEVID_LOG_FIND(args)
#define DEVID_LOG_LOOKUP(args)
#define DEVID_LOG_MATCH(args)
#define DEVID_LOG_PATHS(args)
#define DEVID_LOG_ERR(args)
#define DEVID_LOG_DISC(args)
#define DEVID_LOG_HOLD(args)
#define DEVID_LOG_UNREG(args)
#define DEVID_LOG_REMOVE(args)
#define DEVID_LOG_STALE(args)
#define DEVID_LOG_DETACH(args)
#define NVP_DEVID_DEBUG_PATH(arg)
#define NVP_DEVID_DEBUG_DEVID(arg)
#endif /* DEBUG */
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_DEVID_CACHE_H */