Lines Matching full:sdr
125 uint8_t sdr[MAX_SDR_SIZE]; member
213 IPMISdr sdr; member
316 static void sdr_inc_reservation(IPMISdr *sdr) in sdr_inc_reservation() argument
318 sdr->reservation++; in sdr_inc_reservation()
319 if (sdr->reservation == 0) { in sdr_inc_reservation()
320 sdr->reservation = 1; in sdr_inc_reservation()
329 (struct ipmi_sdr_header *) &ibs->sdr.sdr[ibs->sdr.next_free]; in sdr_add_entry()
339 if (ibs->sdr.next_free + len > MAX_SDR_SIZE) { in sdr_add_entry()
340 ibs->sdr.overflow = 1; in sdr_add_entry()
345 sdrh->rec_id[0] = ibs->sdr.next_rec_id & 0xff; in sdr_add_entry()
346 sdrh->rec_id[1] = (ibs->sdr.next_rec_id >> 8) & 0xff; in sdr_add_entry()
350 *recid = ibs->sdr.next_rec_id; in sdr_add_entry()
352 ibs->sdr.next_rec_id++; in sdr_add_entry()
353 set_timestamp(ibs, ibs->sdr.last_addition); in sdr_add_entry()
354 ibs->sdr.next_free += len; in sdr_add_entry()
355 sdr_inc_reservation(&ibs->sdr); in sdr_add_entry()
359 static int sdr_find_entry(IPMISdr *sdr, uint16_t recid, in sdr_find_entry() argument
364 while (pos < sdr->next_free) { in sdr_find_entry()
366 (struct ipmi_sdr_header *) &sdr->sdr[pos]; in sdr_find_entry()
372 if (nextpos >= sdr->next_free) { in sdr_find_entry()
375 *nextrec = (sdr->sdr[nextpos] | in sdr_find_entry()
376 (sdr->sdr[nextpos + 1] << 8)); in sdr_find_entry()
388 const struct ipmi_sdr_compact **sdr, uint16_t *nextrec) in ipmi_bmc_sdr_find() argument
395 if (sdr_find_entry(&ibs->sdr, recid, &pos, nextrec)) { in ipmi_bmc_sdr_find()
399 *sdr = (const struct ipmi_sdr_compact *) &ibs->sdr.sdr[pos]; in ipmi_bmc_sdr_find()
563 for (i = 0; !sdr_find_entry(&s->sdr, i, &pos, NULL); i++) { in ipmi_init_sensors_from_sdrs()
564 struct ipmi_sdr_compact *sdr = in ipmi_init_sensors_from_sdrs() local
565 (struct ipmi_sdr_compact *) &s->sdr.sdr[pos]; in ipmi_init_sensors_from_sdrs()
566 unsigned int len = sdr->header.rec_length; in ipmi_init_sensors_from_sdrs()
571 if (sdr->header.rec_type != IPMI_SDR_COMPACT_TYPE) { in ipmi_init_sensors_from_sdrs()
572 continue; /* Not a sensor SDR we set from */ in ipmi_init_sensors_from_sdrs()
575 if (sdr->sensor_owner_number >= MAX_SENSORS) { in ipmi_init_sensors_from_sdrs()
578 sens = s->sensors + sdr->sensor_owner_number; in ipmi_init_sensors_from_sdrs()
581 IPMI_SENSOR_SET_SCAN_ON(sens, (sdr->sensor_init >> 6) & 1); in ipmi_init_sensors_from_sdrs()
582 IPMI_SENSOR_SET_EVENTS_ON(sens, (sdr->sensor_init >> 5) & 1); in ipmi_init_sensors_from_sdrs()
583 sens->assert_suppt = sdr->assert_mask[0] | (sdr->assert_mask[1] << 8); in ipmi_init_sensors_from_sdrs()
585 sdr->deassert_mask[0] | (sdr->deassert_mask[1] << 8); in ipmi_init_sensors_from_sdrs()
587 sdr->discrete_mask[0] | (sdr->discrete_mask[1] << 8); in ipmi_init_sensors_from_sdrs()
588 sens->sensor_type = sdr->sensor_type; in ipmi_init_sensors_from_sdrs()
589 sens->evt_reading_type_code = sdr->reading_type & 0x7f; in ipmi_init_sensors_from_sdrs()
838 rsp_buffer_push(rsp, 0x07); /* sensor, SDR, and SEL. */ in get_device_id()
1229 rsp_buffer_push(rsp, ibs->sdr.next_rec_id & 0xff); in get_sdr_rep_info()
1230 rsp_buffer_push(rsp, (ibs->sdr.next_rec_id >> 8) & 0xff); in get_sdr_rep_info()
1231 rsp_buffer_push(rsp, (MAX_SDR_SIZE - ibs->sdr.next_free) & 0xff); in get_sdr_rep_info()
1232 rsp_buffer_push(rsp, ((MAX_SDR_SIZE - ibs->sdr.next_free) >> 8) & 0xff); in get_sdr_rep_info()
1234 rsp_buffer_push(rsp, ibs->sdr.last_addition[i]); in get_sdr_rep_info()
1237 rsp_buffer_push(rsp, ibs->sdr.last_clear[i]); in get_sdr_rep_info()
1240 rsp_buffer_push(rsp, (ibs->sdr.overflow << 7) | 0x22); in get_sdr_rep_info()
1247 rsp_buffer_push(rsp, ibs->sdr.reservation & 0xff); in reserve_sdr_rep()
1248 rsp_buffer_push(rsp, (ibs->sdr.reservation >> 8) & 0xff); in reserve_sdr_rep()
1260 if ((cmd[2] | (cmd[3] << 8)) != ibs->sdr.reservation) { in get_sdr()
1267 if (sdr_find_entry(&ibs->sdr, cmd[4] | (cmd[5] << 8), in get_sdr()
1273 sdrh = (struct ipmi_sdr_header *) &ibs->sdr.sdr[pos]; in get_sdr()
1292 rsp_buffer_pushmore(rsp, ibs->sdr.sdr + pos + cmd[6], cmd[7]); in get_sdr()
1314 if ((cmd[2] | (cmd[3] << 8)) != ibs->sdr.reservation) { in clear_sdr_rep()
1324 ibs->sdr.next_free = 0; in clear_sdr_rep()
1325 ibs->sdr.overflow = 0; in clear_sdr_rep()
1326 set_timestamp(ibs, ibs->sdr.last_clear); in clear_sdr_rep()
1328 sdr_inc_reservation(&ibs->sdr); in clear_sdr_rep()
1529 set_timestamp(ibs, ibs->sdr.last_clear); in clear_sel()
2076 error_report("failed to load sdr file '%s'", ibs->sdr_filename); in ipmi_sdr_init()
2175 ibs->sdr.last_addition[i] = 0xff; in ipmi_sim_realize()
2176 ibs->sdr.last_clear[i] = 0xff; in ipmi_sim_realize()