Changeset 4766
- Timestamp:
- 09/05/07 14:28:31 (1 year ago)
- Files:
-
- lm-sensors/branches/lm-sensors-3.0.0/lib/access.c (modified) (1 diff)
- 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) (2 diffs)
- lm-sensors/branches/lm-sensors-3.0.0/prog/sensors/chips.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lm-sensors/branches/lm-sensors-3.0.0/lib/access.c
r4760 r4766 563 563 const struct feature_subtype_match *submatches; 564 564 565 /* Special case */ 566 if (!strcmp(name, "beep_enable")) { 567 *nr = 0; 568 return SENSORS_FEATURE_BEEP_ENABLE; 569 } 570 565 571 for (i = 0; i < ARRAY_SIZE(matches); i++) 566 572 if ((count = sscanf(name, matches[i].name, nr, &c))) lm-sensors/branches/lm-sensors-3.0.0/lib/sensors.h
r4758 r4766 155 155 SENSORS_FEATURE_VID = 0x300, 156 156 157 SENSORS_FEATURE_BEEP_ENABLE = 0x1100, 158 157 159 SENSORS_FEATURE_UNKNOWN = INT_MAX, 158 160 } sensors_feature_type; lm-sensors/branches/lm-sensors-3.0.0/lib/sysfs.c
r4765 r4766 39 39 #define MAX_SENSORS_PER_TYPE 20 40 40 #define MAX_SUB_FEATURES 6 41 /* Room for all 3 types (in, fan, temp) with all their subfeatures + VID */ 41 /* Room for all 3 types (in, fan, temp) with all their subfeatures + VID 42 + misc features */ 42 43 #define ALL_POSSIBLE_FEATURES (MAX_SENSORS_PER_TYPE * MAX_SUB_FEATURES * 6 \ 43 + MAX_SENSORS_PER_TYPE )44 + MAX_SENSORS_PER_TYPE + 1) 44 45 45 46 static … … 110 111 /* "calculate" a place to store the feature in our sparse, 111 112 sorted table */ 112 if (type == SENSORS_FEATURE_VID) { 113 switch (type) { 114 case SENSORS_FEATURE_VID: 113 115 i = nr + MAX_SENSORS_PER_TYPE * MAX_SUB_FEATURES * 6; 114 } else { 116 break; 117 case SENSORS_FEATURE_BEEP_ENABLE: 118 i = MAX_SENSORS_PER_TYPE * MAX_SUB_FEATURES * 6 + 119 MAX_SENSORS_PER_TYPE; 120 break; 121 default: 115 122 i = (type >> 8) * MAX_SENSORS_PER_TYPE * 116 123 MAX_SUB_FEATURES * 2 + nr * MAX_SUB_FEATURES * 2 + lm-sensors/branches/lm-sensors-3.0.0/prog/sensors/chips.c
r4757 r4766 387 387 print_label(label, label_size); 388 388 printf("%+6.3f V\n", vid); 389 } 390 free(label); 391 } 392 393 static void print_chip_beep_enable(const sensors_chip_name *name, int f_beep, 394 int label_size) 395 { 396 char *label; 397 double beep_enable; 398 399 if ((label = sensors_get_label(name, f_beep)) 400 && !sensors_get_value(name, f_beep, &beep_enable)) { 401 print_label(label, label_size); 402 printf("%s\n", beep_enable ? "enabled" : "disabled"); 389 403 } 390 404 free(label); … … 416 430 print_chip_vid(name, feature->number, label_size); 417 431 break; 432 case SENSORS_FEATURE_BEEP_ENABLE: 433 print_chip_beep_enable(name, feature->number, 434 label_size); 435 break; 418 436 default: 419 437 continue;
