ID: 3608763 - 'lib/ipmi_sdr.c' - display hex values of Sensors

Commit adds the hex value for the sensor type to displays so that the user
can correlate sensor type values with their hex values without having to
look them up in the IPMI spec.

Commit for Dan Gora
This commit is contained in:
Zdenek Styblik 2013-04-09 08:38:31 +00:00
parent 4aae41904d
commit 8afb3c315b

View File

@ -1702,8 +1702,9 @@ ipmi_sdr_print_sensor_fc(struct ipmi_intf *intf,
if (!IS_THRESHOLD_SENSOR(sensor)) { if (!IS_THRESHOLD_SENSOR(sensor)) {
/* Discrete */ /* Discrete */
printf(" Sensor Type (Discrete): %s\n", printf(" Sensor Type (Discrete): %s (0x%02x)\n",
ipmi_sdr_get_sensor_type_desc(sensor->sensor.type)); ipmi_sdr_get_sensor_type_desc(sensor->sensor.type),
sensor->sensor.type);
lprintf(LOG_DEBUG, " Event Type Code : 0x%02x", lprintf(LOG_DEBUG, " Event Type Code : 0x%02x",
sensor->event_type); sensor->event_type);
@ -1763,8 +1764,9 @@ ipmi_sdr_print_sensor_fc(struct ipmi_intf *intf,
return 0; /* done */ return 0; /* done */
} }
printf(" Sensor Type (Threshold) : %s\n", printf(" Sensor Type (Threshold) : %s (0x%02x)\n",
ipmi_sdr_get_sensor_type_desc(sensor->sensor.type)); ipmi_sdr_get_sensor_type_desc(sensor->sensor.type),
sensor->sensor.type);
printf(" Sensor Reading : "); printf(" Sensor Reading : ");
if (sr->s_reading_valid) { if (sr->s_reading_valid) {
@ -2087,8 +2089,9 @@ ipmi_sdr_print_sensor_eventonly(struct ipmi_intf *intf,
printf("Entity ID : %d.%d (%s)\n", printf("Entity ID : %d.%d (%s)\n",
sensor->entity.id, sensor->entity.instance, sensor->entity.id, sensor->entity.instance,
val2str(sensor->entity.id, entity_id_vals)); val2str(sensor->entity.id, entity_id_vals));
printf("Sensor Type : %s\n", printf("Sensor Type : %s (0x%02x)\n",
ipmi_sdr_get_sensor_type_desc(sensor->sensor_type)); ipmi_sdr_get_sensor_type_desc(sensor->sensor_type),
sensor->sensor_type);
lprintf(LOG_DEBUG, "Event Type Code : 0x%02x", lprintf(LOG_DEBUG, "Event Type Code : 0x%02x",
sensor->event_type); sensor->event_type);
printf("\n"); printf("\n");
@ -4436,8 +4439,9 @@ ipmi_sdr_print_type(struct ipmi_intf *intf, char *type)
strncasecmp(type, "list", 4) == 0) { strncasecmp(type, "list", 4) == 0) {
printf("Sensor Types:\n"); printf("Sensor Types:\n");
for (x = 1; x < SENSOR_TYPE_MAX; x += 2) { for (x = 1; x < SENSOR_TYPE_MAX; x += 2) {
printf("\t%-25s %-25s\n", printf("\t%-25s (0x%02x) %-25s (0x%02x)\n",
sensor_type_desc[x], sensor_type_desc[x + 1]); sensor_type_desc[x], x,
sensor_type_desc[x + 1], x + 1);
} }
return 0; return 0;
} }
@ -4462,9 +4466,9 @@ ipmi_sdr_print_type(struct ipmi_intf *intf, char *type)
if (sensor_type != x) { if (sensor_type != x) {
printf("Sensor Types:\n"); printf("Sensor Types:\n");
for (x = 1; x < SENSOR_TYPE_MAX; x += 2) { for (x = 1; x < SENSOR_TYPE_MAX; x += 2) {
printf("\t%-25s %-25s\n", printf("\t%-25s (0x%02x) %-25s (0x%02x)\n",
sensor_type_desc[x], sensor_type_desc[x], x,
sensor_type_desc[x + 1]); sensor_type_desc[x + 1], x + 1);
} }
return 0; return 0;
} }