JF Linux Kernel 2.6 Documentation: /usr/src/linux/Documentation/hwmon/sysfs-interface

hwmon/sysfs-interface

sysfs ファイルのための名前付けとデータ書式の基準 [プレインテキスト版]


==================================
これは、
linux-2.6.14.4/Documentation/hwmon/sysfs-interface の和訳
です。
翻訳団体: JF プロジェクト < http://www.linux.or.jp/JF/ >
更新日 : 2006/01/30
翻訳者 : Hiroshi Suzuki < setter at reset dot jp >
校正者 : Masanori Kobayasi さん <zap03216 at nifty dot ne dot jp>
	Seiji Kaneko さん <skaneko at a2 dot mbn dot or dot jp>
	SUGIYAMA Tomoaki さん <tomos at webmasters dot gr dot jp>
==================================

Naming and data format standards for sysfs files

sysfs ファイルのための名前付けとデータ書式の基準
------------------------------------------------

The libsensors library offers an interface to the raw sensors data
through the sysfs interface. See libsensors documentation and source for
more further information. As of writing this document, libsensors
(from lm_sensors 2.8.3) is heavily chip-dependant. Adding or updating
support for any given chip requires modifying the library's code.
This is because libsensors was written for the procfs interface
older kernel modules were using, which wasn't standardized enough.
Recent versions of libsensors (from lm_sensors 2.8.2 and later) have
support for the sysfs interface, though.

libsensors ライブラリは、sysfs インタフェース経由で、生のセンサーデータへの
インタフェースを提供します。さらに詳細な情報は、libsensors の説明書とソースを見
てください。この説明書を執筆している時点では、(lm_sensors 2.8.3の) libsensors
は、極端にチップに依存しています。与えられたどんなチップでも、サポートの追加/更
新には、ライブラリコードの変更が必要です。なぜなら、libsensors は、より古いカー
ネルモジュールが使っていた、(充分に標準化されていない) procfs インタフェース用
に書かれているからです。
しかしながら、(lm_sensors 2.8.2 以降の) 最近の libsensors は、sysfs インタフェ
ースがサポートされます。

The new sysfs interface was designed to be as chip-independant as
possible.

新しい sysfs インタフェースは、できるだけチップ非依存となるように設計されてい
ます。

Note that motherboards vary widely in the connections to sensor chips.
There is no standard that ensures, for example, that the second
temperature sensor is connected to the CPU, or that the second fan is on
the CPU. Also, some values reported by the chips need some computation
before they make full sense. For example, most chips can only measure
voltages between 0 and +4V. Other voltages are scaled back into that
range using external resistors. Since the values of these resistors
can change from motherboard to motherboard, the conversions cannot be
hard coded into the driver and have to be done in user space.

マザーボードによってセンサーチップへの接続方法に大きな違いがあることに注意して
ください。例えば、2番目の温度センサーが CPU に接続されていることや、
2番目のファンが CPU に付いていることを保証するような基準はありません。
さらに、チップが報告する値のなかには、正しい意味を持たせるためにいくつかの計
算が必要なものもあります。例えば、ほとんどのチップは電圧を 0 から +4V の間のみ
で測定します。範囲を超える電圧は、外部抵抗を使い、その範囲に収まるように分圧さ
れます。それら分圧抵抗の値は、マザーボードによって異なるので、変換機能をドライ
バ内に埋め込むことができません。ですから、変換をユーザ空間で行わなければなりま
せん。

For this reason, even if we aim at a chip-independant libsensors, it will
still require a configuration file (e.g. /etc/sensors.conf) for proper
values conversion, labeling of inputs and hiding of unused inputs.

そのため、チップ非依存の libsensors を目指しても、適正値への変換、入力のラベル
付けや、使っていない入力を見せないための設定ファイル (例えば /etc/sensors.conf)
がまだ必要です。

