요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
==========
TTY Struct
==========
.. contents:: :local:
struct tty_struct is allocated by the TTY layer upon the first open of the TTY
device and released after the last close. The TTY layer passes this structure
to most of struct tty_operation's hooks. Members of tty_struct are documented
in `TTY Struct Reference`_ at the bottom.
Initialization
==============
.. kernel-doc:: drivers/tty/tty_io.c
:identifiers: tty_init_termios
Name
====
.. kernel-doc:: drivers/tty/tty_io.c
:identifiers: tty_name
Reference counting
==================
.. kernel-doc:: include/linux/tty.h
:identifiers: tty_kref_get
.. kernel-doc:: drivers/tty/tty_io.c
:identifiers: tty_kref_put
Install
=======
.. kernel-doc:: drivers/tty/tty_io.c
:identifiers: tty_standard_install
Read & Write
============
.. kernel-doc:: drivers/tty/tty_io.c
:identifiers: tty_put_char
Start & Stop
============
.. kernel-doc:: drivers/tty/tty_io.c
:identifiers: start_tty stop_tty
Wakeup
======
.. kernel-doc:: drivers/tty/tty_io.c
:identifiers: tty_wakeup
Hangup
======
.. kernel-doc:: drivers/tty/tty_io.c
:identifiers: tty_hangup tty_vhangup tty_hung_up_p
Misc
====
.. kernel-doc:: drivers/tty/tty_io.c
:identifiers: tty_do_resize
TTY Struct Flags
================
.. kernel-doc:: include/linux/tty.h
:identifiers: tty_struct_flags
TTY Struct Reference
====================
.. kernel-doc:: include/linux/tty.h
:identifiers: tty_struct
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
TTY 구조체 수명주기
1-12`struct tty_struct`는 TTY device를 처음 open할 때 TTY layer가 할당하고 마지막 close 뒤에 해제합니다. TTY layer는 이 구조체를 `struct tty_operation`의 대부분 hook에 전달합니다.
`tty_struct` member에 관한 상세 계약은 페이지 아래의 TTY Struct Reference 절에서 설명합니다.
첫 open부터 마지막 close까지 TTY layer가 구조체를 관리합니다.
.. SPDX-License-Identifier: GPL-2.0
==========
TTY Struct
==========
.. contents:: :local:
struct tty_struct is allocated by the TTY layer upon the first open of the TTY
device and released after the last close. The TTY layer passes this structure
to most of struct tty_operation's hooks. Members of tty_struct are documented
in `TTY Struct Reference`_ at the bottom.
초기화와 이름
13-24Initialization 절은 `drivers/tty/tty_io.c`의 `tty_init_termios`를 문서화합니다. Name 절은 같은 source의 `tty_name`을 포함합니다.
Initialization
==============
.. kernel-doc:: drivers/tty/tty_io.c
:identifiers: tty_init_termios
Name
====
.. kernel-doc:: drivers/tty/tty_io.c
:identifiers: tty_name
Reference counting과 설치
25-39Reference counting은 `include/linux/tty.h`의 `tty_kref_get`과 `drivers/tty/tty_io.c`의 `tty_kref_put`을 함께 설명합니다. Reference를 얻고 반납하는 양쪽 경로의 상세 조건은 각 kernel-doc에 정의됩니다.
Install 절은 `drivers/tty/tty_io.c`의 `tty_standard_install`을 문서화합니다.
Reference counting
==================
.. kernel-doc:: include/linux/tty.h
:identifiers: tty_kref_get
.. kernel-doc:: drivers/tty/tty_io.c
:identifiers: tty_kref_put
Install
=======
.. kernel-doc:: drivers/tty/tty_io.c
:identifiers: tty_standard_install
Read·write, start·stop과 wakeup
40-57Read & Write 절은 `tty_put_char`를, Start & Stop 절은 `start_tty`와 `stop_tty`를, Wakeup 절은 `tty_wakeup`을 설명합니다. 모두 `drivers/tty/tty_io.c`의 kernel-doc에서 생성됩니다.
Read & Write
============
.. kernel-doc:: drivers/tty/tty_io.c
:identifiers: tty_put_char
Start & Stop
============
.. kernel-doc:: drivers/tty/tty_io.c
:identifiers: start_tty stop_tty
Wakeup
======
.. kernel-doc:: drivers/tty/tty_io.c
:identifiers: tty_wakeup
Hangup과 기타 helper
58-69Hangup 절은 `tty_hangup`, `tty_vhangup`, `tty_hung_up_p`를 포함합니다. Misc 절은 TTY 크기 변경을 다루는 `tty_do_resize`를 문서화합니다. 이 함수들은 모두 `drivers/tty/tty_io.c`에서 가져옵니다.
Hangup
======
.. kernel-doc:: drivers/tty/tty_io.c
:identifiers: tty_hangup tty_vhangup tty_hung_up_p
Misc
====
.. kernel-doc:: drivers/tty/tty_io.c
:identifiers: tty_do_resize
TTY flags와 구조체 reference
70-81TTY Struct Flags 절은 `include/linux/tty.h`의 `tty_struct_flags`를 문서화합니다. 마지막 TTY Struct Reference 절은 같은 header의 `tty_struct` 전체 member 계약을 제공합니다.
TTY Struct Flags
================
.. kernel-doc:: include/linux/tty.h
:identifiers: tty_struct_flags
TTY Struct Reference
====================
.. kernel-doc:: include/linux/tty.h
:identifiers: tty_struct
요약·해설
tty_struct.rst:1-81`struct tty_struct`는 TTY device의 첫 open부터 마지막 close까지 유지되는 핵심 상태입니다. 이 페이지는 수명주기와 주요 helper를 `tty_struct_flags`, `tty_struct` reference까지 이어서 설명합니다.