요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
========
TTY Port
========
.. contents:: :local:
The TTY drivers are advised to use struct tty_port helpers as much as possible.
If the drivers implement :c:member:`tty_port.ops.activate()` and
:c:member:`tty_port.ops.shutdown()`, they can use tty_port_open(),
tty_port_close(), and tty_port_hangup() in respective
:c:member:`tty_struct.ops` hooks.
The reference and details are contained in the `TTY Port Reference`_ and `TTY
Port Operations Reference`_ sections at the bottom.
TTY Port Functions
==================
Init & Destroy
--------------
.. kernel-doc:: drivers/tty/tty_port.c
:identifiers: tty_port_init tty_port_destroy
tty_port_get tty_port_put
Open/Close/Hangup Helpers
-------------------------
.. kernel-doc:: drivers/tty/tty_port.c
:identifiers: tty_port_install tty_port_open tty_port_block_til_ready
tty_port_close tty_port_close_start tty_port_close_end tty_port_hangup
tty_port_shutdown
TTY Refcounting
---------------
.. kernel-doc:: drivers/tty/tty_port.c
:identifiers: tty_port_tty_get tty_port_tty_set
TTY Helpers
-----------
.. kernel-doc:: include/linux/tty_port.h
:identifiers: tty_port_tty_hangup tty_port_tty_vhangup
.. kernel-doc:: drivers/tty/tty_port.c
:identifiers: tty_port_tty_wakeup
Modem Signals
-------------
.. kernel-doc:: drivers/tty/tty_port.c
:identifiers: tty_port_carrier_raised tty_port_raise_dtr_rts
tty_port_lower_dtr_rts
----
TTY Port Reference
==================
.. kernel-doc:: include/linux/tty_port.h
:identifiers: tty_port
----
TTY Port Operations Reference
=============================
.. kernel-doc:: include/linux/tty_port.h
:identifiers: tty_port_operations
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
TTY port 개요
1-16TTY driver는 가능한 한 `struct tty_port` helper를 사용하는 것이 권장됩니다. Driver가 `tty_port.ops.activate()`와 `tty_port.ops.shutdown()`을 구현하면, 각각 대응하는 `tty_struct.ops` hook에서 `tty_port_open()`, `tty_port_close()`, `tty_port_hangup()`을 사용할 수 있습니다.
세부 API 계약은 페이지 아래의 TTY Port Reference와 TTY Port Operations Reference 절에 정리됩니다.
Driver callback 구현과 공통 open·close·hangup helper의 관계입니다.
.. SPDX-License-Identifier: GPL-2.0
========
TTY Port
========
.. contents:: :local:
The TTY drivers are advised to use struct tty_port helpers as much as possible.
If the drivers implement :c:member:`tty_port.ops.activate()` and
:c:member:`tty_port.ops.shutdown()`, they can use tty_port_open(),
tty_port_close(), and tty_port_hangup() in respective
:c:member:`tty_struct.ops` hooks.
The reference and details are contained in the `TTY Port Reference`_ and `TTY
Port Operations Reference`_ sections at the bottom.
초기화·해제와 open·close·hangup
17-35초기화와 파괴 범위는 `tty_port_init`, `tty_port_destroy`, `tty_port_get`, `tty_port_put`을 포함합니다. 이 함수들은 `drivers/tty/tty_port.c`에서 port 초기화, 정리와 reference 획득·반납 계약을 제공합니다.
Open/Close/Hangup helper 범위에는 `tty_port_install`, `tty_port_open`, `tty_port_block_til_ready`, `tty_port_close`, `tty_port_close_start`, `tty_port_close_end`, `tty_port_hangup`, `tty_port_shutdown`이 포함됩니다.
TTY Port Functions
==================
Init & Destroy
--------------
.. kernel-doc:: drivers/tty/tty_port.c
:identifiers: tty_port_init tty_port_destroy
tty_port_get tty_port_put
Open/Close/Hangup Helpers
-------------------------
.. kernel-doc:: drivers/tty/tty_port.c
:identifiers: tty_port_install tty_port_open tty_port_block_til_ready
tty_port_close tty_port_close_start tty_port_close_end tty_port_hangup
tty_port_shutdown
TTY reference·helper와 modem signal
36-55TTY reference counting은 `drivers/tty/tty_port.c`의 `tty_port_tty_get`과 `tty_port_tty_set`으로 문서화됩니다.
TTY helper는 `include/linux/tty_port.h`의 `tty_port_tty_hangup`, `tty_port_tty_vhangup`과 `drivers/tty/tty_port.c`의 `tty_port_tty_wakeup`을 묶습니다.
Modem signal helper는 `tty_port_carrier_raised`, `tty_port_raise_dtr_rts`, `tty_port_lower_dtr_rts`입니다. Carrier 상태 확인과 DTR·RTS 신호의 상승·하강 동작을 공통 port 계층에서 다룹니다.
TTY Refcounting
---------------
.. kernel-doc:: drivers/tty/tty_port.c
:identifiers: tty_port_tty_get tty_port_tty_set
TTY Helpers
-----------
.. kernel-doc:: include/linux/tty_port.h
:identifiers: tty_port_tty_hangup tty_port_tty_vhangup
.. kernel-doc:: drivers/tty/tty_port.c
:identifiers: tty_port_tty_wakeup
Modem Signals
-------------
.. kernel-doc:: drivers/tty/tty_port.c
:identifiers: tty_port_carrier_raised tty_port_raise_dtr_rts
tty_port_lower_dtr_rts
TTY port 구조체와 operation reference
56-71TTY Port Reference는 `include/linux/tty_port.h`의 `tty_port` 구조체를 문서화합니다. 이어지는 TTY Port Operations Reference는 같은 header의 `tty_port_operations` callback 계약을 제공합니다.
----
TTY Port Reference
==================
.. kernel-doc:: include/linux/tty_port.h
:identifiers: tty_port
----
TTY Port Operations Reference
=============================
.. kernel-doc:: include/linux/tty_port.h
:identifiers: tty_port_operations
요약·해설
tty_port.rst:1-71`struct tty_port` helper는 TTY driver의 반복적인 활성화, 종료, reference와 modem signal 처리를 공통 계층으로 모읍니다. 이 문서는 함수군과 `tty_port`, `tty_port_operations` reference를 연결합니다.