Do not use readings for sensors with Sensor Scanning bit cleared

This commit is contained in:
Jordan Hargrave 2006-10-25 03:21:57 +00:00
parent e7f7209c32
commit e3c97ddd3d
2 changed files with 9 additions and 8 deletions

View File

@ -1038,14 +1038,6 @@ ipmi_sdr_print_sensor_full(struct ipmi_intf *intf,
} else if (IS_SCANNING_DISABLED(rsp->data[1])) {
/* Sensor Scanning Disabled */
validread = 0;
if (rsp->data[0] != 0) {
/* we might still get a valid reading */
val =
sdr_convert_sensor_reading(sensor,
rsp->data[0]);
if (val != 0.0)
validread = 1;
}
} else if (rsp->data[0] != 0) {
/* convert RAW reading into units */
val = sdr_convert_sensor_reading(sensor, rsp->data[0]);

View File

@ -43,6 +43,7 @@
extern int verbose;
#define SCANNING_DISABLED 0x40
#define READING_UNAVAILABLE 0x20
static
@ -110,6 +111,8 @@ ipmi_sensor_print_full_discrete(struct ipmi_intf *intf,
return -1;
} else if (rsp->ccode > 0 || (rsp->data[1] & READING_UNAVAILABLE)) {
validread = 0;
} else if (!(rsp->data[1] & SCANNING_DISABLED)) {
validread = 0;
} else {
/* convert RAW reading into units */
val = rsp->data[0];
@ -190,6 +193,8 @@ ipmi_sensor_print_full_analog(struct ipmi_intf *intf,
return -1;
} else if (rsp->ccode || (rsp->data[1] & READING_UNAVAILABLE)) {
validread = 0;
} else if (!(rsp->data[1] & SCANNING_DISABLED)) {
validread = 0;
} else {
/* convert RAW reading into units */
val = (rsp->data[0] > 0)
@ -427,6 +432,8 @@ ipmi_sensor_print_compact(struct ipmi_intf *intf,
return -1;
} else if (rsp->ccode || (rsp->data[1] & READING_UNAVAILABLE)) {
validread = 0;
} else if (!(rsp->data[1] & SCANNING_DISABLED)) {
validread = 0;
} else {
/* convert RAW reading into units */
val = rsp->data[0];
@ -771,6 +778,8 @@ ipmi_sensor_get_reading(struct ipmi_intf *intf, int argc, char **argv)
continue;
} else if (rsp->data[1] & READING_UNAVAILABLE) {
continue;
} else if (!(rsp->data[1] & SCANNING_DISABLED)) {
continue;
} else if (rsp->data[0] > 0) {
/* convert RAW reading into units */
val = sdr_convert_sensor_reading(sdr->record.full, rsp->data[0]);