요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later
.. _remote_controllers_sysfs_nodes:
*******************************
Remote Controller's sysfs nodes
*******************************
As defined at Documentation/ABI/testing/sysfs-class-rc, those are
the sysfs nodes that control the Remote Controllers:
.. _sys_class_rc:
/sys/class/rc/
==============
The ``/sys/class/rc/`` class sub-directory belongs to the Remote
Controller core and provides a sysfs interface for configuring infrared
remote controller receivers.
.. _sys_class_rc_rcN:
/sys/class/rc/rcN/
==================
A ``/sys/class/rc/rcN`` directory is created for each remote control
receiver device where N is the number of the receiver.
.. _sys_class_rc_rcN_protocols:
/sys/class/rc/rcN/protocols
===========================
Reading this file returns a list of available protocols, something like::
rc5 [rc6] nec jvc [sony]
Enabled protocols are shown in [] brackets.
Writing "+proto" will add a protocol to the list of enabled protocols.
Writing "-proto" will remove a protocol from the list of enabled
protocols.
Writing "proto" will enable only "proto".
Writing "none" will disable all protocols.
Write fails with ``EINVAL`` if an invalid protocol combination or unknown
protocol name is used.
.. _sys_class_rc_rcN_filter:
/sys/class/rc/rcN/filter
========================
Sets the scancode filter expected value.
Use in combination with ``/sys/class/rc/rcN/filter_mask`` to set the
expected value of the bits set in the filter mask. If the hardware
supports it then scancodes which do not match the filter will be
ignored. Otherwise the write will fail with an error.
This value may be reset to 0 if the current protocol is altered.
.. _sys_class_rc_rcN_filter_mask:
/sys/class/rc/rcN/filter_mask
=============================
Sets the scancode filter mask of bits to compare. Use in combination
with ``/sys/class/rc/rcN/filter`` to set the bits of the scancode which
should be compared against the expected value. A value of 0 disables the
filter to allow all valid scancodes to be processed.
If the hardware supports it then scancodes which do not match the filter
will be ignored. Otherwise the write will fail with an error.
This value may be reset to 0 if the current protocol is altered.
.. _sys_class_rc_rcN_wakeup_protocols:
/sys/class/rc/rcN/wakeup_protocols
==================================
Reading this file returns a list of available protocols to use for the
wakeup filter, something like::
rc-5 nec nec-x rc-6-0 rc-6-6a-24 [rc-6-6a-32] rc-6-mce
Note that protocol variants are listed, so ``nec``, ``sony``, ``rc-5``, ``rc-6``
have their different bit length encodings listed if available.
Note that all protocol variants are listed.
The enabled wakeup protocol is shown in [] brackets.
Only one protocol can be selected at a time.
Writing "proto" will use "proto" for wakeup events.
Writing "none" will disable wakeup.
Write fails with ``EINVAL`` if an invalid protocol combination or unknown
protocol name is used, or if wakeup is not supported by the hardware.
.. _sys_class_rc_rcN_wakeup_filter:
/sys/class/rc/rcN/wakeup_filter
===============================
Sets the scancode wakeup filter expected value. Use in combination with
``/sys/class/rc/rcN/wakeup_filter_mask`` to set the expected value of
the bits set in the wakeup filter mask to trigger a system wake event.
If the hardware supports it and wakeup_filter_mask is not 0 then
scancodes which match the filter will wake the system from e.g. suspend
to RAM or power off. Otherwise the write will fail with an error.
This value may be reset to 0 if the wakeup protocol is altered.
.. _sys_class_rc_rcN_wakeup_filter_mask:
/sys/class/rc/rcN/wakeup_filter_mask
====================================
Sets the scancode wakeup filter mask of bits to compare. Use in
combination with ``/sys/class/rc/rcN/wakeup_filter`` to set the bits of
the scancode which should be compared against the expected value to
trigger a system wake event.
If the hardware supports it and wakeup_filter_mask is not 0 then
scancodes which match the filter will wake the system from e.g. suspend
to RAM or power off. Otherwise the write will fail with an error.
This value may be reset to 0 if the wakeup protocol is altered.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Remote Controller sysfs node 개요
1-12`Documentation/ABI/testing/sysfs-class-rc`에 정의된 다음 sysfs node는 Remote Controller를 제어합니다. 이 문서는 각 경로에서 읽거나 쓸 수 있는 값과 실패 조건을 설명합니다.
.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later
.. _remote_controllers_sysfs_nodes:
*******************************
Remote Controller's sysfs nodes
*******************************
As defined at Documentation/ABI/testing/sysfs-class-rc, those are
the sysfs nodes that control the Remote Controllers:
/sys/class/rc/
13-21`/sys/class/rc/` class 하위 directory는 Remote Controller core에 속합니다. 적외선 remote controller receiver를 설정하는 sysfs interface를 제공합니다.
Remote Controller core가 노출하는 최상위 sysfs 경로입니다.
.. _sys_class_rc:
/sys/class/rc/
==============
The ``/sys/class/rc/`` class sub-directory belongs to the Remote
Controller core and provides a sysfs interface for configuring infrared
remote controller receivers.
/sys/class/rc/rcN/
22-30각 remote control receiver device마다 `/sys/class/rc/rcN` directory가 하나 생성됩니다. `N`은 해당 receiver의 번호입니다.
.. _sys_class_rc_rcN:
/sys/class/rc/rcN/
==================
A ``/sys/class/rc/rcN`` directory is created for each remote control
receiver device where N is the number of the receiver.
/sys/class/rc/rcN/protocols
31-54이 file을 읽으면 사용할 수 있는 protocol 목록이 반환됩니다. 대괄호 `[]`로 둘러싸인 protocol이 현재 활성화된 protocol입니다.
rc5 [rc6] nec jvc [sony]
쓰기 문자열에 따라 활성 protocol 집합을 변경합니다.
유효하지 않은 protocol 조합이나 알 수 없는 protocol 이름을 쓰면 write는 `EINVAL`로 실패합니다.
.. _sys_class_rc_rcN_protocols:
/sys/class/rc/rcN/protocols
===========================
Reading this file returns a list of available protocols, something like::
rc5 [rc6] nec jvc [sony]
Enabled protocols are shown in [] brackets.
Writing "+proto" will add a protocol to the list of enabled protocols.
Writing "-proto" will remove a protocol from the list of enabled
protocols.
Writing "proto" will enable only "proto".
Writing "none" will disable all protocols.
Write fails with ``EINVAL`` if an invalid protocol combination or unknown
protocol name is used.
/sys/class/rc/rcN/filter
55-69`filter`는 scancode filter가 기대하는 값을 설정합니다. `/sys/class/rc/rcN/filter_mask`와 함께 사용해 mask에서 1인 bit가 어떤 값을 가져야 하는지 지정합니다.
Hardware가 filtering을 지원하면 filter와 일치하지 않는 scancode를 무시합니다. 지원하지 않으면 write가 error로 실패합니다. 현재 protocol을 바꾸면 이 값은 0으로 reset될 수 있습니다.
mask가 선택한 bit를 expected value와 비교합니다.
.. _sys_class_rc_rcN_filter:
/sys/class/rc/rcN/filter
========================
Sets the scancode filter expected value.
Use in combination with ``/sys/class/rc/rcN/filter_mask`` to set the
expected value of the bits set in the filter mask. If the hardware
supports it then scancodes which do not match the filter will be
ignored. Otherwise the write will fail with an error.
This value may be reset to 0 if the current protocol is altered.
/sys/class/rc/rcN/filter_mask
70-85`filter_mask`는 비교할 scancode bit의 mask를 설정합니다. `/sys/class/rc/rcN/filter`와 함께 사용해 expected value와 비교할 bit를 고릅니다.
값이 0이면 filter를 비활성화하여 유효한 모든 scancode를 처리합니다. Hardware가 filtering을 지원하지 않으면 write가 error로 실패하며, 현재 protocol이 변경되면 값이 0으로 reset될 수 있습니다.
filter와 mask의 역할 및 protocol 변경 효과입니다.
.. _sys_class_rc_rcN_filter_mask:
/sys/class/rc/rcN/filter_mask
=============================
Sets the scancode filter mask of bits to compare. Use in combination
with ``/sys/class/rc/rcN/filter`` to set the bits of the scancode which
should be compared against the expected value. A value of 0 disables the
filter to allow all valid scancodes to be processed.
If the hardware supports it then scancodes which do not match the filter
will be ignored. Otherwise the write will fail with an error.
This value may be reset to 0 if the current protocol is altered.
/sys/class/rc/rcN/wakeup_protocols
86-113이 file을 읽으면 wakeup filter에 사용할 수 있는 protocol 목록이 반환됩니다. 가능한 경우 `nec`, `sony`, `rc-5`, `rc-6` 같은 protocol의 bit 길이별 variant가 모두 별도 항목으로 표시됩니다.
rc-5 nec nec-x rc-6-0 rc-6-6a-24 [rc-6-6a-32] rc-6-mce
대괄호 `[]` 안의 항목이 현재 활성 wakeup protocol입니다. Wakeup protocol은 한 번에 하나만 선택할 수 있습니다.
일반 protocols node와 달리 하나의 protocol만 선택합니다.
유효하지 않은 protocol 조합, 알 수 없는 protocol 이름, 또는 hardware가 wakeup을 지원하지 않는 경우 write는 `EINVAL`로 실패합니다.
.. _sys_class_rc_rcN_wakeup_protocols:
/sys/class/rc/rcN/wakeup_protocols
==================================
Reading this file returns a list of available protocols to use for the
wakeup filter, something like::
rc-5 nec nec-x rc-6-0 rc-6-6a-24 [rc-6-6a-32] rc-6-mce
Note that protocol variants are listed, so ``nec``, ``sony``, ``rc-5``, ``rc-6``
have their different bit length encodings listed if available.
Note that all protocol variants are listed.
The enabled wakeup protocol is shown in [] brackets.
Only one protocol can be selected at a time.
Writing "proto" will use "proto" for wakeup events.
Writing "none" will disable wakeup.
Write fails with ``EINVAL`` if an invalid protocol combination or unknown
protocol name is used, or if wakeup is not supported by the hardware.
/sys/class/rc/rcN/wakeup_filter
114-128`wakeup_filter`는 scancode wakeup filter가 기대하는 값을 설정합니다. `/sys/class/rc/rcN/wakeup_filter_mask`에서 선택한 bit가 이 값과 일치하면 system wake event를 발생시킵니다.
Hardware가 이를 지원하고 `wakeup_filter_mask`가 0이 아니면 filter와 일치하는 scancode가 suspend-to-RAM이나 power-off 상태에서 system을 깨웁니다. 그렇지 않으면 write가 error로 실패합니다. Wakeup protocol을 변경하면 값이 0으로 reset될 수 있습니다.
일반 filter와 달리 일치하는 scancode가 system wakeup을 유발합니다.
.. _sys_class_rc_rcN_wakeup_filter:
/sys/class/rc/rcN/wakeup_filter
===============================
Sets the scancode wakeup filter expected value. Use in combination with
``/sys/class/rc/rcN/wakeup_filter_mask`` to set the expected value of
the bits set in the wakeup filter mask to trigger a system wake event.
If the hardware supports it and wakeup_filter_mask is not 0 then
scancodes which match the filter will wake the system from e.g. suspend
to RAM or power off. Otherwise the write will fail with an error.
This value may be reset to 0 if the wakeup protocol is altered.
/sys/class/rc/rcN/wakeup_filter_mask
129-144`wakeup_filter_mask`는 wakeup 판단에서 비교할 scancode bit를 선택합니다. `/sys/class/rc/rcN/wakeup_filter`와 조합해 system wake event를 일으킬 expected value와 비교 범위를 정합니다.
Hardware가 이를 지원하고 mask가 0이 아니면 filter와 일치하는 scancode가 suspend-to-RAM이나 power-off 상태에서 system을 깨웁니다. 지원하지 않으면 write가 error로 실패하고, wakeup protocol이 변경되면 mask는 0으로 reset될 수 있습니다.
wakeup_filter와 mask의 역할 및 protocol 변경 효과입니다.
.. _sys_class_rc_rcN_wakeup_filter_mask:
/sys/class/rc/rcN/wakeup_filter_mask
====================================
Sets the scancode wakeup filter mask of bits to compare. Use in
combination with ``/sys/class/rc/rcN/wakeup_filter`` to set the bits of
the scancode which should be compared against the expected value to
trigger a system wake event.
If the hardware supports it and wakeup_filter_mask is not 0 then
scancodes which match the filter will wake the system from e.g. suspend
to RAM or power off. Otherwise the write will fail with an error.
This value may be reset to 0 if the wakeup protocol is altered.
요약·해설
rc-sysfs-nodes.rst:1-144`/sys/class/rc/rcN/` 아래의 node는 receiver protocol과 scancode filter를 제어합니다. 일반 filter는 일치하지 않는 입력을 버리고, wakeup filter는 일치하는 입력으로 system을 깨운다는 방향 차이가 핵심입니다. Hardware 지원 여부와 protocol 변경에 따른 0 reset 가능성을 함께 확인해야 합니다.