Documentation/driver-api/tty/tty_port.rst GitHub 원문 ↗

Linux 6.18.37 · Driver API

TTY Port

struct tty_port의 공통 수명주기, open·close·hangup, TTY reference, modem signal과 operation reference를 설명하는 한국어 전문 번역입니다.

Source pathDocumentation/driver-api/tty/tty_port.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

tty_port.rst:1-71

`struct tty_port` helper는 TTY driver의 반복적인 활성화, 종료, reference와 modem signal 처리를 공통 계층으로 모읍니다. 이 문서는 함수군과 `tty_port`, `tty_port_operations` reference를 연결합니다.

문서 구성
원문 줄핵심 내용
1-16helper 사용 개요
17-35수명주기와 open·close·hangup
36-55TTY reference·helper·modem signal
56-71구조체와 operations reference

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 ========
4 TTY Port
5 ========
6
7 .. contents:: :local:
8
9 The TTY drivers are advised to use struct tty_port helpers as much as possible.
10 If the drivers implement :c:member:`tty_port.ops.activate()` and
11 :c:member:`tty_port.ops.shutdown()`, they can use tty_port_open(),
12 tty_port_close(), and tty_port_hangup() in respective
13 :c:member:`tty_struct.ops` hooks.
14
15 The reference and details are contained in the `TTY Port Reference`_ and `TTY
16 Port Operations Reference`_ sections at the bottom.
17
18 TTY Port Functions
19 ==================
20
21 Init & Destroy
22 --------------
23
24 .. kernel-doc:: drivers/tty/tty_port.c
25 :identifiers: tty_port_init tty_port_destroy
26 tty_port_get tty_port_put
27
28 Open/Close/Hangup Helpers
29 -------------------------
30
31 .. kernel-doc:: drivers/tty/tty_port.c
32 :identifiers: tty_port_install tty_port_open tty_port_block_til_ready
33 tty_port_close tty_port_close_start tty_port_close_end tty_port_hangup
34 tty_port_shutdown
35
36 TTY Refcounting
37 ---------------
38
39 .. kernel-doc:: drivers/tty/tty_port.c
40 :identifiers: tty_port_tty_get tty_port_tty_set
41
42 TTY Helpers
43 -----------
44
45 .. kernel-doc:: include/linux/tty_port.h
46 :identifiers: tty_port_tty_hangup tty_port_tty_vhangup
47 .. kernel-doc:: drivers/tty/tty_port.c
48 :identifiers: tty_port_tty_wakeup
49
50 Modem Signals
51 -------------
52
53 .. kernel-doc:: drivers/tty/tty_port.c
54 :identifiers: tty_port_carrier_raised tty_port_raise_dtr_rts
55 tty_port_lower_dtr_rts
56
57 ----
58
59 TTY Port Reference
60 ==================
61
62 .. kernel-doc:: include/linux/tty_port.h
63 :identifiers: tty_port
64
65 ----
66
67 TTY Port Operations Reference
68 =============================
69
70 .. kernel-doc:: include/linux/tty_port.h
71 :identifiers: tty_port_operations
72

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

TTY port 개요

1-16

TTY 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 절에 정리됩니다.

TTY port helper 연결
`tty_port.ops.activate()` 구현`tty_port_open()` 사용
`tty_port.ops.shutdown()` 구현`tty_port_close()` 사용
hangup hook`tty_port_hangup()` 사용

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 수명주기 helper
단계identifier
초기화·파괴`tty_port_init`, `tty_port_destroy`
reference`tty_port_get`, `tty_port_put`
설치·open`tty_port_install`, `tty_port_open`, `tty_port_block_til_ready`
close·hangup`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-55

TTY 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 port helper 범주
범주identifier
TTY refcount`tty_port_tty_get`, `tty_port_tty_set`
hangup·wakeup`tty_port_tty_hangup`, `tty_port_tty_vhangup`, `tty_port_tty_wakeup`
modem signals`tty_port_carrier_raised`, `tty_port_raise_dtr_rts`, `tty_port_lower_dtr_rts`

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-71

TTY Port Reference는 `include/linux/tty_port.h`의 `tty_port` 구조체를 문서화합니다. 이어지는 TTY Port Operations Reference는 같은 header의 `tty_port_operations` callback 계약을 제공합니다.

TTY port reference
identifiersource path역할
`tty_port``include/linux/tty_port.h`TTY port 상태 구조체
`tty_port_operations``include/linux/tty_port.h`port operation 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