Lines Matching refs:mod

222 hc_init(topo_mod_t *mod, topo_version_t version)  in hc_init()  argument
228 topo_mod_setdebug(mod); in hc_init()
230 topo_mod_dprintf(mod, "initializing hc builtin\n"); in hc_init()
233 return (topo_mod_seterrno(mod, EMOD_VER_NEW)); in hc_init()
235 if (topo_mod_register(mod, &hc_info, TOPO_VERSION) != 0) { in hc_init()
236 topo_mod_dprintf(mod, "failed to register hc: " in hc_init()
237 "%s\n", topo_mod_errmsg(mod)); in hc_init()
245 hc_fini(topo_mod_t *mod) in hc_fini() argument
247 topo_mod_unregister(mod); in hc_fini()
252 hc_enum(topo_mod_t *mod, tnode_t *pnode, const char *name, topo_instance_t min, in hc_enum() argument
265 (void) topo_method_register(mod, pnode, hc_methods); in hc_enum()
269 topo_mod_dprintf(mod, in hc_enum()
273 return (topo_mod_seterrno(mod, EINVAL)); in hc_enum()
280 auth = topo_mod_auth(mod, pnode); in hc_enum()
281 nvl = hc_fmri_create(mod, pfmri, FM_HC_SCHEME_VERSION, name, min, in hc_enum()
289 if ((node = topo_node_bind(mod, pnode, name, min, nvl)) == NULL) { in hc_enum()
290 topo_mod_dprintf(mod, "topo_node_bind failed: %s\n", in hc_enum()
291 topo_strerror(topo_mod_errno(mod))); in hc_enum()
298 if (topo_method_register(mod, node, fru_container_methods) < in hc_enum()
300 topo_mod_dprintf(mod, "failed to register methods on " in hc_enum()
327 fmri_compare(topo_mod_t *mod, nvlist_t *nv1, nvlist_t *nv2) in fmri_compare() argument
339 return (topo_mod_seterrno(mod, EMOD_FMRI_VERSION)); in fmri_compare()
344 return (topo_mod_seterrno(mod, EMOD_FMRI_NVL)); in fmri_compare()
360 return (topo_mod_seterrno(mod, EMOD_FMRI_NVL)); in fmri_compare()
394 hc_compare(topo_mod_t *mod, tnode_t *node, topo_version_t version, in hc_compare() argument
402 return (topo_mod_seterrno(mod, EMOD_VER_NEW)); in hc_compare()
406 return (topo_mod_seterrno(mod, EMOD_METHOD_INVAL)); in hc_compare()
408 ret = fmri_compare(mod, nv1, nv2); in hc_compare()
413 if (topo_mod_nvalloc(mod, out, NV_UNIQUE_NAME) == 0) { in hc_compare()
555 hc_fmri_nvl2str(topo_mod_t *mod, tnode_t *node, topo_version_t version, in hc_fmri_nvl2str() argument
563 return (topo_mod_seterrno(mod, EMOD_VER_NEW)); in hc_fmri_nvl2str()
566 (name = topo_mod_alloc(mod, len + 1)) == NULL || in hc_fmri_nvl2str()
569 topo_mod_free(mod, name, len + 1); in hc_fmri_nvl2str()
570 return (topo_mod_seterrno(mod, EMOD_FMRI_NVL)); in hc_fmri_nvl2str()
573 if (topo_mod_nvalloc(mod, &fmristr, NV_UNIQUE_NAME) != 0) { in hc_fmri_nvl2str()
574 topo_mod_free(mod, name, len + 1); in hc_fmri_nvl2str()
575 return (topo_mod_seterrno(mod, EMOD_FMRI_NVL)); in hc_fmri_nvl2str()
578 topo_mod_free(mod, name, len + 1); in hc_fmri_nvl2str()
580 return (topo_mod_seterrno(mod, EMOD_FMRI_NVL)); in hc_fmri_nvl2str()
582 topo_mod_free(mod, name, len + 1); in hc_fmri_nvl2str()
589 hc_base_fmri_create(topo_mod_t *mod, const nvlist_t *auth, const char *part, in hc_base_fmri_create() argument
598 if (topo_mod_nvalloc(mod, &fmri, NV_UNIQUE_NAME) != 0) in hc_base_fmri_create()
626 make_hc_pairs(topo_mod_t *mod, char *fmri, int *num) in make_hc_pairs() argument
639 if ((hc = topo_mod_strdup(mod, fmri + 5)) == NULL) in make_hc_pairs()
669 topo_mod_free(mod, hc, hclen); in make_hc_pairs()
677 if ((pa = topo_mod_zalloc(mod, npairs * sizeof (nvlist_t *))) == NULL) { in make_hc_pairs()
678 topo_mod_free(mod, hc, hclen); in make_hc_pairs()
700 if ((cname = topo_mod_strdup(mod, startn)) == NULL) in make_hc_pairs()
711 if ((cid = topo_mod_strdup(mod, starti)) == NULL) in make_hc_pairs()
716 if ((cid = topo_mod_strdup(mod, starti)) == NULL) in make_hc_pairs()
720 if (topo_mod_nvalloc(mod, &pa[i], NV_UNIQUE_NAME) < 0) in make_hc_pairs()
727 topo_mod_strfree(mod, cname); in make_hc_pairs()
728 topo_mod_strfree(mod, cid); in make_hc_pairs()
733 topo_mod_strfree(mod, cname); in make_hc_pairs()
734 topo_mod_strfree(mod, cid); in make_hc_pairs()
739 topo_mod_free(mod, pa, npairs * sizeof (nvlist_t *)); in make_hc_pairs()
740 topo_mod_free(mod, hc, hclen); in make_hc_pairs()
744 topo_mod_free(mod, hc, hclen); in make_hc_pairs()
750 make_hc_auth(topo_mod_t *mod, char *fmri, char **serial, char **part, in make_hc_auth() argument
758 if ((copy = topo_mod_strdup(mod, fmri + 5)) == NULL) in make_hc_auth()
770 topo_mod_strfree(mod, copy); in make_hc_auth()
792 if ((aname = topo_mod_strdup(mod, startn)) == NULL) in make_hc_auth()
801 if ((aid = topo_mod_strdup(mod, starti)) == NULL) in make_hc_auth()
808 *serial = topo_mod_strdup(mod, aid); in make_hc_auth()
810 *part = topo_mod_strdup(mod, aid); in make_hc_auth()
812 *rev = topo_mod_strdup(mod, aid); in make_hc_auth()
815 if (topo_mod_nvalloc(mod, &na, in make_hc_auth()
824 topo_mod_strfree(mod, aname); in make_hc_auth()
825 topo_mod_strfree(mod, aid); in make_hc_auth()
832 topo_mod_free(mod, copy, len + 1); in make_hc_auth()
836 topo_mod_free(mod, copy, len + 1); in make_hc_auth()
837 topo_mod_strfree(mod, aname); in make_hc_auth()
838 topo_mod_strfree(mod, aid); in make_hc_auth()
853 make_facility(topo_mod_t *mod, char *str, nvlist_t **nvl) in make_facility() argument
863 if ((copy = topo_mod_strdup(mod, fac)) == NULL) in make_facility()
864 return (topo_mod_seterrno(mod, EMOD_NOMEM)); in make_facility()
870 topo_mod_free(mod, copy, len + 1); in make_facility()
871 return (topo_mod_seterrno(mod, EMOD_FMRI_MALFORM)); in make_facility()
878 if (topo_mod_nvalloc(mod, &nf, NV_UNIQUE_NAME) != 0) { in make_facility()
879 topo_mod_free(mod, copy, len + 1); in make_facility()
880 return (topo_mod_seterrno(mod, EMOD_NOMEM)); in make_facility()
885 topo_mod_free(mod, copy, len + 1); in make_facility()
886 return (topo_mod_seterrno(mod, EMOD_FMRI_NVL)); in make_facility()
889 topo_mod_free(mod, copy, len + 1); in make_facility()
898 hc_fmri_str2nvl(topo_mod_t *mod, tnode_t *node, topo_version_t version, in hc_fmri_str2nvl() argument
911 return (topo_mod_seterrno(mod, EMOD_VER_NEW)); in hc_fmri_str2nvl()
914 return (topo_mod_seterrno(mod, EMOD_METHOD_INVAL)); in hc_fmri_str2nvl()
918 return (topo_mod_seterrno(mod, EMOD_FMRI_MALFORM)); in hc_fmri_str2nvl()
920 if ((pa = make_hc_pairs(mod, str, &npairs)) == NULL) in hc_fmri_str2nvl()
921 return (topo_mod_seterrno(mod, EMOD_FMRI_MALFORM)); in hc_fmri_str2nvl()
923 if (make_hc_auth(mod, str, &serial, &part, &rev, &auth) < 0) in hc_fmri_str2nvl()
926 if ((nf = hc_base_fmri_create(mod, auth, part, rev, serial)) == NULL) in hc_fmri_str2nvl()
945 if (topo_mod_nvalloc(mod, &hcsp, NV_UNIQUE_NAME) != 0) in hc_fmri_str2nvl()
960 topo_mod_dprintf(mod, "construction of new hc nvl failed"); in hc_fmri_str2nvl()
969 topo_mod_free(mod, pa, npairs * sizeof (nvlist_t *)); in hc_fmri_str2nvl()
970 topo_mod_strfree(mod, serial); in hc_fmri_str2nvl()
971 topo_mod_strfree(mod, part); in hc_fmri_str2nvl()
972 topo_mod_strfree(mod, rev); in hc_fmri_str2nvl()
975 if (make_facility(mod, str, &fac) == -1) in hc_fmri_str2nvl()
991 topo_mod_free(mod, pa, npairs * sizeof (nvlist_t *)); in hc_fmri_str2nvl()
993 topo_mod_strfree(mod, serial); in hc_fmri_str2nvl()
994 topo_mod_strfree(mod, part); in hc_fmri_str2nvl()
995 topo_mod_strfree(mod, rev); in hc_fmri_str2nvl()
998 return (topo_mod_seterrno(mod, EMOD_FMRI_MALFORM)); in hc_fmri_str2nvl()
1002 hc_list_create(topo_mod_t *mod, const char *name, char *inst) in hc_list_create() argument
1007 if (topo_mod_nvalloc(mod, &hc, NV_UNIQUE_NAME) != 0) in hc_list_create()
1021 hc_create_seterror(topo_mod_t *mod, nvlist_t **hcl, int n, nvlist_t *fmri, in hc_create_seterror() argument
1030 topo_mod_free(mod, hcl, sizeof (nvlist_t *) * (n + 1)); in hc_create_seterror()
1035 (void) topo_mod_seterrno(mod, err); in hc_create_seterror()
1037 topo_mod_dprintf(mod, "unable to create hc FMRI: %s\n", in hc_create_seterror()
1038 topo_mod_errmsg(mod)); in hc_create_seterror()
1044 hc_name_canonical(topo_mod_t *mod, const char *name) in hc_name_canonical() argument
1059 topo_mod_dprintf(mod, "non-canonical name %s\n", in hc_name_canonical()
1068 hc_fmri_create(topo_mod_t *mod, nvlist_t *pfmri, int version, const char *name, in hc_fmri_create() argument
1080 return (hc_create_seterror(mod, in hc_fmri_create()
1083 return (hc_create_seterror(mod, in hc_fmri_create()
1089 if (hc_name_canonical(mod, name) == 0) in hc_fmri_create()
1090 return (hc_create_seterror(mod, in hc_fmri_create()
1098 return (hc_create_seterror(mod, in hc_fmri_create()
1102 hcl = topo_mod_zalloc(mod, sizeof (nvlist_t *) * (pelems + 1)); in hc_fmri_create()
1104 return (hc_create_seterror(mod, hcl, pelems, fmri, in hc_fmri_create()
1108 if (topo_mod_nvdup(mod, phcl[i], &hcl[i]) != 0) in hc_fmri_create()
1109 return (hc_create_seterror(mod, in hc_fmri_create()
1113 if ((hcl[i] = hc_list_create(mod, name, str)) == NULL) in hc_fmri_create()
1114 return (hc_create_seterror(mod, in hc_fmri_create()
1117 if ((fmri = hc_base_fmri_create(mod, auth, part, rev, serial)) == NULL) in hc_fmri_create()
1118 return (hc_create_seterror(mod, in hc_fmri_create()
1123 return (hc_create_seterror(mod, in hc_fmri_create()
1130 topo_mod_free(mod, hcl, sizeof (nvlist_t *) * (pelems + 1)); in hc_fmri_create()
1138 hc_fmri_create_meth(topo_mod_t *mod, tnode_t *node, topo_version_t version, in hc_fmri_create_meth() argument
1148 return (topo_mod_seterrno(mod, EMOD_VER_NEW)); in hc_fmri_create_meth()
1152 return (topo_mod_seterrno(mod, EMOD_METHOD_INVAL)); in hc_fmri_create_meth()
1154 return (topo_mod_seterrno(mod, EMOD_METHOD_INVAL)); in hc_fmri_create_meth()
1165 return (topo_mod_seterrno(mod, EMOD_METHOD_INVAL)); in hc_fmri_create_meth()
1180 *out = hc_fmri_create(mod, pfmri, version, name, inst, auth, part, in hc_fmri_create_meth()
1206 hc_match(topo_mod_t *mod, tnode_t *node, nvlist_t *fmri, const char *name, in hc_match() argument
1217 if (topo_mod_nvalloc(mod, &arg, NV_UNIQUE_NAME) != 0 || in hc_match()
1223 (void) topo_mod_seterrno(mod, EMOD_NOMEM); in hc_match()
1244 (void) topo_mod_seterrno(mod, EMOD_NVL_INVAL); in hc_match()
1260 hc_walk_sibling(topo_mod_t *mod, tnode_t *node, struct hc_walk *hwp, in hc_walk_sibling() argument
1272 if (hc_match(mod, np, hwp->hcw_fmri, name, inst, in hc_walk_sibling()
1276 status = wp->tw_cb(mod, np, hwp); in hc_walk_sibling()
1300 hc_walker(topo_mod_t *mod, tnode_t *node, void *pdata) in hc_walker() argument
1312 if ((err = hwp->hcw_cb(mod, node, hwp->hcw_priv)) in hc_walker()
1314 (void) topo_mod_seterrno(mod, err); in hc_walker()
1315 topo_mod_dprintf(mod, "hc_walker: callback " in hc_walker()
1316 "failed: %s\n ", topo_mod_errmsg(mod)); in hc_walker()
1319 topo_mod_dprintf(mod, "hc_walker: callback " in hc_walker()
1323 topo_mod_dprintf(mod, "hc_walker: node not found\n"); in hc_walker()
1332 (void) topo_mod_seterrno(mod, EMOD_NVL_INVAL); in hc_walker()
1344 if (hc_match(mod, node, hwp->hcw_fmri, name, inst, &match) != 0) in hc_walker()
1348 return (hc_walk_sibling(mod, node, hwp, name, inst)); in hc_walker()
1350 topo_mod_dprintf(mod, "hc_walker: walking node:%s=%" PRIu64 " for hc:" in hc_walker()
1366 (void) topo_mod_seterrno(mod, EMOD_NVL_INVAL); in hc_walker()
1370 topo_mod_dprintf(mod, "hc_walker: walk to facility " in hc_walker()
1378 if ((err = hwp->hcw_cb(mod, node, hwp->hcw_priv)) != 0) { in hc_walker()
1379 (void) topo_mod_seterrno(mod, err); in hc_walker()
1380 topo_mod_dprintf(mod, "hc_walker: callback " in hc_walker()
1381 "failed: %s\n ", topo_mod_errmsg(mod)); in hc_walker()
1384 topo_mod_dprintf(mod, "hc_walker: callback " in hc_walker()
1397 (void) topo_mod_seterrno(mod, err); in hc_walker()
1407 hc_walk_init(topo_mod_t *mod, tnode_t *node, nvlist_t *rsrc, in hc_walk_init() argument
1415 if ((hwp = topo_mod_alloc(mod, sizeof (struct hc_walk))) == NULL) { in hc_walk_init()
1416 (void) topo_mod_seterrno(mod, EMOD_NOMEM); in hc_walk_init()
1422 topo_mod_dprintf(mod, "hc_walk_init: failed to lookup %s " in hc_walk_init()
1424 topo_mod_free(mod, hwp, sizeof (struct hc_walk)); in hc_walk_init()
1425 (void) topo_mod_seterrno(mod, EMOD_METHOD_INVAL); in hc_walk_init()
1431 topo_mod_dprintf(mod, "hc_walk_init: unexpected error " in hc_walk_init()
1433 topo_mod_free(mod, hwp, sizeof (struct hc_walk)); in hc_walk_init()
1434 (void) topo_mod_seterrno(mod, EMOD_METHOD_INVAL); in hc_walk_init()
1446 if ((wp = topo_mod_walk_init(mod, node, hc_walker, (void *)hwp, &err)) in hc_walk_init()
1448 topo_mod_dprintf(mod, "hc_walk_init: topo_mod_walk_init failed " in hc_walk_init()
1450 topo_mod_free(mod, hwp, sizeof (struct hc_walk)); in hc_walk_init()
1451 (void) topo_mod_seterrno(mod, err); in hc_walk_init()
1471 hc_prop_get(topo_mod_t *mod, tnode_t *node, void *pdata) in hc_prop_get() argument
1484 hc_fmri_prop_get(topo_mod_t *mod, tnode_t *node, topo_version_t version, in hc_fmri_prop_get() argument
1492 return (topo_mod_seterrno(mod, ETOPO_METHOD_VERNEW)); in hc_fmri_prop_get()
1494 if ((plp = topo_mod_alloc(mod, sizeof (struct prop_lookup))) == NULL) in hc_fmri_prop_get()
1495 return (topo_mod_seterrno(mod, EMOD_NOMEM)); in hc_fmri_prop_get()
1503 topo_mod_free(mod, plp, sizeof (struct prop_lookup)); in hc_fmri_prop_get()
1504 return (topo_mod_seterrno(mod, EMOD_METHOD_INVAL)); in hc_fmri_prop_get()
1513 topo_mod_free(mod, plp, sizeof (struct prop_lookup)); in hc_fmri_prop_get()
1514 return (topo_mod_seterrno(mod, EMOD_METHOD_INVAL)); in hc_fmri_prop_get()
1521 if ((hwp = hc_walk_init(mod, node, plp->pl_rsrc, hc_prop_get, in hc_fmri_prop_get()
1529 topo_mod_free(mod, hwp, sizeof (struct hc_walk)); in hc_fmri_prop_get()
1537 topo_mod_free(mod, plp, sizeof (struct prop_lookup)); in hc_fmri_prop_get()
1544 hc_pgrp_get(topo_mod_t *mod, tnode_t *node, void *pdata) in hc_pgrp_get() argument
1556 hc_fmri_pgrp_get(topo_mod_t *mod, tnode_t *node, topo_version_t version, in hc_fmri_pgrp_get() argument
1564 return (topo_mod_seterrno(mod, ETOPO_METHOD_VERNEW)); in hc_fmri_pgrp_get()
1566 if ((plp = topo_mod_alloc(mod, sizeof (struct prop_lookup))) == NULL) in hc_fmri_pgrp_get()
1567 return (topo_mod_seterrno(mod, EMOD_NOMEM)); in hc_fmri_pgrp_get()
1573 topo_mod_free(mod, plp, sizeof (struct prop_lookup)); in hc_fmri_pgrp_get()
1574 return (topo_mod_seterrno(mod, EMOD_METHOD_INVAL)); in hc_fmri_pgrp_get()
1578 if ((hwp = hc_walk_init(mod, node, plp->pl_rsrc, hc_pgrp_get, in hc_fmri_pgrp_get()
1586 topo_mod_free(mod, hwp, sizeof (struct hc_walk)); in hc_fmri_pgrp_get()
1594 topo_mod_free(mod, plp, sizeof (struct prop_lookup)); in hc_fmri_pgrp_get()
1601 hc_prop_setprop(topo_mod_t *mod, tnode_t *node, void *pdata) in hc_prop_setprop() argument
1615 hc_fmri_prop_set(topo_mod_t *mod, tnode_t *node, topo_version_t version, in hc_fmri_prop_set() argument
1623 return (topo_mod_seterrno(mod, ETOPO_METHOD_VERNEW)); in hc_fmri_prop_set()
1625 if ((plp = topo_mod_alloc(mod, sizeof (struct prop_lookup))) == NULL) in hc_fmri_prop_set()
1626 return (topo_mod_seterrno(mod, EMOD_NOMEM)); in hc_fmri_prop_set()
1634 topo_mod_free(mod, plp, sizeof (struct prop_lookup)); in hc_fmri_prop_set()
1635 return (topo_mod_seterrno(mod, EMOD_METHOD_INVAL)); in hc_fmri_prop_set()
1644 return (topo_mod_seterrno(mod, EMOD_METHOD_INVAL)); in hc_fmri_prop_set()
1649 if ((hwp = hc_walk_init(mod, node, plp->pl_rsrc, hc_prop_setprop, in hc_fmri_prop_set()
1657 topo_mod_free(mod, hwp, sizeof (struct hc_walk)); in hc_fmri_prop_set()
1662 topo_mod_free(mod, plp, sizeof (struct prop_lookup)); in hc_fmri_prop_set()
1690 hc_is_present(topo_mod_t *mod, tnode_t *node, void *pdata) in hc_is_present() argument
1730 if (topo_mod_nvalloc(mod, &hap->ha_nvl, NV_UNIQUE_NAME) != 0) in hc_is_present()
1745 hc_fmri_present(topo_mod_t *mod, tnode_t *node, topo_version_t version, in hc_fmri_present() argument
1753 return (topo_mod_seterrno(mod, ETOPO_METHOD_VERNEW)); in hc_fmri_present()
1755 if ((hap = topo_mod_alloc(mod, sizeof (struct hc_args))) == NULL) in hc_fmri_present()
1756 return (topo_mod_seterrno(mod, EMOD_NOMEM)); in hc_fmri_present()
1760 if ((hwp = hc_walk_init(mod, node, hap->ha_fmri, hc_is_present, in hc_fmri_present()
1768 topo_mod_free(mod, hwp, sizeof (struct hc_walk)); in hc_fmri_present()
1776 topo_mod_free(mod, hap, sizeof (struct hc_args)); in hc_fmri_present()
1782 hc_is_replaced(topo_mod_t *mod, tnode_t *node, void *pdata) in hc_is_replaced() argument
1835 if (topo_mod_nvalloc(mod, &hap->ha_nvl, in hc_is_replaced()
1863 hc_fmri_replaced(topo_mod_t *mod, tnode_t *node, topo_version_t version, in hc_fmri_replaced() argument
1871 return (topo_mod_seterrno(mod, ETOPO_METHOD_VERNEW)); in hc_fmri_replaced()
1873 if ((hap = topo_mod_alloc(mod, sizeof (struct hc_args))) == NULL) in hc_fmri_replaced()
1874 return (topo_mod_seterrno(mod, EMOD_NOMEM)); in hc_fmri_replaced()
1878 if ((hwp = hc_walk_init(mod, node, hap->ha_fmri, hc_is_replaced, in hc_fmri_replaced()
1886 topo_mod_free(mod, hwp, sizeof (struct hc_walk)); in hc_fmri_replaced()
1894 topo_mod_free(mod, hap, sizeof (struct hc_args)); in hc_fmri_replaced()
1900 hc_unusable(topo_mod_t *mod, tnode_t *node, void *pdata) in hc_unusable() argument
1916 if (topo_mod_nvalloc(mod, &hap->ha_nvl, NV_UNIQUE_NAME) == 0) in hc_unusable()
1928 hc_fmri_unusable(topo_mod_t *mod, tnode_t *node, topo_version_t version, in hc_fmri_unusable() argument
1936 return (topo_mod_seterrno(mod, ETOPO_METHOD_VERNEW)); in hc_fmri_unusable()
1938 if ((hap = topo_mod_alloc(mod, sizeof (struct hc_args))) == NULL) in hc_fmri_unusable()
1939 return (topo_mod_seterrno(mod, EMOD_NOMEM)); in hc_fmri_unusable()
1943 if ((hwp = hc_walk_init(mod, node, hap->ha_fmri, hc_unusable, in hc_fmri_unusable()
1951 topo_mod_free(mod, hwp, sizeof (struct hc_walk)); in hc_fmri_unusable()
1959 topo_mod_free(mod, hap, sizeof (struct hc_args)); in hc_fmri_unusable()
1979 hc_fac_get(topo_mod_t *mod, tnode_t *node, void *pdata) in hc_fac_get() argument
1990 if (topo_node_facility(mod->tm_hdl, node, flp->fl_fac_type, in hc_fac_get()
1992 topo_mod_dprintf(mod, "hc_fac_get: topo_node_facility " in hc_fac_get()
2004 if ((err = cb(mod->tm_hdl, tmp->tf_node, in hc_fac_get()
2006 (void) topo_mod_seterrno(mod, err); in hc_fac_get()
2007 topo_mod_dprintf(mod, "hc_fac_get: callback failed: " in hc_fac_get()
2008 "%s\n ", topo_mod_errmsg(mod)); in hc_fac_get()
2016 topo_mod_free(mod, tmp, sizeof (topo_faclist_t)); in hc_fac_get()
2022 hc_fmri_facility(topo_mod_t *mod, tnode_t *node, topo_version_t version, in hc_fmri_facility() argument
2030 return (topo_mod_seterrno(mod, ETOPO_METHOD_VERNEW)); in hc_fmri_facility()
2032 if ((flp = topo_mod_alloc(mod, sizeof (struct fac_lookup))) == NULL) in hc_fmri_facility()
2033 return (topo_mod_seterrno(mod, EMOD_NOMEM)); in hc_fmri_facility()
2053 topo_mod_dprintf(mod, "hc_fmri_facility: failed to construct " in hc_fmri_facility()
2055 topo_mod_free(mod, flp, sizeof (struct fac_lookup)); in hc_fmri_facility()
2056 return (topo_mod_seterrno(mod, EMOD_METHOD_INVAL)); in hc_fmri_facility()
2060 if ((hwp = hc_walk_init(mod, node, flp->fl_rsrc, hc_fac_get, in hc_fmri_facility()
2068 topo_mod_free(mod, hwp, sizeof (struct hc_walk)); in hc_fmri_facility()
2070 topo_mod_dprintf(mod, "hc_fmri_facility: failed to initialize " in hc_fmri_facility()
2078 topo_mod_free(mod, flp, sizeof (struct fac_lookup)); in hc_fmri_facility()
2085 hc_expand(topo_mod_t *mod, tnode_t *node, void *pdata) in hc_expand() argument
2126 hc_fmri_expand(topo_mod_t *mod, tnode_t *node, topo_version_t version, in hc_fmri_expand() argument
2134 return (topo_mod_seterrno(mod, ETOPO_METHOD_VERNEW)); in hc_fmri_expand()
2136 if ((hap = topo_mod_alloc(mod, sizeof (struct hc_args))) == NULL) in hc_fmri_expand()
2137 return (topo_mod_seterrno(mod, EMOD_NOMEM)); in hc_fmri_expand()
2141 if ((hwp = hc_walk_init(mod, node, hap->ha_fmri, hc_expand, in hc_fmri_expand()
2153 topo_mod_free(mod, hwp, sizeof (struct hc_walk)); in hc_fmri_expand()
2158 topo_mod_free(mod, hap, sizeof (struct hc_args)); in hc_fmri_expand()
2164 hc_retire_subr(topo_mod_t *mod, tnode_t *node, void *pdata) in hc_retire_subr() argument
2169 topo_mod_dprintf(mod, "hc_retire_subr: invoking method %s\n", in hc_retire_subr()
2178 topo_mod_dprintf(mod, "hc_retire_subr: invoking method %s " in hc_retire_subr()
2185 hc_fmri_retire_subr(topo_mod_t *mod, tnode_t *node, char *method_name, in hc_fmri_retire_subr() argument
2194 return (topo_mod_seterrno(mod, ETOPO_METHOD_VERNEW)); in hc_fmri_retire_subr()
2196 if ((hap = topo_mod_alloc(mod, sizeof (struct hc_args))) == NULL) in hc_fmri_retire_subr()
2197 return (topo_mod_seterrno(mod, EMOD_NOMEM)); in hc_fmri_retire_subr()
2203 if ((hwp = hc_walk_init(mod, node, hap->ha_fmri, hc_retire_subr, in hc_fmri_retire_subr()
2215 topo_mod_free(mod, hwp, sizeof (struct hc_walk)); in hc_fmri_retire_subr()
2220 topo_mod_free(mod, hap, sizeof (struct hc_args)); in hc_fmri_retire_subr()
2226 hc_fmri_retire(topo_mod_t *mod, tnode_t *node, topo_version_t version, in hc_fmri_retire() argument
2229 return (hc_fmri_retire_subr(mod, node, TOPO_METH_RETIRE, in hc_fmri_retire()
2234 hc_fmri_unretire(topo_mod_t *mod, tnode_t *node, topo_version_t version, in hc_fmri_unretire() argument
2237 return (hc_fmri_retire_subr(mod, node, TOPO_METH_UNRETIRE, in hc_fmri_unretire()
2242 hc_fmri_service_state(topo_mod_t *mod, tnode_t *node, topo_version_t version, in hc_fmri_service_state() argument
2245 return (hc_fmri_retire_subr(mod, node, TOPO_METH_SERVICE_STATE, in hc_fmri_service_state()