Changeset 4758
- Timestamp:
- 09/05/07 10:17:22 (6 years ago)
- Location:
- lm-sensors/branches/lm-sensors-3.0.0/lib
- Files:
-
- 5 modified
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/branches/lm-sensors-3.0.0/lib/access.c
r4757 r4758 191 191 /* Looks up whether a feature should be ignored. Returns 192 192 1 if it should be ignored, 0 if not. This function takes 193 logicalmappings into account. */193 mappings into account. */ 194 194 static int sensors_get_ignored(const sensors_chip_name *name, 195 195 const sensors_chip_feature *feature) … … 233 233 return -SENSORS_ERR_NO_ENTRY; 234 234 235 if (main_feature->data.compute_mapping == SENSORS_NO_MAPPING) 235 if (main_feature->data.flags & SENSORS_COMPUTE_MAPPING) 236 alt_feature = sensors_lookup_feature_nr(name, 237 main_feature->data.mapping); 238 else 236 239 alt_feature = NULL; 237 else238 alt_feature = sensors_lookup_feature_nr(name,239 main_feature->data.compute_mapping);240 240 241 241 if (!(main_feature->data.flags & SENSORS_MODE_R)) … … 280 280 return -SENSORS_ERR_NO_ENTRY; 281 281 282 if (main_feature->data.compute_mapping == SENSORS_NO_MAPPING) 282 if (main_feature->data.flags & SENSORS_COMPUTE_MAPPING) 283 alt_feature = sensors_lookup_feature_nr(name, 284 main_feature->data.mapping); 285 else 283 286 alt_feature = NULL; 284 else285 alt_feature = sensors_lookup_feature_nr(name,286 main_feature->data.compute_mapping);287 287 288 288 if (!(main_feature->data.flags & SENSORS_MODE_W)) -
lm-sensors/branches/lm-sensors-3.0.0/lib/data.h
r4757 r4758 126 126 number is the internal feature number, used in many functions to refer 127 127 to this feature 128 logical_mapping is either SENSORS_NO_MAPPING if this is feature is the128 mapping is either SENSORS_NO_MAPPING if this is feature is the 129 129 main element of category; or it is the number of a feature with which 130 130 this feature is logically grouped (a group could be fan, fan_max and 131 131 fan_div) 132 compute_mapping is like logical_mapping, only it refers to another 133 feature whose compute line will be inherited (a group could be fan and 134 fan_max, but not fan_div) 135 flags is a bitfield, its value is a combination of SENSORS_MODE_R (readable) 136 and SENSORS_MODE_W (writable). 132 flags is a bitfield, its value is a combination of SENSORS_MODE_R (readable), 133 SENSORS_MODE_W (writable) and SENSORS_COMPUTE_MAPPING (affected by the 134 computation rules of the main feature). 137 135 scaling is the number of decimal points to scale by. 138 136 Divide the read value by 10**scaling to get the real value. */ -
lm-sensors/branches/lm-sensors-3.0.0/lib/libsensors.3
r4757 r4758 114 114 int mapping; 115 115 .br 116 int compute_mapping;117 .br118 116 unsigned int flags; 119 117 .br … … 121 119 .br 122 120 The flags field is a bitfield, its value is a combination of 123 SENSORS_MODE_R (readable) and SENSORS_MODE_W (writable). 121 SENSORS_MODE_R (readable), SENSORS_MODE_W (writable) and SENSORS_COMPUTE_MAPPING 122 (affected by the computation rules of the main feature). 124 123 125 124 \fBconst sensors_feature_data *sensors_get_all_features -
lm-sensors/branches/lm-sensors-3.0.0/lib/sensors.h
r4757 r4758 114 114 115 115 /* These defines are used in the flags field of sensors_feature_data */ 116 #define SENSORS_MODE_R 1 117 #define SENSORS_MODE_W 2 116 #define SENSORS_MODE_R 1 117 #define SENSORS_MODE_W 2 118 #define SENSORS_COMPUTE_MAPPING 4 118 119 119 120 /* This define is used in the mapping field of sensors_feature_data if no … … 123 124 /* This enum contains some "magic" used by sensors_read_dynamic_chip() from 124 125 lib/sysfs.c. All the sensor types (in, fan, temp, vid) are a multiple of 125 0x100 apart, and sensor features which should not have a compute _mapping to126 0x100 apart, and sensor features which should not have a compute mapping to 126 127 the _input feature start at 0x?10. */ 127 128 typedef enum sensors_feature_type { … … 164 165 sensors_feature_type type; 165 166 int mapping; 166 int compute_mapping;167 167 unsigned int flags; 168 168 } sensors_feature_data; -
lm-sensors/branches/lm-sensors-3.0.0/lib/sysfs.c
r4757 r4758 143 143 /* main feature */ 144 144 feature.data.mapping = SENSORS_NO_MAPPING; 145 feature.data.compute_mapping = SENSORS_NO_MAPPING; 146 } else if (type & 0x10) { 147 /* sub feature without compute mapping */ 145 } else { 146 /* sub feature */ 148 147 feature.data.mapping = i - i % MAX_SUB_FEATURES; 149 feature.data.compute_mapping = SENSORS_NO_MAPPING; 150 } else { 151 feature.data.mapping = i - i % MAX_SUB_FEATURES; 152 feature.data.compute_mapping = feature.data.mapping; 148 if (!(type & 0x10)) 149 feature.data.flags |= SENSORS_COMPUTE_MAPPING; 153 150 } 154 151
