2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-30 22:05:11 +00:00
Commit Graph

1427 Commits

Author SHA1 Message Date
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
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
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
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
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
042532f7fb Delete grab_busses.sh, it's deprecated. Use sensors --bus-list instead.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4782 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-05 21:22:39 +00:00
Jean Delvare
8f352d518c New sensors option: --bus-list. This option lists i2c buses that are
used by sensor chips on the running system, in a format suitable for
sensors.conf. This is a replacement for the old, broken grab_busses.sh
script. Benefits of having this directly in sensors:
* It lists only the i2c buses that are relevant to sensors.
* sensors is installed by default, while most people didn't have
  access to grab_busses.sh.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4781 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-05 21:19:45 +00:00
Jean Delvare
ff8230310b Stop mentioning the alias trick for i2c-dev, it no longer works and it
doesn't have anything to do with sensors anyway.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4777 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-05 16:45:19 +00:00
Jean Delvare
8b30917c16 Don't print an error message when libsensors returns a feature
we don't know. Just ignore that feature.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4774 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-05 15:56:28 +00:00
Jean Delvare
29bea1e843 Add support for the standard beep_enable attribute (#2248).
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4766 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-05 12:28:31 +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
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
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
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
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