mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-09-03 07:45:30 +00:00
sensors support for ipmi. Includes limited support for
add'l dummy adaps in libsensors git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1606 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
@@ -298,6 +298,8 @@ const char *sensors_get_adapter_name(int bus_nr)
|
|||||||
int i;
|
int i;
|
||||||
if (bus_nr == SENSORS_CHIP_NAME_BUS_ISA)
|
if (bus_nr == SENSORS_CHIP_NAME_BUS_ISA)
|
||||||
return "ISA adapter";
|
return "ISA adapter";
|
||||||
|
if (bus_nr == SENSORS_CHIP_NAME_BUS_DUMMY)
|
||||||
|
return "Dummy adapter";
|
||||||
for (i=0; i < sensors_proc_bus_count; i++)
|
for (i=0; i < sensors_proc_bus_count; i++)
|
||||||
if (sensors_proc_bus[i].number == bus_nr)
|
if (sensors_proc_bus[i].number == bus_nr)
|
||||||
return sensors_proc_bus[i].adapter;
|
return sensors_proc_bus[i].adapter;
|
||||||
@@ -309,6 +311,8 @@ const char *sensors_get_algorithm_name(int bus_nr)
|
|||||||
int i;
|
int i;
|
||||||
if (bus_nr == SENSORS_CHIP_NAME_BUS_ISA)
|
if (bus_nr == SENSORS_CHIP_NAME_BUS_ISA)
|
||||||
return "ISA algorithm";
|
return "ISA algorithm";
|
||||||
|
if (bus_nr == SENSORS_CHIP_NAME_BUS_DUMMY)
|
||||||
|
return "Dummy algorithm";
|
||||||
for (i=0; i < sensors_proc_bus_count; i++)
|
for (i=0; i < sensors_proc_bus_count; i++)
|
||||||
if (sensors_proc_bus[i].number == bus_nr)
|
if (sensors_proc_bus[i].number == bus_nr)
|
||||||
return sensors_proc_bus[i].algorithm;
|
return sensors_proc_bus[i].algorithm;
|
||||||
|
@@ -28,6 +28,7 @@
|
|||||||
#define SENSORS_CHIP_NAME_BUS_ISA -1
|
#define SENSORS_CHIP_NAME_BUS_ISA -1
|
||||||
#define SENSORS_CHIP_NAME_BUS_ANY -2
|
#define SENSORS_CHIP_NAME_BUS_ANY -2
|
||||||
#define SENSORS_CHIP_NAME_BUS_ANY_I2C -3
|
#define SENSORS_CHIP_NAME_BUS_ANY_I2C -3
|
||||||
|
#define SENSORS_CHIP_NAME_BUS_DUMMY -4
|
||||||
#define SENSORS_CHIP_NAME_ADDR_ANY -1
|
#define SENSORS_CHIP_NAME_ADDR_ANY -1
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@@ -39,6 +40,7 @@ typedef struct sensors_chip_name {
|
|||||||
char *prefix;
|
char *prefix;
|
||||||
int bus;
|
int bus;
|
||||||
int addr;
|
int addr;
|
||||||
|
char *busname; /* if dummy */
|
||||||
} sensors_chip_name;
|
} sensors_chip_name;
|
||||||
|
|
||||||
/* (Re)load the configuration file and the detected chips list. If this
|
/* (Re)load the configuration file and the detected chips list. If this
|
||||||
|
@@ -3642,6 +3642,74 @@ void print_vt8231(const sensors_chip_name *name)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define BMC_MAX_INS 10
|
||||||
|
#define BMC_MAX_FANS 10
|
||||||
|
#define BMC_MAX_TEMPS 10
|
||||||
|
|
||||||
|
void print_bmc(const sensors_chip_name *name)
|
||||||
|
{
|
||||||
|
char *label = NULL;
|
||||||
|
double cur,min,max,fdiv;
|
||||||
|
int alarms, valid, i;
|
||||||
|
|
||||||
|
/*
|
||||||
|
if (!sensors_get_feature(*name,SENSORS_VT8231_ALARMS,&cur))
|
||||||
|
alarms = cur + 0.5;
|
||||||
|
else {
|
||||||
|
printf("ERROR: Can't get alarm data!\n");
|
||||||
|
alarms = 0;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
#define BMC_ALARM_IN1 0
|
||||||
|
#define BMC_ALARM_FAN1 0
|
||||||
|
#define BMC_ALARM_TEMP1 0
|
||||||
|
|
||||||
|
alarms = 0;
|
||||||
|
for(i = 0; i < BMC_MAX_INS; i++) {
|
||||||
|
if (!sensors_get_label_and_valid(*name,SENSORS_BMC_IN1+i,&label,&valid) &&
|
||||||
|
!sensors_get_feature(*name,SENSORS_BMC_IN1+i,&cur) &&
|
||||||
|
!sensors_get_feature(*name,SENSORS_BMC_IN1_MIN+i,&min) &&
|
||||||
|
!sensors_get_feature(*name,SENSORS_BMC_IN1_MAX+i,&max)) {
|
||||||
|
if (valid) {
|
||||||
|
print_label(label,10);
|
||||||
|
printf("%+6.2f V (min = %+6.2f V, max = %+6.2f V) %s\n",
|
||||||
|
cur,min,max,alarms&BMC_ALARM_IN1?"ALARM":"");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
free_the_label(&label);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(i = 0; i < BMC_MAX_FANS; i++) {
|
||||||
|
if (!sensors_get_label_and_valid(*name,SENSORS_BMC_FAN1+i,&label,&valid) &&
|
||||||
|
!sensors_get_feature(*name,SENSORS_BMC_FAN1+i,&cur) &&
|
||||||
|
/*
|
||||||
|
!sensors_get_feature(*name,SENSORS_BMC_FAN1_DIV+i,&fdiv) &&
|
||||||
|
*/
|
||||||
|
!sensors_get_feature(*name,SENSORS_BMC_FAN1_MIN+i,&min)) {
|
||||||
|
if (valid) {
|
||||||
|
print_label(label,10);
|
||||||
|
printf("%4.0f RPM (min = %4.0f RPM, div = %1.0f) %s\n",
|
||||||
|
cur,min,fdiv, alarms&BMC_ALARM_FAN1?"ALARM":"");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
free_the_label(&label);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(i = 0; i < BMC_MAX_TEMPS; i++) {
|
||||||
|
if (!sensors_get_label_and_valid(*name,SENSORS_BMC_TEMP1+i,&label,&valid) &&
|
||||||
|
!sensors_get_feature(*name,SENSORS_BMC_TEMP1+i,&cur) &&
|
||||||
|
!sensors_get_feature(*name,SENSORS_BMC_TEMP1_MIN+i,&min) &&
|
||||||
|
!sensors_get_feature(*name,SENSORS_BMC_TEMP1_MAX+i,&max)) {
|
||||||
|
if (valid) {
|
||||||
|
print_label(label,10);
|
||||||
|
print_temp_info( cur, max, min, HYST, 1, 0);
|
||||||
|
printf(" %s\n", alarms & BMC_ALARM_TEMP1 ? "ALARM" : "" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
free_the_label(&label);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void print_unknown_chip(const sensors_chip_name *name)
|
void print_unknown_chip(const sensors_chip_name *name)
|
||||||
{
|
{
|
||||||
int a,b,valid;
|
int a,b,valid;
|
||||||
|
@@ -274,6 +274,8 @@ const char *sprintf_chip_name(sensors_chip_name name)
|
|||||||
|
|
||||||
if (name.bus == SENSORS_CHIP_NAME_BUS_ISA)
|
if (name.bus == SENSORS_CHIP_NAME_BUS_ISA)
|
||||||
snprintf(buf,BUF_SIZE,"%s-isa-%04x",name.prefix,name.addr);
|
snprintf(buf,BUF_SIZE,"%s-isa-%04x",name.prefix,name.addr);
|
||||||
|
else if (name.bus == SENSORS_CHIP_NAME_BUS_DUMMY)
|
||||||
|
snprintf(buf,BUF_SIZE,"%s-%s-%04x",name.prefix,name.busname,name.addr);
|
||||||
else
|
else
|
||||||
snprintf(buf,BUF_SIZE,"%s-i2c-%d-%02x",name.prefix,name.bus,name.addr);
|
snprintf(buf,BUF_SIZE,"%s-i2c-%d-%02x",name.prefix,name.bus,name.addr);
|
||||||
return buf;
|
return buf;
|
||||||
@@ -355,6 +357,8 @@ void do_a_print(sensors_chip_name name)
|
|||||||
print_lm92(&name);
|
print_lm92(&name);
|
||||||
else if (!strcmp(name.prefix,"vt8231"))
|
else if (!strcmp(name.prefix,"vt8231"))
|
||||||
print_vt8231(&name);
|
print_vt8231(&name);
|
||||||
|
else if (!strcmp(name.prefix,"bmc"))
|
||||||
|
print_bmc(&name);
|
||||||
else
|
else
|
||||||
print_unknown_chip(&name);
|
print_unknown_chip(&name);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
Reference in New Issue
Block a user