20c794b39650d115e17a15983b6b82e46238cf45gavinm * CDDL HEADER START
20c794b39650d115e17a15983b6b82e46238cf45gavinm * The contents of this file are subject to the terms of the
20c794b39650d115e17a15983b6b82e46238cf45gavinm * Common Development and Distribution License (the "License").
20c794b39650d115e17a15983b6b82e46238cf45gavinm * You may not use this file except in compliance with the License.
20c794b39650d115e17a15983b6b82e46238cf45gavinm * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
20c794b39650d115e17a15983b6b82e46238cf45gavinm * See the License for the specific language governing permissions
20c794b39650d115e17a15983b6b82e46238cf45gavinm * and limitations under the License.
20c794b39650d115e17a15983b6b82e46238cf45gavinm * When distributing Covered Code, include this CDDL HEADER in each
20c794b39650d115e17a15983b6b82e46238cf45gavinm * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
20c794b39650d115e17a15983b6b82e46238cf45gavinm * If applicable, add the following below this CDDL HEADER, with the
20c794b39650d115e17a15983b6b82e46238cf45gavinm * fields enclosed by brackets "[]" replaced with your own identifying
20c794b39650d115e17a15983b6b82e46238cf45gavinm * information: Portions Copyright [yyyy] [name of copyright owner]
20c794b39650d115e17a15983b6b82e46238cf45gavinm * CDDL HEADER END
6e1fa242609208de48dfe1939b8814d4dff455a5Stephen Hanson * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
20c794b39650d115e17a15983b6b82e46238cf45gavinm * Use is subject to license terms.
20c794b39650d115e17a15983b6b82e46238cf45gavinm * Support function for the i86pc chip enumerator
1db96d3b343c9ab3090da5b745f1cd9de2f192efCheng Sean Yestatic void fmri_dprint(topo_mod_t *, const char *, uint32_t, nvlist_t *);
20c794b39650d115e17a15983b6b82e46238cf45gavinm * Whinge a debug message via topo_mod_dprintf and increment the
20c794b39650d115e17a15983b6b82e46238cf45gavinm * given error counter.
20c794b39650d115e17a15983b6b82e46238cf45gavinmwhinge(topo_mod_t *mod, int *nerr, const char *fmt, ...)
20c794b39650d115e17a15983b6b82e46238cf45gavinm * Given an nvpair of a limited number of data types, extract the property
20c794b39650d115e17a15983b6b82e46238cf45gavinm * name and value and add that combination to the given node in the
20c794b39650d115e17a15983b6b82e46238cf45gavinm * specified property group using the corresponding topo_prop_set_* function
20c794b39650d115e17a15983b6b82e46238cf45gavinm * for the data type. Return 1 on success, otherwise 0.
20c794b39650d115e17a15983b6b82e46238cf45gavinmnvprop_add(topo_mod_t *mod, nvpair_t *nvp, const char *pgname, tnode_t *node)
20c794b39650d115e17a15983b6b82e46238cf45gavinm TOPO_PROP_IMMUTABLE, val ? "true" : "false", &err) == 0)
20c794b39650d115e17a15983b6b82e46238cf45gavinm if (nvpair_value_uint32_array(nvp, &arrp, &nelem) == 0 &&
20c794b39650d115e17a15983b6b82e46238cf45gavinm nelem > 0 && topo_prop_set_uint32_array(node, pgname, pname,
20c794b39650d115e17a15983b6b82e46238cf45gavinm whinge(mod, &err, "nvprop_add: Can't handle type %d for "
20c794b39650d115e17a15983b6b82e46238cf45gavinm "'%s' in property group %s of %s node\n",
20c794b39650d115e17a15983b6b82e46238cf45gavinm nvpair_type(nvp), pname, pgname, topo_node_name(node));
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye * Lookup string data named pname in the given nvlist and add that
20c794b39650d115e17a15983b6b82e46238cf45gavinm * as property named pname in the given property group pgname on the indicated
20c794b39650d115e17a15983b6b82e46238cf45gavinm * topo node. Fill pvalp with a pointer to the string value, valid until
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye * nvlist_free is called.
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Yeadd_nvlist_strprop(topo_mod_t *mod, tnode_t *node, nvlist_t *nvl,
20c794b39650d115e17a15983b6b82e46238cf45gavinm const char *pgname, const char *pname, const char **pvalp)
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye if (nvlist_lookup_string(nvl, pname, &pval) != 0)
20c794b39650d115e17a15983b6b82e46238cf45gavinm return (-1);
20c794b39650d115e17a15983b6b82e46238cf45gavinm return (0);
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye whinge(mod, &err, "add_nvlist_strprop: failed to add '%s'\n",
20c794b39650d115e17a15983b6b82e46238cf45gavinm return (-1);
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye * Lookup an int32 item named pname in the given nvlist and add that
20c794b39650d115e17a15983b6b82e46238cf45gavinm * as property named pname in the given property group pgname on the indicated
20c794b39650d115e17a15983b6b82e46238cf45gavinm * topo node. Fill pvalp with the property value.
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Yeadd_nvlist_longprop(topo_mod_t *mod, tnode_t *node, nvlist_t *nvl,
20c794b39650d115e17a15983b6b82e46238cf45gavinm const char *pgname, const char *pname, int32_t *pvalp)
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye if ((nvlist_lookup_int32(nvl, pname, &pval)) != 0)
20c794b39650d115e17a15983b6b82e46238cf45gavinm return (-1);
20c794b39650d115e17a15983b6b82e46238cf45gavinm return (0);
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye whinge(mod, &err, "add_nvlist_longprop: failed to add '%s'\n",
20c794b39650d115e17a15983b6b82e46238cf45gavinm return (-1);
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye * In a given nvlist lookup a variable number of int32 properties named in
20c794b39650d115e17a15983b6b82e46238cf45gavinm * const char * varargs and each each in the given property group on the
20c794b39650d115e17a15983b6b82e46238cf45gavinm * node. Fill an array of the retrieved values.
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Yeadd_nvlist_longprops(topo_mod_t *mod, tnode_t *node, nvlist_t *nvl,
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye if (add_nvlist_longprop(mod, node, nvl, pgname, pname,
20c794b39650d115e17a15983b6b82e46238cf45gavinm * Construct an hc scheme resource FMRI for a node named name with
20c794b39650d115e17a15983b6b82e46238cf45gavinm * instance number inst, parented by the given parent node pnode.
20c794b39650d115e17a15983b6b82e46238cf45gavinmmkrsrc(topo_mod_t *mod, tnode_t *pnode, const char *name, int inst,
20c794b39650d115e17a15983b6b82e46238cf45gavinm *nvl = topo_mod_hcfmri(mod, pnode, FM_HC_SCHEME_VERSION, name,
20c794b39650d115e17a15983b6b82e46238cf45gavinm return (nvl != NULL ? 0 : -1); /* caller must free nvlist */
20c794b39650d115e17a15983b6b82e46238cf45gavinm * Construct a cpu scheme FMRI with the given data; the caller must free
20c794b39650d115e17a15983b6b82e46238cf45gavinm * the allocated nvlist with nvlist_free().
20c794b39650d115e17a15983b6b82e46238cf45gavinmcpu_fmri_create(topo_mod_t *mod, uint32_t cpuid, char *s, uint8_t cpumask)
20c794b39650d115e17a15983b6b82e46238cf45gavinm if (topo_mod_nvalloc(mod, &asru, NV_UNIQUE_NAME) != 0)
20c794b39650d115e17a15983b6b82e46238cf45gavinm err = nvlist_add_uint8(asru, FM_VERSION, FM_CPU_SCHEME_VERSION);
20c794b39650d115e17a15983b6b82e46238cf45gavinm err |= nvlist_add_string(asru, FM_FMRI_SCHEME, FM_FMRI_SCHEME_CPU);
20c794b39650d115e17a15983b6b82e46238cf45gavinm err |= nvlist_add_uint32(asru, FM_FMRI_CPU_ID, cpuid);
20c794b39650d115e17a15983b6b82e46238cf45gavinm err |= nvlist_add_uint8(asru, FM_FMRI_CPU_MASK, cpumask);
20c794b39650d115e17a15983b6b82e46238cf45gavinm err |= nvlist_add_string(asru, FM_FMRI_CPU_SERIAL_ID, s);
20c794b39650d115e17a15983b6b82e46238cf45gavinm if (err != 0) {
20c794b39650d115e17a15983b6b82e46238cf45gavinm/*ARGSUSED*/
20c794b39650d115e17a15983b6b82e46238cf45gavinmmem_asru_compute(topo_mod_t *mod, tnode_t *node, topo_version_t version,
20c794b39650d115e17a15983b6b82e46238cf45gavinm if (strcmp(topo_node_name(node), RANK_NODE_NAME) != 0 &&
20c794b39650d115e17a15983b6b82e46238cf45gavinm if (nvlist_lookup_nvlist(in, TOPO_PROP_ARGS, &args) != 0)
20c794b39650d115e17a15983b6b82e46238cf45gavinm if ((err = nvlist_lookup_nvlist(in, TOPO_PROP_PARGS, &pargs)) != 0) {
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye * if 'in' includes an hc-specific member which specifies asru-physaddr
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye * or asru-offset then rename them to asru and physaddr respectively.
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye if (nvlist_lookup_nvlist(asru, FM_FMRI_HC_SPECIFIC, &hcsp) == 0) {
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye "asru-"FM_FMRI_HC_SPECIFIC_PHYSADDR, &pa) == 0) {
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye "asru-"FM_FMRI_HC_SPECIFIC_OFFSET, &offset) == 0) {
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye if (err != 0 || topo_mod_nvalloc(mod, out, NV_UNIQUE_NAME) < 0) {
20c794b39650d115e17a15983b6b82e46238cf45gavinm err = nvlist_add_string(*out, TOPO_PROP_VAL_NAME, TOPO_PROP_ASRU);
20c794b39650d115e17a15983b6b82e46238cf45gavinm err |= nvlist_add_uint32(*out, TOPO_PROP_VAL_TYPE, TOPO_TYPE_FMRI);
20c794b39650d115e17a15983b6b82e46238cf45gavinm err |= nvlist_add_nvlist(*out, TOPO_PROP_VAL_VAL, asru);
20c794b39650d115e17a15983b6b82e46238cf45gavinm if (err != 0) {
20c794b39650d115e17a15983b6b82e46238cf45gavinm return (0);
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Yeset_retnvl(topo_mod_t *mod, nvlist_t **out, const char *retname, uint32_t ret)
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye if (topo_mod_nvalloc(mod, &nvl, NV_UNIQUE_NAME) < 0)
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye if (nvlist_add_uint32(nvl, retname, ret) != 0) {
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye return (topo_mod_seterrno(mod, EMOD_NVL_INVAL));
2cb5535af222653abf2eba5c180ded4a7b85d8b6robj * If we're getting called then the question of whether this dimm is plugged
2cb5535af222653abf2eba5c180ded4a7b85d8b6robj * in has already been answered. What we don't know for sure is whether it's
2cb5535af222653abf2eba5c180ded4a7b85d8b6robj * the same dimm or a different one plugged in the same slot. To check, we
2cb5535af222653abf2eba5c180ded4a7b85d8b6robj * try and compare the serial numbers on the dimm in the current topology with
2cb5535af222653abf2eba5c180ded4a7b85d8b6robj * the serial num from the unum fmri that got passed into this function as the
2cb5535af222653abf2eba5c180ded4a7b85d8b6robj * argument.
1db96d3b343c9ab3090da5b745f1cd9de2f192efCheng Sean Yefmri_replaced(topo_mod_t *mod, tnode_t *node, nvlist_t *unum, int *errp)
1db96d3b343c9ab3090da5b745f1cd9de2f192efCheng Sean Ye * If input is a page, return "replaced" if the offset is invalid.
1db96d3b343c9ab3090da5b745f1cd9de2f192efCheng Sean Ye (hdl = fmd_agent_open(FMD_AGENT_VERSION)) != NULL) {
2cb5535af222653abf2eba5c180ded4a7b85d8b6robj * If a serial number for the dimm was available at the time of the
2cb5535af222653abf2eba5c180ded4a7b85d8b6robj * fault, it will have been added as a string to the unum nvlist
1db96d3b343c9ab3090da5b745f1cd9de2f192efCheng Sean Ye if (nvlist_lookup_string(unum, FM_FMRI_HC_SERIAL_ID, &old_serial))
2cb5535af222653abf2eba5c180ded4a7b85d8b6robj * If the current serial number is available for the DIMM that this rank
2cb5535af222653abf2eba5c180ded4a7b85d8b6robj * belongs to, it will be accessible as a property on the parent (dimm)
6e1fa242609208de48dfe1939b8814d4dff455a5Stephen Hanson * node. If there is a serial id in the resource fmri, then use that.
6e1fa242609208de48dfe1939b8814d4dff455a5Stephen Hanson * Otherwise fall back to looking for a serial id property in the
6e1fa242609208de48dfe1939b8814d4dff455a5Stephen Hanson * protocol group.
6e1fa242609208de48dfe1939b8814d4dff455a5Stephen Hanson if (topo_node_resource(dimmnode, &resource, &err) != -1) {
6e1fa242609208de48dfe1939b8814d4dff455a5Stephen Hanson if (nvlist_lookup_string(resource, FM_FMRI_HC_SERIAL_ID,
2cb5535af222653abf2eba5c180ded4a7b85d8b6robj if (topo_prop_get_string(dimmnode, TOPO_PGROUP_PROTOCOL,
1db96d3b343c9ab3090da5b745f1cd9de2f192efCheng Sean Ye whinge(mod, NULL, "rank_fmri_present: Unexpected "
1db96d3b343c9ab3090da5b745f1cd9de2f192efCheng Sean Ye "error retrieving serial from node");
25c6ff4b77fcddf4097ce78a8277275ca603b46cstephh * In the event we encounter problems comparing serials or if a comparison isn't
25c6ff4b77fcddf4097ce78a8277275ca603b46cstephh * possible, we err on the side of caution and set is_present to TRUE.
1db96d3b343c9ab3090da5b745f1cd9de2f192efCheng Sean Yerank_fmri_present(topo_mod_t *mod, tnode_t *node, topo_version_t version,
1db96d3b343c9ab3090da5b745f1cd9de2f192efCheng Sean Ye return (topo_mod_seterrno(mod, EMOD_VER_NEW));
1db96d3b343c9ab3090da5b745f1cd9de2f192efCheng Sean Ye fmri_dprint(mod, "rank_fmri_present", is_present, in);
1db96d3b343c9ab3090da5b745f1cd9de2f192efCheng Sean Ye return (set_retnvl(mod, out, TOPO_METH_PRESENT_RET, is_present));
1db96d3b343c9ab3090da5b745f1cd9de2f192efCheng Sean Yerank_fmri_replaced(topo_mod_t *mod, tnode_t *node, topo_version_t version,
1db96d3b343c9ab3090da5b745f1cd9de2f192efCheng Sean Ye return (topo_mod_seterrno(mod, EMOD_VER_NEW));
1db96d3b343c9ab3090da5b745f1cd9de2f192efCheng Sean Ye is_replaced = fmri_replaced(mod, node, in, &err);
1db96d3b343c9ab3090da5b745f1cd9de2f192efCheng Sean Ye fmri_dprint(mod, "rank_fmri_replaced", is_replaced, in);
1db96d3b343c9ab3090da5b745f1cd9de2f192efCheng Sean Ye return (set_retnvl(mod, out, TOPO_METH_REPLACED_RET, is_replaced));
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Yefmri_dprint(topo_mod_t *mod, const char *op, uint32_t rc, nvlist_t *fmri)
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye if (fmri != NULL && topo_mod_nvl2str(mod, fmri, &fmristr) == 0) {
1db96d3b343c9ab3090da5b745f1cd9de2f192efCheng Sean Ye topo_mod_dprintf(mod, "[%s]: %s => %d (\"%s\")\n", fmristr,
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye int (*func)(fmd_agent_hdl_t *, int, int, int);
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Yestrand_walker(topo_mod_t *mod, tnode_t *node, void *pdata)
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye * Terminate the walk if we reach start-node's sibling
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye topo_node_parent(node) == topo_node_parent(swdp->parent))
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye if (strcmp(topo_node_name(node), STRAND) != 0)
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye if (topo_prop_get_int32(node, PGNAME(STRAND), STRAND_CHIP_ID,
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye topo_prop_get_int32(node, PGNAME(STRAND), STRAND_CORE_ID,
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye rc = swdp->func(swdp->hdl, chipid, coreid, strandid);
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye else if (swdp->func == fmd_agent_cpu_unretire)
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye else if (swdp->func == fmd_agent_cpu_isretired)
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye topo_mod_dprintf(mod, "%s cpu (%d:%d:%d): rc = %d, err = %s\n",
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye op, (int)chipid, (int)coreid, (int)strandid, rc,
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Yewalk_strands(topo_mod_t *mod, struct strand_walk_data *swdp, tnode_t *parent,
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye int (*func)(fmd_agent_hdl_t *, int, int, int))
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye swdp->err = swdp->done = swdp->fail = swdp->async = 0;
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye if ((swdp->hdl = fmd_agent_open(FMD_AGENT_VERSION)) == NULL) {
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye twp = topo_mod_walk_init(mod, parent, strand_walker, swdp, &err);
25c6ff4b77fcddf4097ce78a8277275ca603b46cstephh return (0);
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye/* ARGSUSED */
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Yeretire_strands(topo_mod_t *mod, tnode_t *node, topo_version_t version,
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye return (topo_mod_seterrno(mod, EMOD_VER_NEW));
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye if (walk_strands(mod, &swd, node, fmd_agent_cpu_retire) == -1)
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye return (set_retnvl(mod, out, TOPO_METH_RETIRE_RET, rc));
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye/* ARGSUSED */
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Yeunretire_strands(topo_mod_t *mod, tnode_t *node, topo_version_t version,
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye return (topo_mod_seterrno(mod, EMOD_VER_NEW));
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye if (walk_strands(mod, &swd, node, fmd_agent_cpu_unretire) == -1)
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye return (set_retnvl(mod, out, TOPO_METH_UNRETIRE_RET, rc));
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye/* ARGSUSED */
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Yeservice_state_strands(topo_mod_t *mod, tnode_t *node, topo_version_t version,
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye if (version > TOPO_METH_SERVICE_STATE_VERSION)
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye return (topo_mod_seterrno(mod, EMOD_VER_NEW));
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye if (walk_strands(mod, &swd, node, fmd_agent_cpu_isretired) == -1)
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye rc = (swd.fail + swd.async > 0) ? FMD_SERVICE_STATE_DEGRADED :
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye return (set_retnvl(mod, out, TOPO_METH_SERVICE_STATE_RET, rc));
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye/* ARGSUSED */
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Yeunusable_strands(topo_mod_t *mod, tnode_t *node, topo_version_t version,
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye return (topo_mod_seterrno(mod, EMOD_VER_NEW));
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye if (walk_strands(mod, &swd, node, fmd_agent_cpu_isretired) == -1)
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye rc = (swd.fail + swd.async > 0 || swd.done == 0) ? 0 : 1;
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye return (set_retnvl(mod, out, TOPO_METH_UNUSABLE_RET, rc));
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye if (nvlist_lookup_nvlist(nvl, FM_FMRI_HC_SPECIFIC, &hcsp) == 0 &&
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye (nvlist_lookup_uint64(hcsp, FM_FMRI_HC_SPECIFIC_OFFSET,
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye nvlist_lookup_uint64(hcsp, "asru-" FM_FMRI_HC_SPECIFIC_OFFSET,
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye nvlist_lookup_uint64(hcsp, FM_FMRI_HC_SPECIFIC_PHYSADDR,
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye nvlist_lookup_uint64(hcsp, "asru-" FM_FMRI_HC_SPECIFIC_PHYSADDR,
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye/* ARGSUSED */
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Yentv_page_retire(topo_mod_t *mod, tnode_t *node, topo_version_t version,
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye return (topo_mod_seterrno(mod, EMOD_VER_NEW));
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye if ((hdl = fmd_agent_open(FMD_AGENT_VERSION)) != NULL) {
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye return (set_retnvl(mod, out, TOPO_METH_RETIRE_RET, rc));
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye/* ARGSUSED */
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Yentv_page_unretire(topo_mod_t *mod, tnode_t *node, topo_version_t version,
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye return (topo_mod_seterrno(mod, EMOD_VER_NEW));
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye if ((hdl = fmd_agent_open(FMD_AGENT_VERSION)) != NULL) {
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye fmri_dprint(mod, "ntv_page_unretire", rc, in);
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye return (set_retnvl(mod, out, TOPO_METH_UNRETIRE_RET, rc));
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye/* ARGSUSED */
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Yentv_page_service_state(topo_mod_t *mod, tnode_t *node, topo_version_t version,
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye if (version > TOPO_METH_SERVICE_STATE_VERSION)
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye return (topo_mod_seterrno(mod, EMOD_VER_NEW));
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye if ((hdl = fmd_agent_open(FMD_AGENT_VERSION)) != NULL) {
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye topo_mod_dprintf(mod, "ntv_page_service_state: rc = %u\n", rc);
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye return (set_retnvl(mod, out, TOPO_METH_SERVICE_STATE_RET, rc));
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye/* ARGSUSED */
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Yentv_page_unusable(topo_mod_t *mod, tnode_t *node, topo_version_t version,
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye return (topo_mod_seterrno(mod, EMOD_VER_NEW));
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye if ((hdl = fmd_agent_open(FMD_AGENT_VERSION)) != NULL) {
e4b86885570d77af552e9cf94f142f4d744fb8c8Cheng Sean Ye topo_mod_dprintf(mod, "ntv_page_unusable: rc = %u\n", rc);