Changeset 4208
- Timestamp:
- 10/13/06 21:55:41 (7 years ago)
- Location:
- lm-sensors/trunk
- Files:
-
- 10 modified
-
CHANGES (modified) (1 diff)
-
lib/access.c (modified) (1 diff)
-
lib/conf-parse.y (modified) (2 diffs)
-
lib/data.h (modified) (1 diff)
-
lib/init.c (modified) (1 diff)
-
lib/libsensors.3 (modified) (3 diffs)
-
lib/proc.c (modified) (2 diffs)
-
lib/sensors.conf.5 (modified) (3 diffs)
-
lib/sensors.h (modified) (1 diff)
-
lib/sysfs.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/CHANGES
r4206 r4208 5 5 Library: Add support for the pc87247 driver (fans only) 6 6 Probe for busses before chips 7 Drop support for algorithm names 7 8 Man page sensors.1: Update (option -c) and clean up 8 9 Module icspll: Delete. It was useless and dangerous. -
lm-sensors/trunk/lib/access.c
r4098 r4208 318 318 } 319 319 320 /* This function is deprecated and will be dropped soon. */ 320 321 const char *sensors_get_algorithm_name(int bus_nr) 321 322 { 322 int i; 323 324 if (bus_nr == SENSORS_CHIP_NAME_BUS_ISA) 325 return "ISA algorithm"; 326 if (bus_nr == SENSORS_CHIP_NAME_BUS_PCI) 327 return "PCI algorithm"; 328 if (bus_nr == SENSORS_CHIP_NAME_BUS_DUMMY) 329 return "Dummy algorithm"; 330 for (i = 0; i < sensors_proc_bus_count; i++) 331 if (sensors_proc_bus[i].number == bus_nr) 332 return sensors_proc_bus[i].algorithm; 333 return NULL; 323 return "No longer available"; 334 324 } 335 325 -
lm-sensors/trunk/lib/conf-parse.y
r2345 r4208 135 135 136 136 line: bus_statement EOL 137 | busalgo_statement EOL 137 138 | label_statement EOL 138 139 | set_statement EOL … … 143 144 ; 144 145 145 bus_statement: BUS i2cbus_name adapter_name algorithm_name146 bus_statement: BUS i2cbus_name adapter_name 146 147 { sensors_bus new_el; 147 148 new_el.lineno = $1; 148 149 new_el.number = $2; 149 150 new_el.adapter = $3; 150 new_el.algorithm = $4;151 151 bus_add_el(&new_el); 152 152 } 153 ; 154 155 /* for compatibility, deprecated */ 156 busalgo_statement: BUS i2cbus_name adapter_name algorithm_name 157 { sensors_bus new_el; 158 new_el.lineno = $1; 159 new_el.number = $2; 160 new_el.adapter = $3; 161 free($4); 162 bus_add_el(&new_el); 163 } 153 164 ; 154 165 -
lm-sensors/trunk/lib/data.h
r3091 r4208 112 112 113 113 /* Config file bus declaration: the i2c bus number, combined with adapter 114 and algorithm names*/114 name */ 115 115 typedef struct sensors_bus { 116 116 int number; 117 117 char *adapter; 118 char *algorithm;119 118 int lineno; 120 119 } sensors_bus; -
lm-sensors/trunk/lib/init.c
r4198 r4208 104 104 { 105 105 free(bus.adapter); 106 free(bus.algorithm);107 106 } 108 107 -
lm-sensors/trunk/lib/libsensors.3
r4157 r4208 25 25 .\" References consulted: 26 26 .\" libsensors source code 27 .TH libsensors 3 " December 30, 1998" "" "Linux Programmer's Manual"27 .TH libsensors 3 "October 2006" "" "Linux Programmer's Manual" 28 28 .SH NAME 29 libsensors \- public ally accessible functions provided by the sensors library29 libsensors \- publicly accessible functions provided by the sensors library 30 30 .SH SYNOPSIS 31 31 .nf … … 40 40 .B int sensors_chip_name_has_wildcards(sensors_chip_name chip); 41 41 .B const char *sensors_get_adapter_name(int bus_nr); 42 .B const char *sensors_get_algorithm_name(int bus_nr);43 42 .B int sensors_get_label(sensors_chip_name name, int feature, 44 43 \fBchar **result);\fP … … 80 79 .B const char *sensors_get_adapter_name(int bus_nr); 81 80 .br 81 This function returns the adapter name of a bus number, as used within the 82 sensors_chip_name structure. If it could not be found, it returns NULL. 83 82 84 .B const char *sensors_get_algorithm_name(int bus_nr); 83 85 .br 84 These functions return the adapter and algorithm names of a bus number, as used within the sensors_chip_name structure. If it could not be found, it returns NULL 86 This function used to return the algorithm name of a bus number. 87 It is now deprecated and returns an arbitrary string. It will be dropped 88 in a later version of the library so you should stop using it. 85 89 86 90 \fBint sensors_get_label(sensors_chip_name name, int feature, -
lm-sensors/trunk/lib/proc.c
r4081 r4208 95 95 if (! (border = rindex(line,'\t'))) 96 96 goto ERROR; 97 if (! (entry.algorithm = strdup(border+1))) 98 goto FAT_ERROR; 97 /* Skip algorithm name */ 99 98 *border='\0'; 100 99 if (! (border = rindex(line,'\t'))) … … 110 109 if (sensors_parse_i2cbus_name(line,&entry.number)) 111 110 goto ERROR; 112 sensors_strip_of_spaces(entry.algorithm);113 111 sensors_strip_of_spaces(entry.adapter); 114 112 sensors_add_proc_bus(&entry); -
lm-sensors/trunk/lib/sensors.conf.5
r4157 r4208 24 24 .\" References consulted: 25 25 .\" sensors.conf.eg by Frodo Looijaard 26 .TH sensors.conf 5 " February 8, 1999" "" "Linux Programmer's Manual"26 .TH sensors.conf 5 "October 2006" "" "Linux Programmer's Manual" 27 27 .SH NAME 28 28 sensors.conf \- libsensors configuration file … … 125 125 126 126 .RS 127 bus "i2c\-0" "SMBus PIIX4 adapter at e800" "Non\-I2C SMBus adapter"127 bus "i2c\-0" "SMBus PIIX4 adapter at e800" 128 128 .RE 129 129 … … 140 140 always be quoted. 141 141 142 The second and third arguments are the 143 description texts. They must be exactly match the texts as they appear in 144 .IR /proc/bus/i2c , 145 except for trailing spaces, which are removed both from the /proc 146 entries and the arguments. The adapter description comes first, followed 147 by the algorithm description. 142 The second argument is the adapter name, it must match exactly the 143 adapter name as it appears in 144 .I /proc/bus/i2c 145 (2.4 kernel) 146 or 147 .I /sys/class/i2c-adapter/i2c-*/device/name 148 (2.6 kernel). 149 It should always be quoted as well as it will most certainly contain 150 spaces or dashes. 151 152 There used to be a third argument, the algorithm name. For compatibility 153 reasons, the parser still accepts this third argument, but ignores it. 148 154 149 155 The -
lm-sensors/trunk/lib/sensors.h
r4098 r4208 69 69 extern int sensors_chip_name_has_wildcards(sensors_chip_name chip); 70 70 71 /* Th ese functions return the adapter and algorithm namesof a bus number,71 /* This function returns the adapter name of a bus number, 72 72 as used within the sensors_chip_name structure. If it could not be found, 73 73 it returns NULL */ 74 74 extern const char *sensors_get_adapter_name(int bus_nr); 75 76 /* This function is deprecated and will be dropped soon. */ 75 77 extern const char *sensors_get_algorithm_name(int bus_nr); 76 78 -
lm-sensors/trunk/lib/sysfs.c
r4159 r4208 208 208 if (!strncmp(entry.adapter, "ISA ", 4)) { 209 209 entry.number = SENSORS_CHIP_NAME_BUS_ISA; 210 entry.algorithm = strdup("ISA bus algorithm");211 210 } else if (sscanf(clsdev->name, "i2c-%d", &entry.number) != 1) { 212 211 entry.number = SENSORS_CHIP_NAME_BUS_DUMMY; 213 entry.algorithm = strdup("Dummy bus algorithm"); 214 } else 215 entry.algorithm = strdup("Unavailable from sysfs"); 216 217 if (!entry.algorithm) 218 sensors_fatal_error(__FUNCTION__, "out of memory"); 212 } 219 213 220 214 sensors_add_proc_bus(&entry);
