Commit Graph
3802 Commits
Author SHA1 Message Date
Jean Delvare 06a8d04b5d Preserve error values returned by sensors_read_sysfs_attr() and
sensors_write_sysfs_attr().


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4851 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 13:17:53 +00:00
Jean Delvare 9ba88a7d1f Better prototype for get_type_scaling().
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4850 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:49:47 +00:00
Jean Delvare c390c9e29f Hide warnings about unused parameters.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4849 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:47:27 +00:00
Jean Delvare 5742812cfe Hide a warning in flex-generated file.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4848 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:36:56 +00:00
Jean Delvare 9698d82fd3 Rename sensors_get_label_size() to get_label_size() for consistency.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4847 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:33:12 +00:00
Jean Delvare e01466d993 New public library function: sensors_get_subfeature(). Applications can
use it to retrieve a specific subfeature by type. While it is slighly
less efficient than looping over sensors_get_all_subfeatures(), it
often makes the application code much more elegant.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4846 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:30:28 +00:00
Jean Delvare c08a168342 Use sensors_lookup_chip() wherever possible, it makes the code
more readable.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4845 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:24:13 +00:00
Jean Delvare e55b84392b Use sensors_lookup_chip() to speed up sensors_lookup_subfeature_name()
as well.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4844 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:23:38 +00:00
Jean Delvare 36f5b0dc4d New internal library function: sensors_lookup_chip(). It looks up a
chip in the detected chip list. It is more efficient to do it once
and for all than to do it over and over again in
sensors_lookup_feature_nr() and sensors_lookup_subfeature_nr() as
was done before.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4843 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:23:06 +00:00
Jean Delvare 586cec7fa1 sensors_lookup_subfeature_nr() can now be made static.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4842 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:20:48 +00:00
Jean Delvare e7c345f4cf Pass a subfeature structure to sensors_read_sysfs_attr() and
sensors_write_sysfs_attr(), rather than a subfeature number, so that
we do not have to lookup the feature number again.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4841 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:20:07 +00:00
Jean Delvare ba6614624b There's no rationale for preventing against setting the same
subfeature value several times. If the user asks for that, let's just
do it. Otherwise we have a performance penalty for all other users.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4840 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:19:29 +00:00
Jean Delvare 67d3060317 We can plain skip the feature lookup and compute statement search for
subfeatures with no compute mapping.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4839 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:18:46 +00:00
Jean Delvare da7b4e48da Introduce a separate type for main features. Make subfeatures map to
the real main feature rather than the first subfeature.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4838 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:16:50 +00:00
Jean Delvare 65f1d1f1cd Rename subfeature types from *_FEATURE_* to *_SUBFEATURE_*, to better
reflect what they represent.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4837 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:12:19 +00:00
Jean Delvare e13c11d353 Update the comments and symbols in the whole library code to refer to
features and subfeatures as appropriate.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4836 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:07:53 +00:00
Jean Delvare 9fe2b3c714 sensors_get_all_features has a single caller now, so fold
it thereinto.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4835 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:06:51 +00:00
Jean Delvare 96c914bfda Define a separate structure to represent main features. This allows
for faster main features lookup. One side effect of this change is
that subfeatures can no longer have labels nor be ignored. I do not
think that this is a problem in practice, and actually this makes a
lot of sense.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4834 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:05:16 +00:00
Jean Delvare bfe337fe76 Store current temperature, voltage and fan values together with
the rest of the subfeatures. This makes the code more simple, and
prepares for current values to be subfeatures like any others (i.e.
they can be missing.)


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4833 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:02:59 +00:00
Jean Delvare 79086fb7b8 Rename struct sensors_feature_data to sensors_subfeature. This is a
first step towards a clean separation between main features and
subfeatures.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4832 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:02:22 +00:00
Jean Delvare eba601a964 Split sensors_get_all_features() into two distinct functions, one to
get the list of all main features, and one to get the list of all the
subfeatures of a given main feature. This is a more logical interface for
applications to use. The current implementation is admittedly less than
optimal, because the storage structures weren't meant for it, but this
issue can (and will) be addressed later.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4831 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 12:00:59 +00:00
Jean Delvare 08a686e3cc sensors_feature_data and sensors_chip_feature are now the exact
same structure, so we can get rid of the former for simpler code.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4830 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 11:59:51 +00:00
Jean Delvare 60b50b6cb9 Fix compilation breakage with non-C99 compilers.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4829 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-21 18:15:32 +00:00
Jean Delvare 5bd020ad92 Scan chip features only once at initialization time, rather than on
each update. The chip list and chip features do not change until
sensors_cleanup() is called, so there's no point in doing the
same work over and over again.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4828 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-21 12:15:18 +00:00
Jean Delvare 49649fcf05 Restore support for beeps.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4827 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-20 21:24:12 +00:00
Jean Delvare 9cf1330eb0 Add support for beep features.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4826 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-20 21:23:19 +00:00
Jean Delvare 36ded1b5fc Restore support for alarms.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4825 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-20 21:22:42 +00:00
Jean Delvare 071e4a8008 Rename a few variables to something that makes more sense.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4824 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-20 16:22:13 +00:00
Jean Delvare a46211007e Better error handling when a feature value can't be read.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4822 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-19 16:53:16 +00:00
Jean Delvare afddd25552 Drop support for printing unknown chips: all chips are known now.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4819 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-19 15:16:14 +00:00
Jean Delvare 2837b67281 Delete unused formatting functions.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4818 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-19 15:12:58 +00:00
Jean Delvare 2e773670b8 Add generic chip support to sensord, much like sensors has.
Alarm and beep mask support is still missing.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4817 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-19 15:11:34 +00:00
Jean Delvare d3b00b0a86 Fix memory leaks in command line parsing.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4816 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-19 15:10:06 +00:00
Jean Delvare 347b0d1965 Fix a memory leak when daemonizing.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4815 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-19 14:25:19 +00:00
Jean Delvare 9730c57395 Add some more conversion rules for the thmc50 and adm1022.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4814 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-19 12:06:36 +00:00
Jean Delvare 4618795d52 Add a sample configuration section for the thmc50 and adm1022.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4813 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-19 12:05:31 +00:00
Jean Delvare 0ec61f1bc7 Warning fixes.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4807 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-18 20:53:42 +00:00
Jean Delvare 73cdb48635 Fix compilation breakage.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4806 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-18 20:46:06 +00:00
Jean Delvare 7d049ef600 Drop all the chip-specific support from sensord.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4805 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-18 20:37:36 +00:00
Jean Delvare bf9d0e2de6 Drop DataType_mhz, libsensors doesn't support this kind of feature.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4804 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-18 20:26:28 +00:00
Jean Delvare 8c817feaca Stop including obsolete header files.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4803 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-18 20:19:26 +00:00
Jean Delvare fee42795a2 Synchronize the sensord version with the lm-sensors version. We're
using the same version number for sensord since October 2002!


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4802 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-18 19:35:28 +00:00
Jean Delvare 0464f51062 Fix fan fault handling. We were testing for fan fault before actually
retrieving the fan features, so faults could not be detected. Swapping
the instructions fixes it.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4801 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-18 09:38:14 +00:00
Mark M. Hoffman fb362daf8d The sensors.conf file syntax currently allows for octal escape sequences, which
nobody uses. This feature is not even mentioned in the sensors.conf man page.
Kill it.



git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4797 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-16 15:47:16 +00:00
Mark M. Hoffman 91866b3ea1 Make sensors.conf entirely case-sensitive.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4796 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-16 15:34:52 +00:00
Mark M. Hoffman db283337af Add the following to svn:ignore properties:
./patches
	./.pc
	./prog/sensors/sensors3


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4795 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-16 14:59:14 +00:00
Mark M. Hoffman e95e7694f5 Fix -W options so flex/yacc code compiles completely without warnings. Also,
Use -Wundef everywhere except flex/yacc code, specifically.



git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4794 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-16 14:50:37 +00:00
Jean Delvare ab0e8eb731 Complete the previous memory leak fix.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4793 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-09 17:32:59 +00:00
Jean Delvare 3ff2df927b Fix sensors output when a temperature channel has a critical limit but
no max limit (for example the coretemp driver.)


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4791 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-08 10:47:03 +00:00
Jean Delvare 44c669a26d Don't use -Wundef for the library, flex/bison-generated code doesn't play
well with it.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4783 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-05 21:31:01 +00:00