Lines Matching refs:sdrr

95 ipmi_sdr_add_record(struct ipmi_intf *intf, struct sdr_record_list *sdrr)  in ipmi_sdr_add_record()  argument
102 int len = sdrr->length; in ipmi_sdr_add_record()
106 if (len < 1 || !sdrr->raw) { in ipmi_sdr_add_record()
132 sdr_rq->data[0] = sdrr->id & 0xFF; in ipmi_sdr_add_record()
133 sdr_rq->data[1] = (sdrr->id >> 8) & 0xFF; in ipmi_sdr_add_record()
134 sdr_rq->data[2] = sdrr->version; in ipmi_sdr_add_record()
135 sdr_rq->data[3] = sdrr->type; in ipmi_sdr_add_record()
136 sdr_rq->data[4] = sdrr->length; in ipmi_sdr_add_record()
161 memcpy(sdr_rq->data, sdrr->raw + i, data_len); in ipmi_sdr_add_record()
251 struct sdr_record_list *sdrr; in sdrr_get_records() local
253 sdrr = malloc(sizeof (struct sdr_record_list)); in sdrr_get_records()
254 if (sdrr == NULL) { in sdrr_get_records()
258 memset(sdrr, 0, sizeof (struct sdr_record_list)); in sdrr_get_records()
260 sdrr->id = header->id; in sdrr_get_records()
261 sdrr->version = header->version; in sdrr_get_records()
262 sdrr->type = header->type; in sdrr_get_records()
263 sdrr->length = header->length; in sdrr_get_records()
264 sdrr->raw = ipmi_sdr_get_record(intf, header, itr); in sdrr_get_records()
265 (void)ipmi_sdr_print_name_from_rawentry(intf, sdrr->id, sdrr->type,sdrr->raw); in sdrr_get_records()
269 queue->head = sdrr; in sdrr_get_records()
271 queue->tail->next = sdrr; in sdrr_get_records()
272 queue->tail = sdrr; in sdrr_get_records()
284 struct sdr_record_list *sdrr; in sdr_copy_to_sdrr() local
302 for (sdrr = sdrr_queue.head; sdrr != NULL; sdrr = sdrr_next) { in sdr_copy_to_sdrr()
303 sdrr_next = sdrr->next; in sdr_copy_to_sdrr()
304 rc = ipmi_sdr_add_record(intf, sdrr); in sdr_copy_to_sdrr()
306 lprintf(LOG_ERR, "Cannot add SDR ID 0x%04x to repository...", sdrr->id); in sdr_copy_to_sdrr()
308 free(sdrr); in sdr_copy_to_sdrr()
309 sdrr = NULL; in sdr_copy_to_sdrr()
590 struct sdr_record_list *sdrr; in ipmi_sdr_read_records() local
598 sdrr = malloc(sizeof(*sdrr)); in ipmi_sdr_read_records()
599 if (sdrr == NULL) { in ipmi_sdr_read_records()
604 sdrr->id = (binHdr[1] << 8) | binHdr[0]; // LS Byte first in ipmi_sdr_read_records()
605 sdrr->version = binHdr[2]; in ipmi_sdr_read_records()
606 sdrr->type = binHdr[3]; in ipmi_sdr_read_records()
607 sdrr->length = binHdr[4]; in ipmi_sdr_read_records()
609 if ((sdrr->raw = malloc(sdrr->length)) == NULL) { in ipmi_sdr_read_records()
611 free(sdrr); in ipmi_sdr_read_records()
612 sdrr = NULL; in ipmi_sdr_read_records()
617 if (read(fd, sdrr->raw, sdrr->length) != sdrr->length) { in ipmi_sdr_read_records()
619 free(sdrr->raw); in ipmi_sdr_read_records()
620 sdrr->raw = NULL; in ipmi_sdr_read_records()
621 free(sdrr); in ipmi_sdr_read_records()
622 sdrr = NULL; in ipmi_sdr_read_records()
629 queue->head = sdrr; in ipmi_sdr_read_records()
631 queue->tail->next = sdrr; in ipmi_sdr_read_records()
632 queue->tail = sdrr; in ipmi_sdr_read_records()
643 struct sdr_record_list *sdrr; in ipmi_sdr_add_from_file() local
656 for (sdrr = sdrr_queue.head; sdrr != NULL; sdrr = sdrr_next) { in ipmi_sdr_add_from_file()
657 sdrr_next = sdrr->next; in ipmi_sdr_add_from_file()
658 rc = ipmi_sdr_add_record(intf, sdrr); in ipmi_sdr_add_from_file()
660 lprintf(LOG_ERR, "Cannot add SDR ID 0x%04x to repository...", sdrr->id); in ipmi_sdr_add_from_file()
662 free(sdrr); in ipmi_sdr_add_from_file()
663 sdrr = NULL; in ipmi_sdr_add_from_file()