Jean Delvare
20c98f41b7
The compute mapping value is either SENSORS_NO_MAPPING or the same
...
feature number as the logical mapping. This means that the compute
mapping can be turned into a simple boolean flag. Doing so makes
struct sensors_feature_data smaller, which saves some memory (about
17 kB in my tests.)
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4758 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-05 08:17:22 +00:00
Jean Delvare
87efbc06c5
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
2007-09-05 08:13:15 +00:00
Jean Delvare
079ba26574
Drop sensors_strip_of_spaces. There's no rationale for stripping
...
trailing spaces of bus names and nothing else.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4756 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-05 08:07:14 +00:00
Jean Delvare
3d15175ecd
Add max6680-* entry.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4755 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-05 08:06:03 +00:00
Jean Delvare
2a822a2d96
Start numbering the features at 0, not 1. There's nothing wrong with
...
having a feature number 0, and this makes the code slightly simpler.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4744 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-02 11:15:27 +00:00
Jean Delvare
75859ca9dc
Use the feature type rather than the feature name to figure out whether
...
we need to add "_input" to get the correct sysfs file name. This is
much faster. This is still a ugly hack I'd like to get rid of, but at
least now the slowdown is acceptable.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4743 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-02 11:09:16 +00:00
Jean Delvare
4b012c9f63
Drop useless return.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4742 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-02 10:55:03 +00:00
Jean Delvare
3c602aa03a
Remove broken ATI SB700 SMBus PCI ID. The SB700 SMBus actually uses the same
...
PCI device ID as the SB600 SMBus.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4740 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-01 08:23:21 +00:00
Jean Delvare
27200afa1d
Reorder functions so that forward declarations are no longer needed.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4737 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-31 15:09:26 +00:00
Jean Delvare
a82c6b0476
Mass reindent, coding style and whitespace cleanups.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4736 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-31 14:42:20 +00:00
Jean Delvare
02dc2e6679
Add support for the Intel Tolapai SMBus controller. Patch from Jason Gaston.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4735 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-31 14:09:32 +00:00
Jean Delvare
c00e21cf38
Reorder the members of the structures sensors_feature_data and
...
sensors_bus_id. This prevents wasting space with padding on 64-bit
systems, saving some memory (128 bytes for sensors_bus_id, nothing
yet for sensors_feature_data but it will come later).
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4733 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-30 21:23:22 +00:00
Jean Delvare
b491ba49d4
Make SENSORS_FEATURE_MAX_SUB_FEATURES private (and rename it to
...
MAX_SUB_FEATURES in the process.) This value could change in the
future so it's not safe to make it part of the libsensors API.
And it isn't needed either, applications shouldn't need to use
this value.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4732 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-30 21:21:15 +00:00
Jean Delvare
ed2b9171ec
Allocate the large sparse feature table in sensors_read_dynamic_chip()
...
dynamically. Having large amounts of data on the stack is generally not
recommended.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4731 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-30 21:10:41 +00:00
Jean Delvare
5b1068a007
Rename SENSORS_FEATURE_TEMP_SENS to SENSORS_FEATURE_TEMP_TYPE. This
...
better reflects what this feature is, in line with the sysfs file name.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4730 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-29 14:08:47 +00:00
Jean Delvare
38d1d82cec
Looking up a mapping can't fail if looking up the feature itself
...
succeeded (or that would be a bug in the library code.)
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4729 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-29 14:00:47 +00:00
Jean Delvare
2ee12591df
Remove "generic" from all printing function names. This is the default
...
mode now so no need to mention it explicitly.
Rename print_vid_info to print_chip_vid and move it around for
consistency.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4728 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 21:26:20 +00:00
Jean Delvare
eaeaffb89b
Fix a memory leak on error in raw print mode.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4726 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 21:14:37 +00:00
Jean Delvare
4e5d695411
Don't print the feature name for subfeatures in raw mode. Subfeatures
...
typically don't have a label so printing their label is equivalent
to printing their name, so printing it again is redundant.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4725 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 21:10:42 +00:00
Jean Delvare
deb41a945d
Move print_chip_raw() at the top of the file, as it is indepdendent from
...
all the other functions.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4724 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 20:55:36 +00:00
Jean Delvare
9fe77731a9
Fix error message in print_chip_raw().
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4723 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 20:52:24 +00:00
Jean Delvare
60b2bafabd
Drop function get_feature_value, it wasn't adding much value.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4720 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 20:41:53 +00:00
Jean Delvare
868fd8d093
Avoid the conversions from double to float.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4719 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 20:41:03 +00:00
Jean Delvare
4716a8c8f1
Change print_temp_limits() to expose a sane interface. This lets us get
...
rid of arbitrary constants. Now we can reuse the same code to display
the extra temperature limits.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4718 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 20:37:15 +00:00
Jean Delvare
9da5883c98
Move the printing of the current temperature out of print_temp_info().
...
That way we don't need to use an arbitrary value to carry the fault
information.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4717 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 20:36:46 +00:00
Jean Delvare
02e4d6fe83
print_temp_info is only ever called with precision values of 1, so we
...
can hard-code this precision for improved performance.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4716 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 20:35:26 +00:00
Jean Delvare
2cc20c4487
Only consider the main features when computing how much room we need
...
to print the labels. This is both a fix (beforehand we would leave
enough room to print possibly long subfeature names, even though we
do not actually print subfeature names at all) and a significant
performance boost. This change alone shrinks the CPU cost of a sensors
run by 4.5%.
I am still worried that this feature causes us to allocate each label
string twice, but I guess this overhead is now acceptable.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4715 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 20:34:55 +00:00
Jean Delvare
f0f3df8a48
Labels do fit in the imparted space by construction now, so no need
...
to check.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4714 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 20:33:21 +00:00
Jean Delvare
7ba794d9ba
Clean up the global variables:
...
* do_sets, do_raw and hide_adapter are only used in main.c and could
thus be declared static.
* fahrenheit and degstr are used in chips.c as well, so they should be
declared in a header file.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4713 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 13:24:46 +00:00
Jean Delvare
55291db894
Reorder the functions so as to get rid of unneeded forward
...
declarations.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4712 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 13:22:28 +00:00
Jean Delvare
364bd24c44
config_file doesn't need to be a global. Also move the handling of
...
the configuration file in a single separate function for clarity.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4711 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 13:21:05 +00:00
Jean Delvare
c649ae5ac3
Merge chips_generic.c into chips.c. The boundary between both files was
...
only historical, and prevents us from doing a number of cleanups.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4710 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 12:19:07 +00:00
Jean Delvare
7268001a5d
libsensors no longer returns ignored features so no need to check for
...
this in applications anymore.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4709 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 11:45:46 +00:00
Jean Delvare
252c5faf86
Mass reindent and coding style cleanups.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4708 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 10:57:16 +00:00
Jean Delvare
c91457b7de
Executing the set statements is an exclusive action.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4706 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 08:57:48 +00:00
Jean Delvare
5ba408a37f
Merge most of the usage help text into a single string. This is way
...
more efficient.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4705 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 08:43:30 +00:00
Jean Delvare
ec8ba95b53
Refactor the configuration file path.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4704 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 08:42:20 +00:00
Jean Delvare
b8b417c51e
Thanks to the new prototype of sensors_get_detected_chips, we no
...
longer need to build an array from the chip names passed on the
command line. Instead, we can process them one after the other
directly. This saves some memory and allows for minor code cleanups.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4703 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 08:28:10 +00:00
Jean Delvare
a9a48ea2a9
Make sensors_match_chip internal to libsensors. It is no longer used by
...
applications in practice.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4702 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 08:26:51 +00:00
Jean Delvare
4d6bec8bb2
Add a parameter to sensors_get_detected_chips(), to optionally let the
...
caller select which subset of chips it wants. This is slightly better
size-wise than letting all applications do the filtering by themselves.
This will change the way the command line parameters of "sensors" are
interpreted. Beforehand, the chips were always returned in the order
in which they were listed by the library. Also, each chip could be listed
only once. From now on, the chips will be listed in the order in which
they are passed on the command line, which I think makes more sense. A
side effect is that chips can be listed more than once, if that's what
the user asks for. Not very useful though.
This change makes it possible to make sensors_match_chip() internal
to the library. Filtering the list of chips returned by
sensors_get_detected_chips() was the last known external use for this
function.
This patch looks much bigger than it really is, but the largest part is
really only code reindentation.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4701 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 08:26:20 +00:00
Jean Delvare
ff4cfd53d5
Delete file BUGS. All documented bugs are in kernel drivers so the
...
information no longer belongs to this package. Most of it seems to be
outdated anyway.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4700 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-25 11:49:07 +00:00
Jean Delvare
0c24a60643
Drop the CONFORMING TO sections from the man pages. lm-sensors is in no way
...
an official standard so it doesn't make much sense. Instead, use the 4th
field of .TH to mention that these tools are part of lm-sensors.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4699 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-23 08:14:48 +00:00
Jean Delvare
bf1ff10ab4
Relabel "sensors -u" from "unknown chip" to "raw chip". sensors uses generic
...
code to display all the chips now so the notion of "unknown chip" no longer
exists, however this raw output format can still be useful for debugging.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4698 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-23 07:45:58 +00:00
Jean Delvare
90c2942bef
Drop sensors option -U, --hide-unknown. libsensors no longer exposes
...
chips with no features, and it builds the features list dynamically, so
applications no longer get to see unknown chips.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4697 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-22 18:43:48 +00:00
Jean Delvare
a30d37899f
Drop SENSORS_MODE_NO_RW and SENSORS_MODE_RW. The mode is a bitfield,
...
we typically set, or test for, a specific bit.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4696 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-22 17:07:11 +00:00
Jean Delvare
b0fb417996
sensors_get_value() and sensors_set_value(), respectively.
...
The new names better reflect what the functions do.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4695 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-22 17:06:13 +00:00
Jean Delvare
8bcdc331a0
Change the prototype of sensors_get_label(). Errors can be reported
...
with a NULL pointer.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4694 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-22 17:05:01 +00:00
Jean Delvare
12655c1d85
Drop support for reloading the configuration with sensors_init().
...
Instead, the application will have to call sensors_exit() explicitly
before calling sensors_init() again. Most applications don't offer
any way to reload the configuration file, so better optimize for the
initial load.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4693 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-22 17:04:12 +00:00
Jean Delvare
fe165fea49
Fix error message.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4692 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-21 09:08:52 +00:00
Jean Delvare
5524486161
Add support for hardware monitoring chips on SPI buses.
...
SPI bus statements in the configuration file are not yet supported, as
SPI buses don't have a name attribute yet, it's not possible to identify
them and thus no substitution is possible.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4689 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-19 15:07:05 +00:00