An alternative method that some programs use is to access the sysfs
files directly. This document briefly describes the standards that the
drivers follow, so that an application program can scan for entries and
access this data in a simple and consistent way. That said, such programs
will have to implement conversion, labeling and hiding of inputs. For
this reason, it is still not recommended to bypass the library.

いくつかのプログラムが使う代わりの方法は、sysfs ファイルに直接アクセスすること
です。この文書は、ドライバが従うべき基準について簡潔に述べていて、
これにより、アプリケーションプログラムは、エントリを調べられ、単純で共通な方法
でデータにアクセスできます。しかし、そのようなプログラムは、変換機能、入力
のラベル付けや隠す機能を実装しなければなりません。そのため、この方法
によってライブラリを使わないことは推奨されません。

If you are developing a userspace application please send us feedback on
this standard.

ユーザ空間アプリケーションを開発するなら、この基準についてのフィードバックを
お願いします。

Note that this standard isn't completely established yet, so it is subject
to changes, even important ones. One more reason to use the library instead
of accessing sysfs files directly.

この基準は完全に確立されたわけではありませんので、変更は重要なものも対象になる
ことに注意してください。これは、直接 sysfs ファイルにアクセスする代わりに、
ライブラリを使うべきもう一つの理由です。

Each chip gets its own directory in the sysfs /sys/devices tree.  To
find all sensor chips, it is easier to follow the symlinks from
/sys/i2c/devices/

それぞれのチップは、sysfs /sys/devices ツリー内に自分用のディレクトリを持ちます。
すべてのセンサーチップを見つけるには、/sys/i2c/devices/ 内のシンボリックリンク
をたどるのが簡単です。

All sysfs values are fixed point numbers.  To get the true value of some
of the values, you should divide by the specified value.

すべての sysfs の値は、固定小数点の数値です。いくつかの値について、
実際の値を得るには、指定の値で除算しなければなりません。

