Changeset 4554
- Timestamp:
- 07/05/07 18:09:40 (1 year ago)
- Files:
-
- lm-sensors/branches/lm-sensors-3.0.0/lib/sensors.h (modified) (1 diff)
- lm-sensors/branches/lm-sensors-3.0.0/lib/sysfs.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lm-sensors/branches/lm-sensors-3.0.0/lib/sensors.h
r4543 r4554 146 146 147 147 /* This enum contains some "magic" used by sensors_read_dynamic_chip() from 148 lib/sysfs.c . All the sensor-types (in, fan, temp, misc) are a multiple of148 lib/sysfs.c. All the sensor types (in, fan, temp, vid) are a multiple of 149 149 0x100 apart, and sensor features which should not have a compute_mapping to 150 150 the _input feature start at 0x?10. */ lm-sensors/branches/lm-sensors-3.0.0/lib/sysfs.c
r4553 r4554 67 67 struct dlist *attrs; 68 68 /* room for all 3 (in, fan, temp) types, with all their subfeatures 69 + misc features. We use a large sparse table at first to store all69 + VID. We use a large sparse table at first to store all 70 70 found features, so that we can store them sorted at type and index 71 71 and then later create a dense sorted table */ 72 72 sensors_chip_feature features[MAX_SENSORS_PER_TYPE * 73 73 SENSORS_FEATURE_MAX_SUB_FEATURES * 3 + 74 SENSORS_FEATURE_MAX_SUB_FEATURES];74 MAX_SENSORS_PER_TYPE]; 75 75 sensors_chip_feature *dyn_features; 76 76 char *name; … … 106 106 } 107 107 108 /* Get N as in this is the N-th in / fan / temp sensor*/108 /* Get N as in this is the N-th in / fan / temp / vid */ 109 109 switch (type & 0xFF00) { 110 110 case SENSORS_FEATURE_IN: … … 119 119 if (i) i--; 120 120 break; 121 case SENSORS_FEATURE_VID: /* first misc feature */122 i = 0;121 case SENSORS_FEATURE_VID: 122 i = strtol(name + 3, NULL, 10); 123 123 break; 124 124 } … … 134 134 /* "calculate" a place to store the feature in our sparse, 135 135 sorted table */ 136 i = (type >> 8) * MAX_SENSORS_PER_TYPE * 137 SENSORS_FEATURE_MAX_SUB_FEATURES + 138 i * SENSORS_FEATURE_MAX_SUB_FEATURES + (type & 0xFF); 136 if (type == SENSORS_FEATURE_VID) { 137 i += MAX_SENSORS_PER_TYPE * 138 SENSORS_FEATURE_MAX_SUB_FEATURES * 3; 139 } else { 140 i = (type >> 8) * MAX_SENSORS_PER_TYPE * 141 SENSORS_FEATURE_MAX_SUB_FEATURES + 142 i * SENSORS_FEATURE_MAX_SUB_FEATURES + 143 (type & 0xFF); 144 } 139 145 140 146 if (features[i].data.name) { … … 149 155 feature.data.number = i + 1; 150 156 151 if ( (type & 0xFF00) == SENSORS_FEATURE_VID || 152 (type & 0x00FF) == 0) { 153 /* misc sensor or main feature */ 157 if ((type & 0x00FF) == 0) { 158 /* main feature */ 154 159 feature.data.mapping = SENSORS_NO_MAPPING; 155 160 feature.data.compute_mapping = SENSORS_NO_MAPPING;
