Lines Matching defs:ihp

70 ipmi_entity_add_assoc(ipmi_handle_t *ihp, ipmi_entity_impl_t *eip,
79 if ((cp = ipmi_hash_lookup(ihp->ih_entities, &search)) == NULL) {
80 if ((cp = ipmi_zalloc(ihp,
87 ipmi_hash_insert(ihp->ih_entities, cp);
194 ipmi_entity_visit(ipmi_handle_t *ihp, const char *name, ipmi_sdr_t *sdrp,
209 if ((eip = ipmi_hash_lookup(ihp->ih_entities, &search)) == NULL) {
210 if ((eip = ipmi_zalloc(ihp,
217 ipmi_hash_insert(ihp->ih_entities, eip);
237 if (ipmi_entity_add_assoc(ihp, eip,
249 if (ipmi_entity_add_assoc(ihp, eip,
262 if (ipmi_entity_add_assoc(ihp, eip, type,
268 if ((esp = ipmi_zalloc(ihp,
287 ipmi_entity_present_sdr(ipmi_handle_t *ihp, ipmi_sdr_t *sdrp,
354 if ((srp = ipmi_get_sensor_reading(ihp, number)) == NULL) {
355 if (ipmi_errno(ihp) == EIPMI_NOT_PRESENT) {
401 ipmi_entity_present(ipmi_handle_t *ihp, ipmi_entity_t *ep, boolean_t *valp)
478 if ((srp = ipmi_get_sensor_reading(ihp, number)) == NULL) {
479 if (ipmi_errno(ihp) == EIPMI_NOT_PRESENT) {
513 if ((srp = ipmi_get_sensor_reading(ihp, number)) == NULL) {
514 if (ipmi_errno(ihp) == EIPMI_NOT_PRESENT)
532 if (ipmi_entity_present(ihp, &cp->ie_entity, valp) != 0)
549 if (ipmi_fru_read(ihp, frup, &frudata) >= 0) {
550 ipmi_free(ihp, frudata);
555 if (ipmi_errno(ihp) != EIPMI_NOT_PRESENT)
564 ipmi_entity_refresh(ipmi_handle_t *ihp)
566 if (ipmi_hash_first(ihp->ih_entities) != NULL &&
567 !ipmi_sdr_changed(ihp))
570 if (ipmi_sdr_iter(ihp, ipmi_entity_visit, NULL) != 0)
577 ipmi_entity_iter(ipmi_handle_t *ihp, int (*func)(ipmi_handle_t *,
583 if (ipmi_entity_refresh(ihp) != 0)
586 for (eip = ipmi_hash_first(ihp->ih_entities); eip != NULL;
587 eip = ipmi_hash_next(ihp->ih_entities, eip)) {
591 if ((ret = func(ihp, &eip->ie_entity, data)) != 0)
599 ipmi_entity_iter_sdr(ipmi_handle_t *ihp, ipmi_entity_t *ep,
610 if ((ret = func(ihp, ep, isp->ies_name,
619 ipmi_entity_iter_children(ipmi_handle_t *ihp, ipmi_entity_t *ep,
629 if ((ret = func(ihp, &cp->ie_entity, data)) != 0)
637 ipmi_entity_parent(ipmi_handle_t *ihp, ipmi_entity_t *ep)
643 (void) ipmi_set_error(ihp, EIPMI_NOT_PRESENT, NULL);
651 ipmi_entity_lookup(ipmi_handle_t *ihp, uint8_t type, uint8_t instance)
656 if (ipmi_entity_refresh(ihp) != 0)
662 if ((eip = ipmi_hash_lookup(ihp->ih_entities, &search)) == NULL) {
663 (void) ipmi_set_error(ihp, EIPMI_NOT_PRESENT, NULL);
671 ipmi_entity_lookup_sdr(ipmi_handle_t *ihp, const char *name)
677 if ((sdrp = ipmi_sdr_lookup(ihp, name)) == NULL)
681 (void) ipmi_set_error(ihp, EIPMI_NOT_PRESENT,
686 return (ipmi_entity_lookup(ihp, id, instance));
719 ipmi_entity_init(ipmi_handle_t *ihp)
721 if ((ihp->ih_entities = ipmi_hash_create(ihp,
732 ipmi_entity_clear(ipmi_handle_t *ihp)
737 while ((eip = ipmi_hash_first(ihp->ih_entities)) != NULL) {
740 ipmi_free(ihp, esp);
742 ipmi_hash_remove(ihp->ih_entities, eip);
743 ipmi_free(ihp, eip);
748 ipmi_entity_fini(ipmi_handle_t *ihp)
750 if (ihp->ih_entities != NULL) {
751 ipmi_entity_clear(ihp);
752 ipmi_hash_destroy(ihp->ih_entities);