add patch for DC Output and DC Load records

from Fredrik Ohrn
This commit is contained in:
Duncan Laurie 2003-12-23 02:10:09 +00:00
parent 43db890016
commit 43a65a47b7
2 changed files with 47 additions and 9 deletions

View File

@ -147,10 +147,24 @@ static const char * combined_voltage_desc[] __attribute__((unused)) = {
}; };
struct fru_multirec_dcoutput { struct fru_multirec_dcoutput {
}; unsigned char output_number : 4, __reserved : 3, standby : 1;
short nominal_voltage;
short max_neg_dev;
short max_pos_dev;
unsigned short ripple_and_noise;
unsigned short min_current;
unsigned short max_current;
} __attribute__ ((packed));
struct fru_multirec_dcload { struct fru_multirec_dcload {
}; unsigned char output_number : 4, __reserved : 4;
short nominal_voltage;
short min_voltage;
short max_voltage;
unsigned short ripple_and_noise;
unsigned short min_current;
unsigned short max_current;
} __attribute__ ((packed));
static const char * chassis_type_desc[] __attribute__((unused)) = { static const char * chassis_type_desc[] __attribute__((unused)) = {
"Unspecified", "Other", "Unknown", "Unspecified", "Other", "Unknown",

View File

@ -279,12 +279,15 @@ static void ipmi_fru_print(struct ipmi_intf * intf, unsigned char id)
{ {
struct fru_multirec_header * h; struct fru_multirec_header * h;
struct fru_multirec_powersupply * ps; struct fru_multirec_powersupply * ps;
struct fru_multirec_dcoutput * dc;
struct fru_multirec_dcload * dl;
i = header.offset.multi; i = header.offset.multi;
h = (struct fru_multirec_header *) (fru_data + i);
do do
{ {
h = (struct fru_multirec_header *) (fru_data + i);
switch (h->type) switch (h->type)
{ {
case FRU_RECORD_TYPE_POWER_SUPPLY_INFORMATION: case FRU_RECORD_TYPE_POWER_SUPPLY_INFORMATION:
@ -320,13 +323,34 @@ static void ipmi_fru_print(struct ipmi_intf * intf, unsigned char id)
break; break;
//default: case FRU_RECORD_TYPE_DC_OUTPUT:
// printf ("Not supported yet!\n"); dc = (struct fru_multirec_dcoutput *) (fru_data + i + sizeof (struct fru_multirec_header));
printf (" DC Output Record\n");
printf (" Output Number : %d\n", dc->output_number);
printf (" Standby power : %s\n", dc->standby ? "Yes" : "No");
printf (" Nominal voltage : %.2f V\n", (double) dc->nominal_voltage / 100);
printf (" Max negative deviation : %.2f V\n", (double) dc->max_neg_dev / 100);
printf (" Max positive deviation : %.2f V\n", (double) dc->max_pos_dev / 100);
printf (" Ripple and noise pk-pk : %d mV\n", dc->ripple_and_noise);
printf (" Minimum current draw : %.3f A\n", (double) dc->min_current / 1000);
printf (" Maximum current draw : %.3f A\n", (double) dc->max_current / 1000);
break;
case FRU_RECORD_TYPE_DC_LOAD:
dl = (struct fru_multirec_dcload *) (fru_data + i + sizeof (struct fru_multirec_header));
printf (" DC Load Record\n");
printf (" Output Number : %d\n", dl->output_number);
printf (" Nominal voltage : %.2f V\n", (double) dl->nominal_voltage / 100);
printf (" Min voltage allowed : %.2f V\n", (double) dl->min_voltage / 100);
printf (" Max voltage allowed : %.2f V\n", (double) dl->max_voltage / 100);
printf (" Ripple and noise pk-pk : %d mV\n", dl->ripple_and_noise);
printf (" Minimum current load : %.3f A\n", (double) dl->min_current / 1000);
printf (" Maximum current load : %.3f A\n", (double) dl->max_current / 1000);
break;
} }
//printf ("len: %d\n", h->len); i += h->len + sizeof (struct fru_multirec_header);
i += h->len;
h = (struct fru_multirec_header *) (fru_data + i + sizeof (struct fru_multirec_header));
if (h->len == 0) break;
} while (!(h->format & 0x80)); } while (!(h->format & 0x80));
} }
} }