I've noticed on our systems that ipmievd does not print the correct
logging message for drive bay sensors. The drive bays are Compact Sensor
(type 2) in the SDR, and indicate that this is a shared record (Share
Count = 8).
The SDR has a single entry for drive slots, sensor #80 with share count
= 8. The next sensor number in the SDR is #90. When a drive is
pulled/inserted, the SEL will contain entries for sensor numbers #8x.
ipmievd will only print correctly for sensor #80 (Slot 0). I've traced
this down to ipmi_sdr_find_sdr_by_numtype in lib/ipmi_sdr.c. This
function only searches for an exact sensor number to SDR match.

I'm proposing to change ipmi_sdr.c to support reverse lookup of sensor
range for shared compact sensors in ipmi_sdr_find_sdr_by_numtype().

Signed-off-by: Jordan Hargrave <jordan_hargr...@dell.com>

diff -uNpb lib/ipmi_sdr.c.orig lib/ipmi_sdr.c
--- lib/ipmi_sdr.c.orig 2009-10-14 12:13:57.000000000 -0500
+++ lib/ipmi_sdr.c      2009-10-14 12:17:26.000000000 -0500
@@ -2942,7 +2942,8 @@ ipmi_sdr_find_sdr_bynumtype(struct ipmi_
                                return e;
                        break;
                case SDR_RECORD_TYPE_COMPACT_SENSOR:
-                       if (e->record.compact->keys.sensor_num == num &&
+                       if (e->record.compact->keys.sensor_num <= num &&
+                           e->record.compact->keys.sensor_num +
e->record.compact->share.count > num &&
                            e->record.compact->keys.owner_id == (gen_id
& 0x00ff) &&
                            e->record.compact->sensor.type == type)
                                return e;
@@ -2986,7 +2987,8 @@ ipmi_sdr_find_sdr_bynumtype(struct ipmi_
                case SDR_RECORD_TYPE_COMPACT_SENSOR:
                        sdrr->record.compact =
                            (struct sdr_record_compact_sensor *) rec;
-                       if (sdrr->record.compact->keys.sensor_num == num
+                       if (sdrr->record.compact->keys.sensor_num <= num
+                           && sdrr->record.compact->keys.sensor_num +
sdrr->record.compact->share.count > num
                            && sdrr->record.compact->keys.owner_id ==
(gen_id & 0x00ff)
                            && sdrr->record.compact->sensor.type ==
type)
                                found = 1;



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ipmitool-devel mailing list
Ipmitool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel

Reply via email to