mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-24 20:21:43 +00:00
Define a separate structure to represent main features. This allows
for faster main features lookup. One side effect of this change is that subfeatures can no longer have labels nor be ignored. I do not think that this is a problem in practice, and actually this makes a lot of sense. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4834 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
bfe337fe76
commit
96c914bfda
11 files changed
+160
-126
No files matched your search
+28
-36
@@ -141,30 +141,27 @@ int sensors_chip_name_has_wildcards(const sensors_chip_name *chip)
|
|||||||
contain wildcard values! The returned string is newly allocated (free it
|
contain wildcard values! The returned string is newly allocated (free it
|
||||||
yourself). On failure, NULL is returned.
|
yourself). On failure, NULL is returned.
|
||||||
If no label exists for this feature, its name is returned itself. */
|
If no label exists for this feature, its name is returned itself. */
|
||||||
char *sensors_get_label(const sensors_chip_name *name, int feature)
|
char *sensors_get_label(const sensors_chip_name *name,
|
||||||
|
const sensors_feature *feature)
|
||||||
{
|
{
|
||||||
char *label;
|
char *label;
|
||||||
const sensors_chip *chip;
|
const sensors_chip *chip;
|
||||||
const sensors_subfeature *featureptr;
|
|
||||||
char buf[128], path[PATH_MAX];
|
char buf[128], path[PATH_MAX];
|
||||||
FILE *f;
|
FILE *f;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (sensors_chip_name_has_wildcards(name))
|
if (sensors_chip_name_has_wildcards(name))
|
||||||
return NULL;
|
return NULL;
|
||||||
if (!(featureptr = sensors_lookup_feature_nr(name, feature)))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
for (chip = NULL; (chip = sensors_for_all_config_chips(name, chip));)
|
for (chip = NULL; (chip = sensors_for_all_config_chips(name, chip));)
|
||||||
for (i = 0; i < chip->labels_count; i++)
|
for (i = 0; i < chip->labels_count; i++)
|
||||||
if (!strcmp(featureptr->name, chip->labels[i].name)) {
|
if (!strcmp(feature->name, chip->labels[i].name)) {
|
||||||
label = strdup(chip->labels[i].value);
|
label = strdup(chip->labels[i].value);
|
||||||
goto sensors_get_label_exit;
|
goto sensors_get_label_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No user specified label, check for a _label sysfs file */
|
/* No user specified label, check for a _label sysfs file */
|
||||||
snprintf(path, PATH_MAX, "%s/%s_label", name->path,
|
snprintf(path, PATH_MAX, "%s/%s_label", name->path, feature->name);
|
||||||
featureptr->name);
|
|
||||||
|
|
||||||
if ((f = fopen(path, "r"))) {
|
if ((f = fopen(path, "r"))) {
|
||||||
i = fread(buf, 1, sizeof(buf) - 1, f);
|
i = fread(buf, 1, sizeof(buf) - 1, f);
|
||||||
@@ -178,7 +175,7 @@ char *sensors_get_label(const sensors_chip_name *name, int feature)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* No label, return the feature name instead */
|
/* No label, return the feature name instead */
|
||||||
label = strdup(featureptr->name);
|
label = strdup(feature->name);
|
||||||
|
|
||||||
sensors_get_label_exit:
|
sensors_get_label_exit:
|
||||||
if (!label)
|
if (!label)
|
||||||
@@ -188,26 +185,16 @@ sensors_get_label_exit:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Looks up whether a feature should be ignored. Returns
|
/* Looks up whether a feature should be ignored. Returns
|
||||||
1 if it should be ignored, 0 if not. This function takes
|
1 if it should be ignored, 0 if not. */
|
||||||
mappings into account. */
|
|
||||||
static int sensors_get_ignored(const sensors_chip_name *name,
|
static int sensors_get_ignored(const sensors_chip_name *name,
|
||||||
const sensors_subfeature *feature)
|
const sensors_feature *feature)
|
||||||
{
|
{
|
||||||
const sensors_chip *chip;
|
const sensors_chip *chip;
|
||||||
const char *main_feature_name;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (feature->mapping == SENSORS_NO_MAPPING)
|
|
||||||
main_feature_name = NULL;
|
|
||||||
else
|
|
||||||
main_feature_name = sensors_lookup_feature_nr(name,
|
|
||||||
feature->mapping)->name;
|
|
||||||
|
|
||||||
for (chip = NULL; (chip = sensors_for_all_config_chips(name, chip));)
|
for (chip = NULL; (chip = sensors_for_all_config_chips(name, chip));)
|
||||||
for (i = 0; i < chip->ignores_count; i++)
|
for (i = 0; i < chip->ignores_count; i++)
|
||||||
if (!strcmp(feature->name, chip->ignores[i].name) ||
|
if (!strcmp(feature->name, chip->ignores[i].name))
|
||||||
(main_feature_name &&
|
|
||||||
!strcmp(main_feature_name, chip->ignores[i].name)))
|
|
||||||
return 1;
|
return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -352,42 +339,47 @@ sensors_get_all_features(const sensors_chip_name *name, int *nr)
|
|||||||
for (i = 0; i < sensors_proc_chips_count; i++)
|
for (i = 0; i < sensors_proc_chips_count; i++)
|
||||||
if (sensors_match_chip(&sensors_proc_chips[i].chip, name)) {
|
if (sensors_match_chip(&sensors_proc_chips[i].chip, name)) {
|
||||||
subfeature_list = sensors_proc_chips[i].subfeature;
|
subfeature_list = sensors_proc_chips[i].subfeature;
|
||||||
while (*nr < sensors_proc_chips[i].subfeature_count
|
if (*nr >= sensors_proc_chips[i].subfeature_count)
|
||||||
&& sensors_get_ignored(name, &subfeature_list[*nr]))
|
|
||||||
(*nr)++;
|
|
||||||
if (*nr == sensors_proc_chips[i].subfeature_count)
|
|
||||||
return NULL;
|
return NULL;
|
||||||
return &subfeature_list[(*nr)++];
|
return &subfeature_list[(*nr)++];
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
const sensors_subfeature *
|
const sensors_feature *
|
||||||
sensors_get_features(const sensors_chip_name *name, int *nr)
|
sensors_get_features(const sensors_chip_name *name, int *nr)
|
||||||
{
|
{
|
||||||
const sensors_subfeature *feature;
|
const sensors_feature *feature_list;
|
||||||
|
int i;
|
||||||
|
|
||||||
while ((feature = sensors_get_all_features(name, nr))) {
|
for (i = 0; i < sensors_proc_chips_count; i++)
|
||||||
if (feature->mapping == SENSORS_NO_MAPPING)
|
if (sensors_match_chip(&sensors_proc_chips[i].chip, name)) {
|
||||||
return feature;
|
feature_list = sensors_proc_chips[i].feature;
|
||||||
}
|
while (*nr < sensors_proc_chips[i].feature_count
|
||||||
|
&& sensors_get_ignored(name, &feature_list[*nr]))
|
||||||
|
(*nr)++;
|
||||||
|
if (*nr >= sensors_proc_chips[i].feature_count)
|
||||||
|
return NULL;
|
||||||
|
return &feature_list[(*nr)++];
|
||||||
|
}
|
||||||
return NULL; /* end of list */
|
return NULL; /* end of list */
|
||||||
}
|
}
|
||||||
|
|
||||||
const sensors_subfeature *
|
const sensors_subfeature *
|
||||||
sensors_get_all_subfeatures(const sensors_chip_name *name, int feature, int *nr)
|
sensors_get_all_subfeatures(const sensors_chip_name *name,
|
||||||
|
const sensors_feature *feature, int *nr)
|
||||||
{
|
{
|
||||||
const sensors_subfeature *subfeature;
|
const sensors_subfeature *subfeature;
|
||||||
|
|
||||||
/* Seek directly to the first subfeature */
|
/* Seek directly to the first subfeature */
|
||||||
if (*nr < feature)
|
if (*nr < feature->first_subfeature)
|
||||||
*nr = feature;
|
*nr = feature->first_subfeature;
|
||||||
|
|
||||||
subfeature = sensors_get_all_features(name, nr);
|
subfeature = sensors_get_all_features(name, nr);
|
||||||
if (!subfeature)
|
if (!subfeature)
|
||||||
return NULL; /* end of list */
|
return NULL; /* end of list */
|
||||||
if (subfeature->number == feature ||
|
if (subfeature->number == feature->first_subfeature ||
|
||||||
subfeature->mapping == feature)
|
subfeature->mapping == feature->first_subfeature)
|
||||||
return subfeature;
|
return subfeature;
|
||||||
return NULL; /* end of subfeature list */
|
return NULL; /* end of subfeature list */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,7 +123,9 @@ typedef struct sensors_bus {
|
|||||||
/* Internal data about all features of a type of chip */
|
/* Internal data about all features of a type of chip */
|
||||||
typedef struct sensors_chip_features {
|
typedef struct sensors_chip_features {
|
||||||
struct sensors_chip_name chip;
|
struct sensors_chip_name chip;
|
||||||
|
struct sensors_feature *feature;
|
||||||
struct sensors_subfeature *subfeature;
|
struct sensors_subfeature *subfeature;
|
||||||
|
int feature_count;
|
||||||
int subfeature_count;
|
int subfeature_count;
|
||||||
} sensors_chip_features;
|
} sensors_chip_features;
|
||||||
|
|
||||||
|
|||||||
@@ -59,6 +59,9 @@ static void free_chip_features(sensors_chip_features *features)
|
|||||||
for (i = 0; i < features->subfeature_count; i++)
|
for (i = 0; i < features->subfeature_count; i++)
|
||||||
free(features->subfeature[i].name);
|
free(features->subfeature[i].name);
|
||||||
free(features->subfeature);
|
free(features->subfeature);
|
||||||
|
for (i = 0; i < features->feature_count; i++)
|
||||||
|
free(features->feature[i].name);
|
||||||
|
free(features->feature);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void free_bus(sensors_bus *bus)
|
static void free_bus(sensors_bus *bus)
|
||||||
|
|||||||
+7
-9
@@ -36,7 +36,7 @@ libsensors \- publicly accessible functions provided by the sensors library
|
|||||||
.B int sensors_parse_chip_name(const char *orig_name,
|
.B int sensors_parse_chip_name(const char *orig_name,
|
||||||
\fBsensors_chip_name *res);\fP
|
\fBsensors_chip_name *res);\fP
|
||||||
.B const char *sensors_get_adapter_name(int bus_nr);
|
.B const char *sensors_get_adapter_name(int bus_nr);
|
||||||
.B char *sensors_get_label(const sensors_chip_name *name, int feature);\fP
|
.B char *sensors_get_label(const sensors_chip_name *name, const sensors_feature *feature);\fP
|
||||||
.B int sensors_get_value(const sensors_chip_name *name, int feature,
|
.B int sensors_get_value(const sensors_chip_name *name, int feature,
|
||||||
\fBdouble *value);\fP
|
\fBdouble *value);\fP
|
||||||
.B int sensors_set_value(const sensors_chip_name *name, int feature,
|
.B int sensors_set_value(const sensors_chip_name *name, int feature,
|
||||||
@@ -44,10 +44,8 @@ libsensors \- publicly accessible functions provided by the sensors library
|
|||||||
.B int sensors_do_chip_sets(const sensors_chip_name *name);
|
.B int sensors_do_chip_sets(const sensors_chip_name *name);
|
||||||
.B const sensors_chip_name *sensors_get_detected_chips(const sensors_chip_name
|
.B const sensors_chip_name *sensors_get_detected_chips(const sensors_chip_name
|
||||||
\fB*match, int *nr);\fP
|
\fB*match, int *nr);\fP
|
||||||
.B const sensors_feature_data *sensors_get_features
|
.B const sensors_feature *sensors_get_features(const sensors_chip_name *name, int *nr);\fP
|
||||||
\fB(const sensors_chip_name *name, int *nr);\fP
|
.B const sensors_subfeature *sensors_get_all_subfeatures(const sensors_chip_name *name, const sensors_feature *feature, int *nr);\fP
|
||||||
.B const sensors_feature_data *sensors_get_all_subfeatures
|
|
||||||
\fB(const sensors_chip_name *name, int feature, int *nr);\fP
|
|
||||||
.B const char *libsensors_version;
|
.B const char *libsensors_version;
|
||||||
.fi
|
.fi
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
@@ -73,7 +71,7 @@ Parse a chip name to the internal representation. Return 0 on succes, <0 on erro
|
|||||||
This function returns the adapter name of a bus number, as used within the
|
This function returns the adapter name of a bus number, as used within the
|
||||||
sensors_chip_name structure. If it could not be found, it returns NULL.
|
sensors_chip_name structure. If it could not be found, it returns NULL.
|
||||||
|
|
||||||
\fBchar *sensors_get_label(const sensors_chip_name *name, int feature);\fP
|
\fBchar *sensors_get_label(const sensors_chip_name *name, const sensors_feature *feature);\fP
|
||||||
.br
|
.br
|
||||||
Look up the label which belongs to this chip. Note that chip should not
|
Look up the label which belongs to this chip. Note that chip should not
|
||||||
contain wildcard values! The returned string is newly allocated (free it
|
contain wildcard values! The returned string is newly allocated (free it
|
||||||
@@ -124,7 +122,7 @@ The flags field is a bitfield, its value is a combination of
|
|||||||
SENSORS_MODE_R (readable), SENSORS_MODE_W (writable) and SENSORS_COMPUTE_MAPPING
|
SENSORS_MODE_R (readable), SENSORS_MODE_W (writable) and SENSORS_COMPUTE_MAPPING
|
||||||
(affected by the computation rules of the main feature).
|
(affected by the computation rules of the main feature).
|
||||||
|
|
||||||
\fBconst sensors_feature_data *sensors_get_features(const sensors_chip_name *name, int *nr);\fP
|
\fBconst sensors_feature *sensors_get_features(const sensors_chip_name *name, int *nr);\fP
|
||||||
.br
|
.br
|
||||||
This returns all main features of a specific chip. nr is an internally
|
This returns all main features of a specific chip. nr is an internally
|
||||||
used variable. Set it to zero to start at the begin of the list. If no
|
used variable. Set it to zero to start at the begin of the list. If no
|
||||||
@@ -132,12 +130,12 @@ more features are found NULL is returned.
|
|||||||
Do not try to change the returned structure; you will corrupt internal
|
Do not try to change the returned structure; you will corrupt internal
|
||||||
data structures.
|
data structures.
|
||||||
|
|
||||||
\fBconst sensors_feature_data *sensors_get_all_subfeatures(const sensors_chip_name *name, int feature, int *nr);\fP
|
\fBconst sensors_subfeature *sensors_get_all_subfeatures(const sensors_chip_name *name, const sensors_feature *feature, int *nr);\fP
|
||||||
.br
|
.br
|
||||||
This returns all subfeatures of a given main feature (including that
|
This returns all subfeatures of a given main feature (including that
|
||||||
main feature itself, in first position.) nr is an internally used
|
main feature itself, in first position.) nr is an internally used
|
||||||
variable. Set it to zero to start at the begin of the list. If no more
|
variable. Set it to zero to start at the begin of the list. If no more
|
||||||
features are found NULL is returned.
|
subfeatures are found NULL is returned.
|
||||||
Do not try to change the returned structure; you will corrupt internal
|
Do not try to change the returned structure; you will corrupt internal
|
||||||
data structures.
|
data structures.
|
||||||
|
|
||||||
|
|||||||
+14
-3
@@ -82,11 +82,14 @@ int sensors_snprintf_chip_name(char *str, size_t size,
|
|||||||
it returns NULL */
|
it returns NULL */
|
||||||
const char *sensors_get_adapter_name(const sensors_bus_id *bus);
|
const char *sensors_get_adapter_name(const sensors_bus_id *bus);
|
||||||
|
|
||||||
|
typedef struct sensors_feature sensors_feature;
|
||||||
|
|
||||||
/* Look up the label which belongs to this chip. Note that chip should not
|
/* Look up the label which belongs to this chip. Note that chip should not
|
||||||
contain wildcard values! The returned string is newly allocated (free it
|
contain wildcard values! The returned string is newly allocated (free it
|
||||||
yourself). On failure, NULL is returned.
|
yourself). On failure, NULL is returned.
|
||||||
If no label exists for this feature, its name is returned itself. */
|
If no label exists for this feature, its name is returned itself. */
|
||||||
char *sensors_get_label(const sensors_chip_name *name, int feature);
|
char *sensors_get_label(const sensors_chip_name *name,
|
||||||
|
const sensors_feature *feature);
|
||||||
|
|
||||||
/* Read the value of a feature of a certain chip. Note that chip should not
|
/* Read the value of a feature of a certain chip. Note that chip should not
|
||||||
contain wildcard values! This function will return 0 on success, and <0
|
contain wildcard values! This function will return 0 on success, and <0
|
||||||
@@ -163,6 +166,13 @@ typedef enum sensors_feature_type {
|
|||||||
SENSORS_FEATURE_UNKNOWN = INT_MAX,
|
SENSORS_FEATURE_UNKNOWN = INT_MAX,
|
||||||
} sensors_feature_type;
|
} sensors_feature_type;
|
||||||
|
|
||||||
|
/* Data about a single chip feature (or category leader) */
|
||||||
|
struct sensors_feature {
|
||||||
|
char *name;
|
||||||
|
int first_subfeature;
|
||||||
|
sensors_feature_type type;
|
||||||
|
};
|
||||||
|
|
||||||
/* Data about a single chip subfeature:
|
/* Data about a single chip subfeature:
|
||||||
name is the string name used to refer to this subfeature (in config files)
|
name is the string name used to refer to this subfeature (in config files)
|
||||||
number is the internal subfeature number, used in many functions to refer
|
number is the internal subfeature number, used in many functions to refer
|
||||||
@@ -188,7 +198,7 @@ typedef struct sensors_subfeature {
|
|||||||
more features are found NULL is returned.
|
more features are found NULL is returned.
|
||||||
Do not try to change the returned structure; you will corrupt internal
|
Do not try to change the returned structure; you will corrupt internal
|
||||||
data structures. */
|
data structures. */
|
||||||
const sensors_subfeature *
|
const sensors_feature *
|
||||||
sensors_get_features(const sensors_chip_name *name, int *nr);
|
sensors_get_features(const sensors_chip_name *name, int *nr);
|
||||||
|
|
||||||
/* This returns all subfeatures of a given main feature (including that
|
/* This returns all subfeatures of a given main feature (including that
|
||||||
@@ -198,7 +208,8 @@ sensors_get_features(const sensors_chip_name *name, int *nr);
|
|||||||
Do not try to change the returned structure; you will corrupt internal
|
Do not try to change the returned structure; you will corrupt internal
|
||||||
data structures. */
|
data structures. */
|
||||||
const sensors_subfeature *
|
const sensors_subfeature *
|
||||||
sensors_get_all_subfeatures(const sensors_chip_name *name, int feature, int *nr);
|
sensors_get_all_subfeatures(const sensors_chip_name *name,
|
||||||
|
const sensors_feature *feature, int *nr);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
+26
@@ -163,6 +163,7 @@ static int sensors_read_dynamic_chip(sensors_chip_features *chip,
|
|||||||
struct dlist *attrs;
|
struct dlist *attrs;
|
||||||
sensors_subfeature *features;
|
sensors_subfeature *features;
|
||||||
sensors_subfeature *dyn_subfeatures;
|
sensors_subfeature *dyn_subfeatures;
|
||||||
|
sensors_feature *dyn_features;
|
||||||
|
|
||||||
attrs = sysfs_get_device_attributes(sysdir);
|
attrs = sysfs_get_device_attributes(sysdir);
|
||||||
|
|
||||||
@@ -289,6 +290,31 @@ static int sensors_read_dynamic_chip(sensors_chip_features *chip,
|
|||||||
chip->subfeature = dyn_subfeatures;
|
chip->subfeature = dyn_subfeatures;
|
||||||
chip->subfeature_count = fnum;
|
chip->subfeature_count = fnum;
|
||||||
|
|
||||||
|
/* And now the main features */
|
||||||
|
fnum = 0;
|
||||||
|
for (i = 0; i < chip->subfeature_count; i++) {
|
||||||
|
if (chip->subfeature[i].mapping == SENSORS_NO_MAPPING)
|
||||||
|
fnum++;
|
||||||
|
}
|
||||||
|
|
||||||
|
dyn_features = calloc(fnum, sizeof(sensors_feature));
|
||||||
|
if (dyn_features == NULL) {
|
||||||
|
sensors_fatal_error(__FUNCTION__, "Out of memory");
|
||||||
|
}
|
||||||
|
|
||||||
|
fnum = 0;
|
||||||
|
for (i = 0; i < chip->subfeature_count; i++) {
|
||||||
|
if (chip->subfeature[i].mapping == SENSORS_NO_MAPPING) {
|
||||||
|
dyn_features[fnum].name = strdup(chip->subfeature[i].name);
|
||||||
|
dyn_features[fnum].first_subfeature = i;
|
||||||
|
dyn_features[fnum].type = chip->subfeature[i].type;
|
||||||
|
fnum++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
chip->feature = dyn_features;
|
||||||
|
chip->feature_count = fnum;
|
||||||
|
|
||||||
exit_free:
|
exit_free:
|
||||||
free(features);
|
free(features);
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
+29
-12
@@ -141,7 +141,7 @@ rrdF3
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void getAvailableFeatures (const sensors_chip_name *name,
|
static void getAvailableFeatures (const sensors_chip_name *name,
|
||||||
const sensors_subfeature *feature,
|
const sensors_feature *feature,
|
||||||
short *has_features,
|
short *has_features,
|
||||||
int *feature_nrs, int size,
|
int *feature_nrs, int size,
|
||||||
int first_val)
|
int first_val)
|
||||||
@@ -149,7 +149,7 @@ static void getAvailableFeatures (const sensors_chip_name *name,
|
|||||||
const sensors_subfeature *iter;
|
const sensors_subfeature *iter;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
while ((iter = sensors_get_all_subfeatures(name, feature->number, &i))) {
|
while ((iter = sensors_get_all_subfeatures(name, feature, &i))) {
|
||||||
int index0;
|
int index0;
|
||||||
|
|
||||||
index0 = iter->type - first_val;
|
index0 = iter->type - first_val;
|
||||||
@@ -166,7 +166,7 @@ static void getAvailableFeatures (const sensors_chip_name *name,
|
|||||||
#define IN_FEATURE_NR(x) feature_nrs[x - SENSORS_FEATURE_IN]
|
#define IN_FEATURE_NR(x) feature_nrs[x - SENSORS_FEATURE_IN]
|
||||||
static void fillChipVoltage (FeatureDescriptor *voltage,
|
static void fillChipVoltage (FeatureDescriptor *voltage,
|
||||||
const sensors_chip_name *name,
|
const sensors_chip_name *name,
|
||||||
const sensors_subfeature *feature)
|
const sensors_feature *feature)
|
||||||
{
|
{
|
||||||
const int size = SENSORS_FEATURE_IN_BEEP - SENSORS_FEATURE_IN + 1;
|
const int size = SENSORS_FEATURE_IN_BEEP - SENSORS_FEATURE_IN + 1;
|
||||||
short has_features[SENSORS_FEATURE_IN_BEEP - SENSORS_FEATURE_IN + 1] = { 0, };
|
short has_features[SENSORS_FEATURE_IN_BEEP - SENSORS_FEATURE_IN + 1] = { 0, };
|
||||||
@@ -215,7 +215,7 @@ static void fillChipVoltage (FeatureDescriptor *voltage,
|
|||||||
#define TEMP_FEATURE_NR(x) feature_nrs[x - SENSORS_FEATURE_TEMP]
|
#define TEMP_FEATURE_NR(x) feature_nrs[x - SENSORS_FEATURE_TEMP]
|
||||||
static void fillChipTemperature (FeatureDescriptor *temperature,
|
static void fillChipTemperature (FeatureDescriptor *temperature,
|
||||||
const sensors_chip_name *name,
|
const sensors_chip_name *name,
|
||||||
const sensors_subfeature *feature)
|
const sensors_feature *feature)
|
||||||
{
|
{
|
||||||
const int size = SENSORS_FEATURE_TEMP_BEEP - SENSORS_FEATURE_TEMP + 1;
|
const int size = SENSORS_FEATURE_TEMP_BEEP - SENSORS_FEATURE_TEMP + 1;
|
||||||
short has_features[SENSORS_FEATURE_TEMP_BEEP - SENSORS_FEATURE_TEMP + 1] = { 0, };
|
short has_features[SENSORS_FEATURE_TEMP_BEEP - SENSORS_FEATURE_TEMP + 1] = { 0, };
|
||||||
@@ -267,7 +267,7 @@ static void fillChipTemperature (FeatureDescriptor *temperature,
|
|||||||
#define FAN_FEATURE_NR(x) feature_nrs[x - SENSORS_FEATURE_FAN]
|
#define FAN_FEATURE_NR(x) feature_nrs[x - SENSORS_FEATURE_FAN]
|
||||||
static void fillChipFan (FeatureDescriptor *fan,
|
static void fillChipFan (FeatureDescriptor *fan,
|
||||||
const sensors_chip_name *name,
|
const sensors_chip_name *name,
|
||||||
const sensors_subfeature *feature)
|
const sensors_feature *feature)
|
||||||
{
|
{
|
||||||
const int size = SENSORS_FEATURE_FAN_BEEP - SENSORS_FEATURE_FAN + 1;
|
const int size = SENSORS_FEATURE_FAN_BEEP - SENSORS_FEATURE_FAN + 1;
|
||||||
short has_features[SENSORS_FEATURE_FAN_BEEP - SENSORS_FEATURE_FAN + 1] = { 0, };
|
short has_features[SENSORS_FEATURE_FAN_BEEP - SENSORS_FEATURE_FAN + 1] = { 0, };
|
||||||
@@ -312,26 +312,42 @@ static void fillChipFan (FeatureDescriptor *fan,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void fillChipVid (FeatureDescriptor *vid,
|
static void fillChipVid (FeatureDescriptor *vid,
|
||||||
const sensors_subfeature *feature)
|
const sensors_chip_name *name,
|
||||||
|
const sensors_feature *feature)
|
||||||
{
|
{
|
||||||
|
int i = 0;
|
||||||
|
const sensors_subfeature *sub;
|
||||||
|
|
||||||
|
sub = sensors_get_all_subfeatures(name, feature, &i);
|
||||||
|
if (!sub)
|
||||||
|
return;
|
||||||
|
|
||||||
vid->format = fmtVolt_3;
|
vid->format = fmtVolt_3;
|
||||||
vid->rrd = rrdF3;
|
vid->rrd = rrdF3;
|
||||||
vid->type = DataType_voltage;
|
vid->type = DataType_voltage;
|
||||||
vid->alarmNumber = -1;
|
vid->alarmNumber = -1;
|
||||||
vid->beepNumber = -1;
|
vid->beepNumber = -1;
|
||||||
vid->dataNumbers[0] = feature->number;
|
vid->dataNumbers[0] = sub->number;
|
||||||
vid->dataNumbers[1] = -1;
|
vid->dataNumbers[1] = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fillChipBeepEnable (FeatureDescriptor *beepen,
|
static void fillChipBeepEnable (FeatureDescriptor *beepen,
|
||||||
const sensors_subfeature *feature)
|
const sensors_chip_name *name,
|
||||||
|
const sensors_feature *feature)
|
||||||
{
|
{
|
||||||
|
int i = 0;
|
||||||
|
const sensors_subfeature *sub;
|
||||||
|
|
||||||
|
sub = sensors_get_all_subfeatures(name, feature, &i);
|
||||||
|
if (!sub)
|
||||||
|
return;
|
||||||
|
|
||||||
beepen->format = fmtSoundAlarm;
|
beepen->format = fmtSoundAlarm;
|
||||||
beepen->rrd = rrdF0;
|
beepen->rrd = rrdF0;
|
||||||
beepen->type = DataType_other;
|
beepen->type = DataType_other;
|
||||||
beepen->alarmNumber = -1;
|
beepen->alarmNumber = -1;
|
||||||
beepen->beepNumber = -1;
|
beepen->beepNumber = -1;
|
||||||
beepen->dataNumbers[0] = feature->number;
|
beepen->dataNumbers[0] = sub->number;
|
||||||
beepen->dataNumbers[1] = -1;
|
beepen->dataNumbers[1] = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -339,7 +355,7 @@ static
|
|||||||
FeatureDescriptor * generateChipFeatures (const sensors_chip_name *chip)
|
FeatureDescriptor * generateChipFeatures (const sensors_chip_name *chip)
|
||||||
{
|
{
|
||||||
int nr, count = 1;
|
int nr, count = 1;
|
||||||
const sensors_subfeature *sensor;
|
const sensors_feature *sensor;
|
||||||
FeatureDescriptor *features;
|
FeatureDescriptor *features;
|
||||||
|
|
||||||
/* How many main features do we have? */
|
/* How many main features do we have? */
|
||||||
@@ -367,15 +383,16 @@ FeatureDescriptor * generateChipFeatures (const sensors_chip_name *chip)
|
|||||||
fillChipFan(&features[count], chip, sensor);
|
fillChipFan(&features[count], chip, sensor);
|
||||||
break;
|
break;
|
||||||
case SENSORS_FEATURE_VID:
|
case SENSORS_FEATURE_VID:
|
||||||
fillChipVid(&features[count], sensor);
|
fillChipVid(&features[count], chip, sensor);
|
||||||
break;
|
break;
|
||||||
case SENSORS_FEATURE_BEEP_ENABLE:
|
case SENSORS_FEATURE_BEEP_ENABLE:
|
||||||
fillChipBeepEnable(&features[count], sensor);
|
fillChipBeepEnable(&features[count], chip, sensor);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
features[count].feature = sensor;
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-7
@@ -156,15 +156,11 @@ applyToFeatures
|
|||||||
|
|
||||||
for (index0 = 0; (ret == 0) && (num < MAX_RRD_SENSORS) && features[index0].format; ++ index0) {
|
for (index0 = 0; (ret == 0) && (num < MAX_RRD_SENSORS) && features[index0].format; ++ index0) {
|
||||||
const FeatureDescriptor *feature = features + index0;
|
const FeatureDescriptor *feature = features + index0;
|
||||||
int labelNumber = feature->dataNumbers[0];
|
const char *rawLabel = features->feature->name;
|
||||||
const char *rawLabel = NULL;
|
|
||||||
char *label = NULL;
|
char *label = NULL;
|
||||||
|
|
||||||
if (getRawLabel (chip, labelNumber, &rawLabel)) {
|
if (!(label = sensors_get_label (chip, features->feature))) {
|
||||||
sensorLog (LOG_ERR, "Error getting raw sensor label: %s/#%d", chip->prefix, labelNumber);
|
sensorLog (LOG_ERR, "Error getting sensor label: %s/%s", chip->prefix, rawLabel);
|
||||||
ret = -1;
|
|
||||||
} else if (!(label = sensors_get_label (chip, labelNumber))) {
|
|
||||||
sensorLog (LOG_ERR, "Error getting sensor label: %s/#%d", chip->prefix, labelNumber);
|
|
||||||
ret = -1;
|
ret = -1;
|
||||||
} else {
|
} else {
|
||||||
rrdCheckLabel (rawLabel, num);
|
rrdCheckLabel (rawLabel, num);
|
||||||
|
|||||||
+2
-23
@@ -33,26 +33,6 @@
|
|||||||
#define DO_SET 2
|
#define DO_SET 2
|
||||||
#define DO_RRD 3
|
#define DO_RRD 3
|
||||||
|
|
||||||
int
|
|
||||||
getRawLabel
|
|
||||||
(const sensors_chip_name *name, int feature, const char **label) {
|
|
||||||
const sensors_subfeature *mainfeat, *sub;
|
|
||||||
int a, b;
|
|
||||||
|
|
||||||
a = 0;
|
|
||||||
while ((mainfeat = sensors_get_features(name, &a))) {
|
|
||||||
b = 0;
|
|
||||||
while ((sub = sensors_get_all_subfeatures(name, mainfeat->number, &b))) {
|
|
||||||
if (sub->number == feature) {
|
|
||||||
*label = sub->name;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* TODO: Ensure labels match RRD construct and are not repeated! */
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
chipName
|
chipName
|
||||||
(const sensors_chip_name *chip) {
|
(const sensors_chip_name *chip) {
|
||||||
@@ -87,12 +67,11 @@ doKnownChip
|
|||||||
ret = idChip (chip);
|
ret = idChip (chip);
|
||||||
for (index0 = 0; (ret == 0) && features[index0].format; ++ index0) {
|
for (index0 = 0; (ret == 0) && features[index0].format; ++ index0) {
|
||||||
const FeatureDescriptor *feature = features + index0;
|
const FeatureDescriptor *feature = features + index0;
|
||||||
int labelNumber = feature->dataNumbers[0];
|
|
||||||
int alarm, beep;
|
int alarm, beep;
|
||||||
char *label = NULL;
|
char *label = NULL;
|
||||||
|
|
||||||
if (!(label = sensors_get_label (chip, labelNumber))) {
|
if (!(label = sensors_get_label (chip, feature->feature))) {
|
||||||
sensorLog (LOG_ERR, "Error getting sensor label: %s/#%d", chip->prefix, labelNumber);
|
sensorLog (LOG_ERR, "Error getting sensor label: %s/%s", chip->prefix, feature->feature->name);
|
||||||
ret = 22;
|
ret = 22;
|
||||||
} else {
|
} else {
|
||||||
double values[MAX_DATA];
|
double values[MAX_DATA];
|
||||||
|
|||||||
@@ -56,8 +56,6 @@ extern int unloadLib (void);
|
|||||||
|
|
||||||
/* from sense.c */
|
/* from sense.c */
|
||||||
|
|
||||||
extern int getRawLabel (const sensors_chip_name *name, int feature, const char **label);
|
|
||||||
|
|
||||||
extern int readChips (void);
|
extern int readChips (void);
|
||||||
extern int scanChips (void);
|
extern int scanChips (void);
|
||||||
extern int setChips (void);
|
extern int setChips (void);
|
||||||
@@ -91,7 +89,8 @@ typedef struct {
|
|||||||
DataType type;
|
DataType type;
|
||||||
int alarmNumber;
|
int alarmNumber;
|
||||||
int beepNumber;
|
int beepNumber;
|
||||||
int dataNumbers[MAX_DATA + 1]; /* First entry is used for the label */
|
const sensors_feature *feature;
|
||||||
|
int dataNumbers[MAX_DATA + 1];
|
||||||
} FeatureDescriptor;
|
} FeatureDescriptor;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
+44
-33
@@ -31,32 +31,30 @@
|
|||||||
void print_chip_raw(const sensors_chip_name *name)
|
void print_chip_raw(const sensors_chip_name *name)
|
||||||
{
|
{
|
||||||
int a, b;
|
int a, b;
|
||||||
const sensors_subfeature *feature, *sub;
|
const sensors_feature *feature;
|
||||||
|
const sensors_subfeature *sub;
|
||||||
char *label;
|
char *label;
|
||||||
double val;
|
double val;
|
||||||
|
|
||||||
a = 0;
|
a = 0;
|
||||||
while ((feature = sensors_get_features(name, &a))) {
|
while ((feature = sensors_get_features(name, &a))) {
|
||||||
|
if (!(label = sensors_get_label(name, feature))) {
|
||||||
|
printf("ERROR: Can't get feature label!\n");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
printf("%s:\n", label);
|
||||||
|
free(label);
|
||||||
|
|
||||||
b = 0;
|
b = 0;
|
||||||
while ((sub = sensors_get_all_subfeatures(name, feature->number,
|
while ((sub = sensors_get_all_subfeatures(name, feature, &b))) {
|
||||||
&b))) {
|
|
||||||
if (!(label = sensors_get_label(name, sub->number))) {
|
|
||||||
printf("ERROR: Can't get feature `%s' label!\n",
|
|
||||||
sub->name);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (sub->flags & SENSORS_MODE_R) {
|
if (sub->flags & SENSORS_MODE_R) {
|
||||||
if (sensors_get_value(name, sub->number, &val))
|
if (sensors_get_value(name, sub->number, &val))
|
||||||
printf("ERROR: Can't get feature `%s' "
|
printf("ERROR: Can't get feature `%s' "
|
||||||
"data!\n", sub->name);
|
"data!\n", sub->name);
|
||||||
else if (sub->mapping != SENSORS_NO_MAPPING)
|
|
||||||
printf(" %s: %.2f\n", label, val);
|
|
||||||
else
|
else
|
||||||
printf("%s: %.2f (%s)\n", label, val,
|
printf(" %s: %.2f\n", sub->name, val);
|
||||||
sub->name);
|
|
||||||
} else
|
} else
|
||||||
printf("(%s)\n", label);
|
printf("(%s)\n", label);
|
||||||
free(label);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -73,7 +71,7 @@ static void print_label(const char *label, int space)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void sensors_get_available_features(const sensors_chip_name *name,
|
static void sensors_get_available_features(const sensors_chip_name *name,
|
||||||
const sensors_subfeature *feature,
|
const sensors_feature *feature,
|
||||||
short *has_features,
|
short *has_features,
|
||||||
double *feature_vals, int size,
|
double *feature_vals, int size,
|
||||||
int first_val)
|
int first_val)
|
||||||
@@ -81,7 +79,7 @@ static void sensors_get_available_features(const sensors_chip_name *name,
|
|||||||
const sensors_subfeature *iter;
|
const sensors_subfeature *iter;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
while ((iter = sensors_get_all_subfeatures(name, feature->number, &i))) {
|
while ((iter = sensors_get_all_subfeatures(name, feature, &i))) {
|
||||||
int indx, err;
|
int indx, err;
|
||||||
|
|
||||||
indx = iter->type - first_val;
|
indx = iter->type - first_val;
|
||||||
@@ -103,13 +101,13 @@ static void sensors_get_available_features(const sensors_chip_name *name,
|
|||||||
static int sensors_get_label_size(const sensors_chip_name *name)
|
static int sensors_get_label_size(const sensors_chip_name *name)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
const sensors_subfeature *iter;
|
const sensors_feature *iter;
|
||||||
char *label;
|
char *label;
|
||||||
unsigned int max_size = 11; /* 11 as minumum label width */
|
unsigned int max_size = 11; /* 11 as minumum label width */
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
while ((iter = sensors_get_features(name, &i))) {
|
while ((iter = sensors_get_features(name, &i))) {
|
||||||
if ((label = sensors_get_label(name, iter->number)) &&
|
if ((label = sensors_get_label(name, iter)) &&
|
||||||
strlen(label) > max_size)
|
strlen(label) > max_size)
|
||||||
max_size = strlen(label);
|
max_size = strlen(label);
|
||||||
free(label);
|
free(label);
|
||||||
@@ -143,7 +141,7 @@ static void print_temp_limits(double limit1, double limit2,
|
|||||||
#define TEMP_FEATURE(x) has_features[x - SENSORS_FEATURE_TEMP]
|
#define TEMP_FEATURE(x) has_features[x - SENSORS_FEATURE_TEMP]
|
||||||
#define TEMP_FEATURE_VAL(x) feature_vals[x - SENSORS_FEATURE_TEMP]
|
#define TEMP_FEATURE_VAL(x) feature_vals[x - SENSORS_FEATURE_TEMP]
|
||||||
static void print_chip_temp(const sensors_chip_name *name,
|
static void print_chip_temp(const sensors_chip_name *name,
|
||||||
const sensors_subfeature *feature,
|
const sensors_feature *feature,
|
||||||
int label_size)
|
int label_size)
|
||||||
{
|
{
|
||||||
double val, limit1, limit2;
|
double val, limit1, limit2;
|
||||||
@@ -154,7 +152,7 @@ static void print_chip_temp(const sensors_chip_name *name,
|
|||||||
short has_features[SENSORS_FEATURE_TEMP_TYPE - SENSORS_FEATURE_TEMP + 1] = { 0, };
|
short has_features[SENSORS_FEATURE_TEMP_TYPE - SENSORS_FEATURE_TEMP + 1] = { 0, };
|
||||||
double feature_vals[SENSORS_FEATURE_TEMP_TYPE - SENSORS_FEATURE_TEMP + 1] = { 0.0, };
|
double feature_vals[SENSORS_FEATURE_TEMP_TYPE - SENSORS_FEATURE_TEMP + 1] = { 0.0, };
|
||||||
|
|
||||||
if (!(label = sensors_get_label(name, feature->number))) {
|
if (!(label = sensors_get_label(name, feature))) {
|
||||||
printf("ERROR: Can't get temperature label!\n");
|
printf("ERROR: Can't get temperature label!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -276,7 +274,7 @@ static void print_chip_temp(const sensors_chip_name *name,
|
|||||||
#define IN_FEATURE(x) has_features[x - SENSORS_FEATURE_IN]
|
#define IN_FEATURE(x) has_features[x - SENSORS_FEATURE_IN]
|
||||||
#define IN_FEATURE_VAL(x) feature_vals[x - SENSORS_FEATURE_IN]
|
#define IN_FEATURE_VAL(x) feature_vals[x - SENSORS_FEATURE_IN]
|
||||||
static void print_chip_in(const sensors_chip_name *name,
|
static void print_chip_in(const sensors_chip_name *name,
|
||||||
const sensors_subfeature *feature,
|
const sensors_feature *feature,
|
||||||
int label_size)
|
int label_size)
|
||||||
{
|
{
|
||||||
const int size = SENSORS_FEATURE_IN_MAX_ALARM - SENSORS_FEATURE_IN + 1;
|
const int size = SENSORS_FEATURE_IN_MAX_ALARM - SENSORS_FEATURE_IN + 1;
|
||||||
@@ -285,7 +283,7 @@ static void print_chip_in(const sensors_chip_name *name,
|
|||||||
double val, alarm_max, alarm_min;
|
double val, alarm_max, alarm_min;
|
||||||
char *label;
|
char *label;
|
||||||
|
|
||||||
if (!(label = sensors_get_label(name, feature->number))) {
|
if (!(label = sensors_get_label(name, feature))) {
|
||||||
printf("ERROR: Can't get in label!\n");
|
printf("ERROR: Can't get in label!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -336,7 +334,7 @@ static void print_chip_in(const sensors_chip_name *name,
|
|||||||
#define FAN_FEATURE(x) has_features[x - SENSORS_FEATURE_FAN]
|
#define FAN_FEATURE(x) has_features[x - SENSORS_FEATURE_FAN]
|
||||||
#define FAN_FEATURE_VAL(x) feature_vals[x - SENSORS_FEATURE_FAN]
|
#define FAN_FEATURE_VAL(x) feature_vals[x - SENSORS_FEATURE_FAN]
|
||||||
static void print_chip_fan(const sensors_chip_name *name,
|
static void print_chip_fan(const sensors_chip_name *name,
|
||||||
const sensors_subfeature *feature,
|
const sensors_feature *feature,
|
||||||
int label_size)
|
int label_size)
|
||||||
{
|
{
|
||||||
char *label;
|
char *label;
|
||||||
@@ -345,7 +343,7 @@ static void print_chip_fan(const sensors_chip_name *name,
|
|||||||
double feature_vals[SENSORS_FEATURE_FAN_DIV - SENSORS_FEATURE_FAN + 1] = { 0.0, };
|
double feature_vals[SENSORS_FEATURE_FAN_DIV - SENSORS_FEATURE_FAN + 1] = { 0.0, };
|
||||||
double val;
|
double val;
|
||||||
|
|
||||||
if (!(label = sensors_get_label(name, feature->number))) {
|
if (!(label = sensors_get_label(name, feature))) {
|
||||||
printf("ERROR: Can't get fan label!\n");
|
printf("ERROR: Can't get fan label!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -383,28 +381,42 @@ static void print_chip_fan(const sensors_chip_name *name,
|
|||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_chip_vid(const sensors_chip_name *name, int f_vid,
|
static void print_chip_vid(const sensors_chip_name *name,
|
||||||
|
const sensors_feature *feature,
|
||||||
int label_size)
|
int label_size)
|
||||||
{
|
{
|
||||||
char *label;
|
char *label;
|
||||||
|
const sensors_subfeature *subfeature;
|
||||||
double vid;
|
double vid;
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
if ((label = sensors_get_label(name, f_vid))
|
subfeature = sensors_get_all_subfeatures(name, feature, &i);
|
||||||
&& !sensors_get_value(name, f_vid, &vid)) {
|
if (!subfeature)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ((label = sensors_get_label(name, feature))
|
||||||
|
&& !sensors_get_value(name, subfeature->number, &vid)) {
|
||||||
print_label(label, label_size);
|
print_label(label, label_size);
|
||||||
printf("%+6.3f V\n", vid);
|
printf("%+6.3f V\n", vid);
|
||||||
}
|
}
|
||||||
free(label);
|
free(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_chip_beep_enable(const sensors_chip_name *name, int f_beep,
|
static void print_chip_beep_enable(const sensors_chip_name *name,
|
||||||
|
const sensors_feature *feature,
|
||||||
int label_size)
|
int label_size)
|
||||||
{
|
{
|
||||||
char *label;
|
char *label;
|
||||||
|
const sensors_subfeature *subfeature;
|
||||||
double beep_enable;
|
double beep_enable;
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
if ((label = sensors_get_label(name, f_beep))
|
subfeature = sensors_get_all_subfeatures(name, feature, &i);
|
||||||
&& !sensors_get_value(name, f_beep, &beep_enable)) {
|
if (!subfeature)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ((label = sensors_get_label(name, feature))
|
||||||
|
&& !sensors_get_value(name, subfeature->number, &beep_enable)) {
|
||||||
print_label(label, label_size);
|
print_label(label, label_size);
|
||||||
printf("%s\n", beep_enable ? "enabled" : "disabled");
|
printf("%s\n", beep_enable ? "enabled" : "disabled");
|
||||||
}
|
}
|
||||||
@@ -413,7 +425,7 @@ static void print_chip_beep_enable(const sensors_chip_name *name, int f_beep,
|
|||||||
|
|
||||||
void print_chip(const sensors_chip_name *name)
|
void print_chip(const sensors_chip_name *name)
|
||||||
{
|
{
|
||||||
const sensors_subfeature *feature;
|
const sensors_feature *feature;
|
||||||
int i, label_size;
|
int i, label_size;
|
||||||
|
|
||||||
label_size = sensors_get_label_size(name);
|
label_size = sensors_get_label_size(name);
|
||||||
@@ -431,11 +443,10 @@ void print_chip(const sensors_chip_name *name)
|
|||||||
print_chip_fan(name, feature, label_size);
|
print_chip_fan(name, feature, label_size);
|
||||||
break;
|
break;
|
||||||
case SENSORS_FEATURE_VID:
|
case SENSORS_FEATURE_VID:
|
||||||
print_chip_vid(name, feature->number, label_size);
|
print_chip_vid(name, feature, label_size);
|
||||||
break;
|
break;
|
||||||
case SENSORS_FEATURE_BEEP_ENABLE:
|
case SENSORS_FEATURE_BEEP_ENABLE:
|
||||||
print_chip_beep_enable(name, feature->number,
|
print_chip_beep_enable(name, feature, label_size);
|
||||||
label_size);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in new issue
Block a user