Lines Matching refs:mod

124 disk_set_props(topo_mod_t *mod, tnode_t *parent,
134 topo_mod_dprintf(mod, "disk_set_props: "
139 topo_mod_dprintf(mod, "disk_set_props: "
146 topo_mod_dprintf(mod, "disk_set_props: "
151 topo_mod_dprintf(mod, "disk_set_props: "
159 topo_mod_dprintf(mod, "disk_set_props: "
166 topo_mod_dprintf(mod, "disk_set_props: "
178 if ((asru = topo_mod_devfmri(mod, FM_DEV_SCHEME_VERSION,
181 topo_mod_dprintf(mod, "disk_set_props: "
186 topo_mod_dprintf(mod, "disk_set_props: "
193 topo_mod_dprintf(mod, "disk_set_props: "
200 topo_mod_dprintf(mod, "disk_set_props: "
207 topo_mod_dprintf(mod, "disk_set_props: "
216 topo_mod_dprintf(mod, "disk_set_props: "
226 topo_mod_dprintf(mod, "disk_set_props: "
235 topo_mod_dprintf(mod, "disk_set_props: "
242 topo_mod_dprintf(mod, "disk_set_props: "
249 topo_mod_dprintf(mod, "disk_set_props: "
256 topo_mod_dprintf(mod, "disk_set_props: "
263 topo_mod_dprintf(mod, "disk_set_props: "
272 topo_mod_strfree(mod, label);
277 error: err = topo_mod_seterrno(mod, err);
285 disk_trim_whitespace(topo_mod_t *mod, const char *begin)
302 if ((buf = topo_mod_alloc(mod, count + 1)) == NULL)
316 disk_auth_clean(topo_mod_t *mod, const char *str)
323 if ((buf = topo_mod_strdup(mod, str)) == NULL)
334 disk_tnode_create(topo_mod_t *mod, tnode_t *parent,
346 mfg = disk_auth_clean(mod, dnode->ddn_mfg);
347 model = disk_auth_clean(mod, dnode->ddn_model);
348 firm = disk_auth_clean(mod, dnode->ddn_firm);
349 serial = disk_auth_clean(mod, dnode->ddn_serial);
357 if ((part = topo_mod_alloc(mod, len)) != NULL)
362 auth = topo_mod_auth(mod, parent);
363 fmri = topo_mod_hcfmri(mod, parent, FM_HC_SCHEME_VERSION, name, i, NULL,
367 topo_mod_strfree(mod, part);
368 topo_mod_strfree(mod, mfg);
369 topo_mod_strfree(mod, model);
370 topo_mod_strfree(mod, firm);
371 topo_mod_strfree(mod, serial);
374 topo_mod_dprintf(mod, "disk_tnode_create: "
377 name, i, topo_strerror(topo_mod_errno(mod)));
381 if ((dtn = topo_node_bind(mod, parent, name, i, fmri)) == NULL) {
382 if (topo_mod_errno(mod) == EMOD_NODE_BOUND) {
389 topo_mod_dprintf(mod, "disk_tnode_create: "
392 name, i, topo_strerror(topo_mod_errno(mod)));
399 if (disk_set_props(mod, parent, dtn, dnode) != 0) {
400 topo_mod_dprintf(mod, "disk_tnode_create: "
403 name, i, topo_strerror(topo_mod_errno(mod)));
412 disk_declare(topo_mod_t *mod, tnode_t *parent, dev_di_node_t *dnode,
418 rval = disk_tnode_create(mod, parent, dnode, DISK, 0, &dtn);
422 topo_mod_dprintf(mod, "disk_declare: "
424 topo_strerror(topo_mod_errno(mod)));
429 if (topo_method_register(mod, dtn, disk_methods) != 0) {
430 topo_mod_dprintf(mod, "disk_declare: "
432 topo_strerror(topo_mod_errno(mod)));
442 disk_declare_path(topo_mod_t *mod, tnode_t *parent, topo_list_t *listp,
459 return (disk_declare(mod, parent, dnode, NULL));
463 topo_mod_dprintf(mod, "disk_declare_path: "
469 disk_declare_addr(topo_mod_t *mod, tnode_t *parent, topo_list_t *listp,
485 topo_mod_dprintf(mod, "disk_declare_addr: "
487 return (disk_declare(mod, parent, dnode,
493 topo_mod_dprintf(mod, "disk_declare_addr: "
504 disk_declare_non_enumerated(topo_mod_t *mod, tnode_t *parent, tnode_t **childp)
506 return (disk_declare(mod, parent, NULL, childp));
514 topo_mod_t *mod = cbp->dcb_mod;
529 dnode->ddn_lpath = topo_mod_strdup(mod, ctds ? ctds + 1 : devpath);
537 dev_di_node_free(topo_mod_t *mod, dev_di_node_t *dnode)
543 topo_mod_strfree(mod, dnode->ddn_devid);
546 topo_mod_strfree(mod, dnode->ddn_ppath[i]);
547 topo_mod_strfree(mod, dnode->ddn_target_port[i]);
548 topo_mod_strfree(mod, dnode->ddn_attached_port[i]);
549 topo_mod_strfree(mod, dnode->ddn_bridge_port[i]);
551 topo_mod_free(mod, dnode->ddn_ppath,
553 topo_mod_free(mod, dnode->ddn_target_port,
555 topo_mod_free(mod, dnode->ddn_attached_port,
557 topo_mod_free(mod, dnode->ddn_bridge_port,
559 topo_mod_strfree(mod, dnode->ddn_dpath);
560 topo_mod_strfree(mod, dnode->ddn_lpath);
562 topo_mod_strfree(mod, dnode->ddn_mfg);
563 topo_mod_strfree(mod, dnode->ddn_model);
564 topo_mod_strfree(mod, dnode->ddn_serial);
565 topo_mod_strfree(mod, dnode->ddn_firm);
566 topo_mod_strfree(mod, dnode->ddn_cap);
569 topo_mod_free(mod, dnode, sizeof (dev_di_node_t));
575 topo_mod_t *mod = cbp->dcb_mod;
602 topo_mod_dprintf(mod, "dev_di_node_add: "
609 if ((dnode = topo_mod_zalloc(mod, sizeof (dev_di_node_t))) == NULL)
614 dnode->ddn_devid = topo_mod_strdup(mod, devid);
621 (void) topo_mod_seterrno(mod, errno);
625 dnode->ddn_dpath = topo_mod_strdup(mod, path);
656 topo_mod_zalloc(mod, sizeof (char *))) == NULL)
660 if ((dnode->ddn_ppath[0] = topo_mod_strdup(mod,
664 if ((dnode->ddn_target_port = topo_mod_zalloc(mod,
668 if ((dnode->ddn_attached_port = topo_mod_zalloc(mod,
672 if ((dnode->ddn_bridge_port = topo_mod_zalloc(mod,
680 topo_mod_strdup(mod,
690 topo_mod_strdup(mod,
700 topo_mod_strdup(mod,
708 if ((dnode->ddn_ppath = topo_mod_zalloc(mod,
714 if ((dnode->ddn_target_port = topo_mod_zalloc(mod,
718 if ((dnode->ddn_attached_port = topo_mod_zalloc(mod,
722 if ((dnode->ddn_bridge_port = topo_mod_zalloc(mod,
731 (void) topo_mod_seterrno(mod, errno);
736 topo_mod_strdup(mod, path);
744 topo_mod_strdup(mod,
753 topo_mod_strdup(mod,
762 topo_mod_strdup(mod,
782 if ((minorpath = topo_mod_alloc(mod, mlen)) == NULL)
790 topo_mod_free(mod, minorpath, mlen);
792 topo_mod_dprintf(mod, "dev_di_node_add: "
803 if ((dnode->ddn_mfg = disk_trim_whitespace(mod, s)) == NULL)
808 if ((dnode->ddn_model = disk_trim_whitespace(mod, s)) == NULL)
813 if ((dnode->ddn_firm = disk_trim_whitespace(mod, s)) == NULL)
818 if ((dnode->ddn_serial = disk_trim_whitespace(mod, s)) == NULL)
835 if ((dnode->ddn_cap = topo_mod_strdup(mod, lentry)) == NULL)
839 topo_mod_dprintf(mod, "dev_di_node_add: "
841 topo_mod_dprintf(mod, " "
844 topo_mod_dprintf(mod, " "
851 dev_di_node_free(mod, dnode);
885 dev_list_gather(topo_mod_t *mod, topo_list_t *listp)
891 if ((devtree = topo_mod_devinfo(mod)) == DI_NODE_NIL) {
892 topo_mod_dprintf(mod, "disk_list_gather: "
898 topo_mod_dprintf(mod, "disk_list_gather: "
903 dcb.dcb_mod = mod;
917 dev_list_free(topo_mod_t *mod, topo_list_t *listp)
924 dev_di_node_free(mod, dnode);
951 disk_status(topo_mod_t *mod, tnode_t *nodep, topo_version_t vers,
963 return (topo_mod_seterrno(mod, EMOD_VER_NEW));
979 return (topo_mod_seterrno(mod, EMOD_METHOD_NOTSUP));
987 if ((fullpath = topo_mod_alloc(mod, pathlen)) == NULL)
988 return (topo_mod_seterrno(mod, EMOD_NOMEM));
993 topo_mod_strfree(mod, devpath);
998 topo_mod_free(mod, fullpath, pathlen);
999 return (topo_mod_seterrno(mod, err == EDS_NOMEM ?
1004 topo_mod_free(mod, fullpath, pathlen);
1010 return (topo_mod_seterrno(mod, err));