There is only one value per file, unlike the older /proc specification.
The common scheme for files naming is: <type><number>_<item>. Usual
types for sensor chips are "in" (voltage), "temp" (temperature) and
"fan" (fan). Usual items are "input" (measured value), "max" (high
threshold, "min" (low threshold). Numbering usually starts from 1,
except for voltages which start from 0 (because most data sheets use
this). A number is always used for elements that can be present more
than once, even if there is a single element of the given type on the
specific chip. Other files do not refer to a specific element, so
they have a simple name, and no number.

より古い /proc の仕様とは違い、各ファイルにひとつだけの値があります。
ファイル命名の共通スキームは次のようになります: <type><number>_<item>
センサーチップの一般的な種類 <type> は、"in" (電圧), "temp" (温度),
"fan" (ファン) です。一般的な項目 <item> は、"input" (測定値),
"max" (最大のしきい値), min (最小のしきい値) です。
番号 <number> は、通常、1 からはじまりますが、電圧では、
0 (ほとんどのデータシートがこのようになっているので) からはじまります。
複数存在し得る要素に対しては、常に番号が使われます。この要素は、
たまたまそのシステムでの特定チップで与えられた種類 <type> の要素が1つ
であっても、番号が使われます。特定の要素を参照しない他のファイルでは、
番号を持たない単純な名前が使われます。

Alarms are direct indications read from the chips. The drivers do NOT
make comparisons of readings to thresholds. This allows violations
between readings to be caught and alarmed. The exact definition of an
alarm (for example, whether a threshold must be met or must be exceeded
to cause an alarm) is chip-dependent.

警報はチップから読み込まれたものを直接表示します。ドライバは読み込んだ値としき
い値の比較を*行いません*。これは、読み込み中の違反を捕え、警報を発することを可
能にします。警報の正確な定義 (例えば、しきい値に届いたか、それとも、超えたかに
よって、警報を発生させる) は、チップに依存します。

-------------------------------------------------------------------------

************
* Voltages *
*   電圧   *
************


in[0-8]_min	Voltage min value.
		Unit: millivolt
		Read/Write

in[0-8]_min	電圧の最小値。
		単位: ミリボルト
		読み書き可能
		
in[0-8]_max	Voltage max value.
		Unit: millivolt
		Read/Write

in[0-8]_max	電圧の最大値。
		単位: ミリボルト
		読み書き可能
		
in[0-8]_input	Voltage input value.
		Unit: millivolt
		Read only
		Actual voltage depends on the scaling resistors on the
		motherboard, as recommended in the chip datasheet.
		This varies by chip and by motherboard.
		Because of this variation, values are generally NOT scaled
		by the chip driver, and must be done by the application.
		However, some drivers (notably lm87 and via686a)
		do scale, with various degrees of success.
		These drivers will output the actual voltage.

in[0-8]_input	電圧の入力値。
		単位: ミリボルト
		読み込み専用
		実際の電圧は、チップのデータシートで推奨されている、マザーボ
		ード上の分圧抵抗値に依存します。これは、チップとマザーボード
		によって変化します。この変化のために、通常、チップドライバで値
		の分圧分の補正は *行われない* ので、アプリケーションで行なわな
		ければなりません。しかしながら、いくつかのドライバ
		(特に、lm87 と via686a) は、サポートの範囲は様々ですが、分圧分
		の補正を行います。
		それらドライバは実際の電圧を出力します。

		Typical usage:
			in0_*	CPU #1 voltage (not scaled)
			in1_*	CPU #2 voltage (not scaled)
			in2_*	3.3V nominal (not scaled)
			in3_*	5.0V nominal (scaled)
			in4_*	12.0V nominal (scaled)
			in5_*	-12.0V nominal (scaled)
			in6_*	-5.0V nominal (scaled)
			in7_*	varies
			in8_*	varies

		標準的な使用法:
			in0_*	CPU #1 電圧 (縮尺されない)
			in1_*	CPU #2 voltage (縮尺されない)
			in2_*	3.3V 公称値 (縮尺されない)
			in3_*	5.0V 公称値 (縮尺される)
			in4_*	12.0V 公称値 (縮尺される)
			in5_*	-12.0V 公称値 (縮尺される)
			in6_*	-5.0V 公称値 (縮尺される)
			in7_*	変動する
			in8_*	変動する

cpu[0-1]_vid	CPU core reference voltage.
		Unit: millivolt
		Read only.
		Not always correct.

cpu[0-1]_vid	CPU コアの参照電圧
		単位: ミリボルト
		読み込み専用
		正しい値とは限りません。

vrm		Voltage Regulator Module version number.
		Read only.
		Two digit number, first is major version, second is
		minor version.
		Affects the way the driver calculates the CPU core reference
		voltage from the vid pins.

vrm		安定化電源モジュールのバージョン番号。
		読み込み専用
		2桁の数字で、最初はメジャーバージョン、2番目はマイナーバージョ
		ン。ドライバが計算する、vid ピンからの、CPU コア 参照電圧の計算
		方法に影響します。

********
* Fans *
* ファン *
********

fan[1-3]_min	Fan minimum value
		Unit: revolution/min (RPM)
		Read/Write.

fan[1-3]_min	ファン最低値
		単位: 回転/分 (RPM)
		読み書き可能

fan[1-3]_input	Fan input value.
		Unit: revolution/min (RPM)
		Read only.

fan[1-3]_input	ファン入力値
		単位: 回転/分 (RPM)
		読み込み専用

fan[1-3]_div	Fan divisor.
		Integer value in powers of two (1, 2, 4, 8, 16, 32, 64, 128).
		Some chips only support values 1, 2, 4 and 8.
		Note that this is actually an internal clock divisor, which
		affects the measurable speed range, not the read value.

fan[1-3]_div	ファン除数
		2のべき乗の整数値 (1, 2, 4, 8, 16, 32, 64, 128)。
		いくつかのチップは、1, 2, 4, 8 だけが使えます。
		これは、実際には内部のクロック分周値で、読み込み値にではなく、
		測定可能な速度範囲に影響します。

*******
* PWM *
*******

pwm[1-3]	Pulse width modulation fan control.
		Integer value in the range 0 to 255
		Read/Write
		255 is max or 100%.

pwm[1-3]	パルス幅変調ファン制御
		0 から 255 の整数値
		読み書き可能
		255 は、最大または 100% です。

pwm[1-3]_enable
		Switch PWM on and off.
		Not always present even if fan*_pwm is.
		0 to turn off
		1 to turn on in manual mode
		2 to turn on in automatic mode
		Read/Write

pwm[1-3]_enable
		PWM の入切の切り替え
		fan*_pwm が存在しても、この機能があるとは限りません。
		0 PWM を無効にする
		1 PWM をマニュアルモードで有効にする
		2 PWM を自動モードで有効にする
		読み書き可能

pwm[1-*]_auto_channels_temp
		Select which temperature channels affect this PWM output in
		auto mode. Bitfield, 1 is temp1, 2 is temp2, 4 is temp3 etc...
		Which values are possible depend on the chip used.

pwm[1-*]_auto_channels_temp
		自動モードで、どの温度系統が、この PWM 出力に影響するか選択し
		ます。ビットフィールドで、1 は temp1、2 は temp2、4は temp3
		など...
		どの値が使えるかは、使うチップに依存します。

pwm[1-*]_auto_point[1-*]_pwm
pwm[1-*]_auto_point[1-*]_temp
pwm[1-*]_auto_point[1-*]_temp_hyst
		Define the PWM vs temperature curve. Number of trip points is
		chip-dependent. Use this for chips which associate trip points
		to PWM output channels.

		PWM と温度の切り変え設定値群を定義します。切り替え地点の数は、
		チップに依存します。チップの切り替え地点と、PWM 出力系統を関連
		づけるのに使います。

OR
または、

temp[1-*]_auto_point[1-*]_pwm
temp[1-*]_auto_point[1-*]_temp
temp[1-*]_auto_point[1-*]_temp_hyst
		Define the PWM vs temperature curve. Number of trip points is
		chip-dependent. Use this for chips which associate trip points
		to temperature channels.

		PWM と温度の切り変え設定値群を定義します。切り替え地点の数は、
		チップに依存します。チップの切り替え地点と、温度系統を関連づけ
		るのに使います。

****************
* Temperatures *
*     温度     *
****************

temp[1-3]_type	Sensor type selection.
		Integers 1, 2, 3 or thermistor Beta value (3435)
		Read/Write.
		1: PII/Celeron Diode
		2: 3904 transistor
		3: thermal diode
		Not all types are supported by all chips

temp[1-3]_type	センサーの種類を選択する
		整数 1, 2, 3 か サーミスタ Beta 値 (3435)
		読み書き可能
		1: PII/Celeron ダイオード
		2: 2N3904 トランジスタ
		3: 温度ダイオード
		すべての種類が、すべてのチップで使えるわけではありません

temp[1-4]_max	Temperature max value.
		Unit: millidegree Celcius
		Read/Write value.

temp[1-4]_max	温度の最大値
		単位: 1000分の1度 (摂氏)
		読み書き可能

temp[1-3]_min	Temperature min value.
		Unit: millidegree Celcius
		Read/Write value.

temp[1-3]_min	温度の最低値
		単位: 1000分の1度 (摂氏)
		読み書き可能

temp[1-3]_max_hyst
		Temperature hysteresis value for max limit.
		Unit: millidegree Celcius
		Must be reported as an absolute temperature, NOT a delta
		from the max value.
		Read/Write value.

temp[1-3]_max_hyst
		限界値における、温度ヒステリシス値
		単位: 1000分の1度 (摂氏)
		最大値との差分ではなく、絶対温度で報告されなければなりません。
		読み書き可能

temp[1-4]_input Temperature input value.
		Unit: millidegree Celcius
		Read only value.

temp[1-4]_input 温度入力値
		単位: 1000分の1度 (摂氏)
		読み込み専用

temp[1-4]_crit	Temperature critical value, typically greater than
		corresponding temp_max values.
		Unit: millidegree Celcius
		Read/Write value.

temp[1-4]_crit	温度臨界値。通常、関連する temp_max の値より大きくします。
		単位: 1000分の1度 (摂氏)
		読み書き可能

temp[1-2]_crit_hyst
		Temperature hysteresis value for critical limit.
		Unit: millidegree Celcius
		Must be reported as an absolute temperature, NOT a delta
		from the critical value.
		Read/Write value.

		臨界点での、温度ヒステリシス値。
		単位: 1000分の1度 (摂氏)
		臨界値との差分ではなく、絶対温度で報告されなければなりません。
		読み書き可能

		If there are multiple temperature sensors, temp1_* is
		generally the sensor inside the chip itself,
		reported as "motherboard temperature".  temp2_* to
		temp4_* are generally sensors external to the chip
		itself, for example the thermal diode inside the CPU or
		a thermistor nearby.

		複数の温度センサーがあるなら、通常、temp1_* は、チップ自身の内
		部センサーで、"マザーボード温度" として報告されます。temp2_* か
		ら、temp4_* は、通常チップの外部センサーで、例えば、CPU 内部に
		ある温度ダイオードか、近くにあるサーミスタです。

************
* Currents *
*   電流   *
************

Note that no known chip provides current measurements as of writing,
so this part is theoretical, so to say.

この文書執筆時には、電流計測機能を提供するチップがないことに注意してください。
ですので、この部分は、理論上の物と言わざるを得ません。

curr[1-n]_max	Current max value
		Unit: milliampere
		Read/Write.

curr[1-n]_max	電流最大値
		単位: ミリアンペア
		読み書き可能

curr[1-n]_min	Current min value.
		Unit: milliampere
		Read/Write.

curr[1-n]_min	電流最小値
		単位: ミリアンペア
		読み書き可能

curr[1-n]_input	Current input value
		Unit: milliampere
		Read only.

curr[1-n]_input	電流入力値
		単位: ミリアンペア
		読み込み専用

*********
* Other *
* その他 *
*********

alarms		Alarm bitmask.
		Read only.
		Integer representation of one to four bytes.
		A '1' bit means an alarm.
		Chips should be programmed for 'comparator' mode so that
		the alarm will 'come back' after you read the register
		if it is still valid.
		Generally a direct representation of a chip's internal
		alarm registers; there is no standard for the position
		of individual bits.
		Bits are defined in kernel/include/sensors.h.

alarms		警報ビットマスク
		読み込み専用
		1バイト から 4バイトで表現される整数値。
		'1' ビットは警報を意味します。
		チップは、警報の状況が続いている場合にレジスタを読んだ後警報が
		「再度報告される」ようにするため、'comparator'
		モードにプログラムしておくべきでしょう。
		通常、チップ内部の警報レジスタの値そのものになっています;
		各ビットの位置に基準はありません。
		ビットは、kernel/include/sensors.h に定義されています。

beep_enable	Beep/interrupt enable
		0 to disable.
		1 to enable.
		Read/Write

beep_enable	ビープ/割り込み を有効にする
		0 無効にする
		1 有効にする
		読み書き可能

beep_mask	Bitmask for beep.
		Same format as 'alarms' with the same bit locations.
		Read/Write

beep_mask	ビープ用ビットマスク
		同じビット位置で 'alarms' 形式と同じです。
		読み書き可能

eeprom		Raw EEPROM data in binary form.
		Read only.

eeprom		バイナリ形式の、生の EEPROM データ
		読み込み専用

Linux カーネル 2.6 付属文書一覧へ戻る