summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr/src/lib/fm/topo/libtopo/common/dev.c2
-rw-r--r--usr/src/lib/libdevinfo/devinfo.c14
-rw-r--r--usr/src/lib/libdevinfo/mapfile-vers1
-rw-r--r--usr/src/uts/common/io/devinfo.c3
-rw-r--r--usr/src/uts/common/sys/devinfo_impl.h16
5 files changed, 29 insertions, 7 deletions
diff --git a/usr/src/lib/fm/topo/libtopo/common/dev.c b/usr/src/lib/fm/topo/libtopo/common/dev.c
index abbf934245..dddede8706 100644
--- a/usr/src/lib/fm/topo/libtopo/common/dev.c
+++ b/usr/src/lib/fm/topo/libtopo/common/dev.c
@@ -456,7 +456,7 @@ dev_fmri_unusable(topo_mod_t *mod, tnode_t *node, topo_version_t version,
if (topo_mod_nvalloc(mod, out, NV_UNIQUE_NAME) != 0)
return (topo_mod_seterrno(mod, EMOD_NVL_INVAL));
- if (nvlist_add_uint32(*out, TOPO_METH_PRESENT_RET, unusable) != 0) {
+ if (nvlist_add_uint32(*out, TOPO_METH_UNUSABLE_RET, unusable) != 0) {
nvlist_free(*out);
return (topo_mod_seterrno(mod, EMOD_NVL_INVAL));
}
diff --git a/usr/src/lib/libdevinfo/devinfo.c b/usr/src/lib/libdevinfo/devinfo.c
index e37e207474..c9179e0d1f 100644
--- a/usr/src/lib/libdevinfo/devinfo.c
+++ b/usr/src/lib/libdevinfo/devinfo.c
@@ -271,6 +271,14 @@ di_init_impl(const char *phys_path, uint_t flag,
(void) close(fd);
dap = DI_ALL(pa);
+ if (dap->version != DI_SNAPSHOT_VERSION) {
+ DPRINTF((DI_ERR, "wrong snapshot version "
+ "(expected=%d, actual=%d)\n",
+ DI_SNAPSHOT_VERSION, dap->version));
+ free(pa);
+ errno = ESTALE;
+ return (DI_NODE_NIL);
+ }
if (dap->top_devinfo == 0) { /* phys_path not found */
DPRINTF((DI_ERR, "%s not found\n", phys_path));
free(pa);
@@ -984,6 +992,12 @@ di_node_state(di_node_t node)
return (DI_NODE(node)->node_state);
}
+uint_t
+di_flags(di_node_t node)
+{
+ return (DI_NODE(node)->flags);
+}
+
ddi_devid_t
di_devid(di_node_t node)
{
diff --git a/usr/src/lib/libdevinfo/mapfile-vers b/usr/src/lib/libdevinfo/mapfile-vers
index f94882dcae..c941cd3efe 100644
--- a/usr/src/lib/libdevinfo/mapfile-vers
+++ b/usr/src/lib/libdevinfo/mapfile-vers
@@ -210,6 +210,7 @@ SUNWprivate_1.1 {
finddev_readdir;
finddev_close;
finddev_next;
+ di_flags;
local:
*;
};
diff --git a/usr/src/uts/common/io/devinfo.c b/usr/src/uts/common/io/devinfo.c
index 1768378fe7..b29a61596e 100644
--- a/usr/src/uts/common/io/devinfo.c
+++ b/usr/src/uts/common/io/devinfo.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -1713,6 +1713,7 @@ di_copynode(struct di_stack *dsp, struct di_state *st)
me->node_class = node->devi_node_class;
me->attributes = node->devi_node_attributes;
me->state = node->devi_state;
+ me->flags = node->devi_flags;
me->node_state = node->devi_node_state;
me->next_vhci = 0; /* Filled up by build_vhci_list. */
me->top_phci = 0; /* Filled up by build_phci_list. */
diff --git a/usr/src/uts/common/sys/devinfo_impl.h b/usr/src/uts/common/sys/devinfo_impl.h
index 6bf4255cf6..1b78a5412c 100644
--- a/usr/src/uts/common/sys/devinfo_impl.h
+++ b/usr/src/uts/common/sys/devinfo_impl.h
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * 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
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -99,7 +98,8 @@ extern "C" {
#define MAX_PTR_IN_PRV 5
#define DI_SNAPSHOT_VERSION_0 0 /* reserved */
#define DI_SNAPSHOT_VERSION_1 1 /* reserved */
-#define DI_SNAPSHOT_VERSION DI_SNAPSHOT_VERSION_1 /* current version */
+#define DI_SNAPSHOT_VERSION_2 2 /* reserved */
+#define DI_SNAPSHOT_VERSION DI_SNAPSHOT_VERSION_2 /* current version */
#define DI_PRIVDATA_VERSION_0 10 /* Start from 10 so caller must set */
#define DI_BIG_ENDIAN 0 /* reserved */
#define DI_LITTLE_ENDIAN 1 /* reserved */
@@ -277,6 +277,12 @@ struct di_node { /* useful info to export for each tree node */
di_off_t top_phci;
di_off_t next_phci;
uint32_t multipath_component; /* stores MDI_COMPONENT_* value. */
+
+ /*
+ * devi_flags field
+ */
+ uint32_t flags;
+ uint32_t di_pad2; /* 4 byte padding for 32bit x86 app. */
};
/*