mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-08-31 22:35:23 +00:00
Rename sensors_feature_data.mode to flags, as we plan to use it to
store non-mode flags soon. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4757 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
@@ -238,7 +238,7 @@ int sensors_get_value(const sensors_chip_name *name, int feature,
|
|||||||
alt_feature = sensors_lookup_feature_nr(name,
|
alt_feature = sensors_lookup_feature_nr(name,
|
||||||
main_feature->data.compute_mapping);
|
main_feature->data.compute_mapping);
|
||||||
|
|
||||||
if (!(main_feature->data.mode & SENSORS_MODE_R))
|
if (!(main_feature->data.flags & SENSORS_MODE_R))
|
||||||
return -SENSORS_ERR_ACCESS_R;
|
return -SENSORS_ERR_ACCESS_R;
|
||||||
for (chip = NULL;
|
for (chip = NULL;
|
||||||
!expr && (chip = sensors_for_all_config_chips(name, chip));)
|
!expr && (chip = sensors_for_all_config_chips(name, chip));)
|
||||||
@@ -285,7 +285,7 @@ int sensors_set_value(const sensors_chip_name *name, int feature,
|
|||||||
alt_feature = sensors_lookup_feature_nr(name,
|
alt_feature = sensors_lookup_feature_nr(name,
|
||||||
main_feature->data.compute_mapping);
|
main_feature->data.compute_mapping);
|
||||||
|
|
||||||
if (!(main_feature->data.mode & SENSORS_MODE_W))
|
if (!(main_feature->data.flags & SENSORS_MODE_W))
|
||||||
return -SENSORS_ERR_ACCESS_W;
|
return -SENSORS_ERR_ACCESS_W;
|
||||||
for (chip = NULL;
|
for (chip = NULL;
|
||||||
!expr && (chip = sensors_for_all_config_chips(name, chip));)
|
!expr && (chip = sensors_for_all_config_chips(name, chip));)
|
||||||
|
@@ -132,7 +132,7 @@ typedef struct sensors_bus {
|
|||||||
compute_mapping is like logical_mapping, only it refers to another
|
compute_mapping is like logical_mapping, only it refers to another
|
||||||
feature whose compute line will be inherited (a group could be fan and
|
feature whose compute line will be inherited (a group could be fan and
|
||||||
fan_max, but not fan_div)
|
fan_max, but not fan_div)
|
||||||
mode is a bitfield, its value is a combination of SENSORS_MODE_R (readable)
|
flags is a bitfield, its value is a combination of SENSORS_MODE_R (readable)
|
||||||
and SENSORS_MODE_W (writable).
|
and SENSORS_MODE_W (writable).
|
||||||
scaling is the number of decimal points to scale by.
|
scaling is the number of decimal points to scale by.
|
||||||
Divide the read value by 10**scaling to get the real value. */
|
Divide the read value by 10**scaling to get the real value. */
|
||||||
|
@@ -115,11 +115,11 @@ This structure is used when you want to get all features of a specific chip.
|
|||||||
.br
|
.br
|
||||||
int compute_mapping;
|
int compute_mapping;
|
||||||
.br
|
.br
|
||||||
int mode;
|
unsigned int flags;
|
||||||
.br
|
.br
|
||||||
} sensors_feature_data;\fP
|
} sensors_feature_data;\fP
|
||||||
.br
|
.br
|
||||||
The mode field is a bitfield, its value is a combination of
|
The flags field is a bitfield, its value is a combination of
|
||||||
SENSORS_MODE_R (readable) and SENSORS_MODE_W (writable).
|
SENSORS_MODE_R (readable) and SENSORS_MODE_W (writable).
|
||||||
|
|
||||||
\fBconst sensors_feature_data *sensors_get_all_features
|
\fBconst sensors_feature_data *sensors_get_all_features
|
||||||
|
@@ -112,7 +112,7 @@ int sensors_do_chip_sets(const sensors_chip_name *name);
|
|||||||
const sensors_chip_name *sensors_get_detected_chips(const sensors_chip_name
|
const sensors_chip_name *sensors_get_detected_chips(const sensors_chip_name
|
||||||
*match, int *nr);
|
*match, int *nr);
|
||||||
|
|
||||||
/* These defines are used in the mode field of sensors_feature_data */
|
/* These defines are used in the flags field of sensors_feature_data */
|
||||||
#define SENSORS_MODE_R 1
|
#define SENSORS_MODE_R 1
|
||||||
#define SENSORS_MODE_W 2
|
#define SENSORS_MODE_W 2
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ typedef struct sensors_feature_data {
|
|||||||
sensors_feature_type type;
|
sensors_feature_type type;
|
||||||
int mapping;
|
int mapping;
|
||||||
int compute_mapping;
|
int compute_mapping;
|
||||||
int mode;
|
unsigned int flags;
|
||||||
} sensors_feature_data;
|
} sensors_feature_data;
|
||||||
|
|
||||||
/* This returns all features of a specific chip. They are returned in
|
/* This returns all features of a specific chip. They are returned in
|
||||||
|
@@ -153,9 +153,9 @@ static int sensors_read_dynamic_chip(sensors_chip_features *chip,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (attr->method & SYSFS_METHOD_SHOW)
|
if (attr->method & SYSFS_METHOD_SHOW)
|
||||||
feature.data.mode |= SENSORS_MODE_R;
|
feature.data.flags |= SENSORS_MODE_R;
|
||||||
if (attr->method & SYSFS_METHOD_STORE)
|
if (attr->method & SYSFS_METHOD_STORE)
|
||||||
feature.data.mode |= SENSORS_MODE_W;
|
feature.data.flags |= SENSORS_MODE_W;
|
||||||
|
|
||||||
feature.scaling = get_type_scaling(type);
|
feature.scaling = get_type_scaling(type);
|
||||||
|
|
||||||
|
@@ -88,7 +88,7 @@ readUnknownChip
|
|||||||
if (!(label = sensors_get_label (chip, sensor->number))) {
|
if (!(label = sensors_get_label (chip, sensor->number))) {
|
||||||
sensorLog (LOG_ERR, "Error getting sensor label: %s/%s", chip->prefix, sensor->name);
|
sensorLog (LOG_ERR, "Error getting sensor label: %s/%s", chip->prefix, sensor->name);
|
||||||
ret = 21;
|
ret = 21;
|
||||||
} else if (!(sensor->mode & SENSORS_MODE_R)) {
|
} else if (!(sensor->flags & SENSORS_MODE_R)) {
|
||||||
sensorLog (LOG_INFO, "%s: %s", sensor->name, label);
|
sensorLog (LOG_INFO, "%s: %s", sensor->name, label);
|
||||||
} else if ((ret = sensors_get_value (chip, sensor->number, &value))) {
|
} else if ((ret = sensors_get_value (chip, sensor->number, &value))) {
|
||||||
sensorLog (LOG_ERR, "Error getting sensor data: %s/%s: %s", chip->prefix, sensor->name, sensors_strerror (ret));
|
sensorLog (LOG_ERR, "Error getting sensor data: %s/%s: %s", chip->prefix, sensor->name, sensors_strerror (ret));
|
||||||
|
@@ -41,7 +41,7 @@ void print_chip_raw(const sensors_chip_name *name)
|
|||||||
data->name);
|
data->name);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (data->mode & SENSORS_MODE_R) {
|
if (data->flags & SENSORS_MODE_R) {
|
||||||
if (sensors_get_value(name, data->number, &val))
|
if (sensors_get_value(name, data->number, &val))
|
||||||
printf("ERROR: Can't get feature `%s' data!\n",
|
printf("ERROR: Can't get feature `%s' data!\n",
|
||||||
data->name);
|
data->name);
|
||||||
|
Reference in New Issue
Block a user