요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
====================
USB port LED trigger
====================
This LED trigger can be used for signalling to the user a presence of USB device
in a given port. It simply turns on LED when device appears and turns it off
when it disappears.
It requires selecting USB ports that should be observed. All available ones are
listed as separated entries in a "ports" subdirectory. Selecting is handled by
echoing "1" to a chosen port.
Please note that this trigger allows selecting multiple USB ports for a single
LED.
This can be useful in two cases:
1) Device with single USB LED and few physical ports
====================================================
In such a case LED will be turned on as long as there is at least one connected
USB device.
2) Device with a physical port handled by few controllers
=========================================================
Some devices may have one controller per PHY standard. E.g. USB 3.0 physical
port may be handled by ohci-platform, ehci-platform and xhci-hcd. If there is
only one LED user will most likely want to assign ports from all 3 hubs.
This trigger can be activated from user space on led class devices as shown
below::
echo usbport > trigger
This adds sysfs attributes to the LED that are documented in:
Documentation/ABI/testing/sysfs-class-led-trigger-usbport
Example use-case::
echo usbport > trigger
echo 1 > ports/usb1-port1
echo 1 > ports/usb2-port1
cat ports/usb1-port1
echo 0 > ports/usb1-port1
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
USB port 관찰 선택
1-16USB port LED trigger는 지정 port에 USB device가 존재하는지 사용자에게 표시합니다. Device가 나타나면 LED를 켜고 사라지면 끕니다.
관찰할 USB port를 명시적으로 선택해야 합니다. 사용 가능한 port는 `ports` 하위 directory에 개별 entry로 나타나며 원하는 port file에 `1`을 써서 선택합니다.
하나의 LED에 여러 USB port를 연결할 수 있습니다.
선택한 port들의 device 존재 여부를 하나의 LED로 합칩니다.
====================
USB port LED trigger
====================
This LED trigger can be used for signalling to the user a presence of USB device
in a given port. It simply turns on LED when device appears and turns it off
when it disappears.
It requires selecting USB ports that should be observed. All available ones are
listed as separated entries in a "ports" subdirectory. Selecting is handled by
echoing "1" to a chosen port.
Please note that this trigger allows selecting multiple USB ports for a single
LED.
This can be useful in two cases:
다중 port와 다중 controller 사례
17-33첫째 사례는 물리 USB port는 여러 개지만 LED는 하나인 장치입니다. 선택한 port 중 하나라도 USB device가 연결되어 있는 동안 LED가 켜집니다.
둘째 사례는 하나의 물리 port를 PHY 표준별 여러 controller가 처리하는 장치입니다. 예를 들어 USB 3.0 물리 port가 `ohci-platform`, `ehci-platform`, `xhci-hcd`의 hub port로 각각 나타날 수 있습니다.
물리 LED가 하나라면 세 hub의 해당 port를 모두 같은 LED에 배정하는 것이 일반적인 사용자 기대와 맞습니다.
다중 선택 기능이 필요한 두 구조입니다.
1) Device with single USB LED and few physical ports
====================================================
In such a case LED will be turned on as long as there is at least one connected
USB device.
2) Device with a physical port handled by few controllers
=========================================================
Some devices may have one controller per PHY standard. E.g. USB 3.0 physical
port may be handled by ohci-platform, ehci-platform and xhci-hcd. If there is
only one LED user will most likely want to assign ports from all 3 hubs.
This trigger can be activated from user space on led class devices as shown
below::
Sysfs 활성화 예제
34-46LED class device에서 `echo usbport > trigger`로 활성화합니다. 추가 sysfs attribute는 `Documentation/ABI/testing/sysfs-class-led-trigger-usbport`에 문서화되어 있습니다.
예제는 `ports/usb1-port1`과 `ports/usb2-port1`에 각각 `1`을 써서 두 port를 선택하고, `cat ports/usb1-port1`으로 선택 상태를 읽은 뒤 `0`을 써서 첫 port를 해제합니다.
echo usbport > trigger
This adds sysfs attributes to the LED that are documented in:
Documentation/ABI/testing/sysfs-class-led-trigger-usbport
Example use-case::
echo usbport > trigger
echo 1 > ports/usb1-port1
echo 1 > ports/usb2-port1
cat ports/usb1-port1
echo 0 > ports/usb1-port1
요약·해설
ledtrig-usbport.rst:1-46선택한 USB port 가운데 하나에라도 device가 있으면 LED가 켜지며 여러 hub port를 한 LED에 묶을 수 있습니다.