← Documents Documentation/userspace-api/media/v4l/vidioc-dbg-g-chip-info.rst GitHub 원문 ↗

Linux 6.18.37 · 사용자 공간 API

VIDIOC_DBG_G_CHIP_INFO ioctl

VIDIOC_DBG_G_CHIP_INFO로 TV 카드의 bridge 칩과 sub-device를 열거하고 레지스터 읽기·쓰기 capability를 확인하는 실험적 디버그 API입니다.

Source pathDocumentation/userspace-api/media/v4l/vidioc-dbg-g-chip-info.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

vidioc-dbg-g-chip-info.rst:1-155

VIDIOC_DBG_G_CHIP_INFO로 TV 카드의 bridge 칩과 sub-device를 열거하고 레지스터 읽기·쓰기 capability를 확인하는 실험적 디버그 API입니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2 .. c:namespace:: V4L
3
4 .. _VIDIOC_DBG_G_CHIP_INFO:
5
6 ****************************
7 ioctl VIDIOC_DBG_G_CHIP_INFO
8 ****************************
9
10 Name
11 ====
12
13 VIDIOC_DBG_G_CHIP_INFO - Identify the chips on a TV card
14
15 Synopsis
16 ========
17
18 .. c:macro:: VIDIOC_DBG_G_CHIP_INFO
19
20 ``int ioctl(int fd, VIDIOC_DBG_G_CHIP_INFO, struct v4l2_dbg_chip_info *argp)``
21
22 Arguments
23 =========
24
25 ``fd``
26 File descriptor returned by :c:func:`open()`.
27
28 ``argp``
29 Pointer to struct :c:type:`v4l2_dbg_chip_info`.
30
31 Description
32 ===========
33
34 .. note::
35
36 This is an :ref:`experimental` interface and may
37 change in the future.
38
39 For driver debugging purposes this ioctl allows test applications to
40 query the driver about the chips present on the TV card. Regular
41 applications must not use it. When you found a chip specific bug, please
42 contact the linux-media mailing list
43 (`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__)
44 so it can be fixed.
45
46 Additionally the Linux kernel must be compiled with the
47 ``CONFIG_VIDEO_ADV_DEBUG`` option to enable this ioctl.
48
49 To query the driver applications must initialize the ``match.type`` and
50 ``match.addr`` or ``match.name`` fields of a struct
51 :c:type:`v4l2_dbg_chip_info` and call
52 :ref:`VIDIOC_DBG_G_CHIP_INFO` with a pointer to this structure. On success
53 the driver stores information about the selected chip in the ``name``
54 and ``flags`` fields.
55
56 When ``match.type`` is ``V4L2_CHIP_MATCH_BRIDGE``, ``match.addr``
57 selects the nth bridge 'chip' on the TV card. You can enumerate all
58 chips by starting at zero and incrementing ``match.addr`` by one until
59 :ref:`VIDIOC_DBG_G_CHIP_INFO` fails with an ``EINVAL`` error code. The number
60 zero always selects the bridge chip itself, e. g. the chip connected to
61 the PCI or USB bus. Non-zero numbers identify specific parts of the
62 bridge chip such as an AC97 register block.
63
64 When ``match.type`` is ``V4L2_CHIP_MATCH_SUBDEV``, ``match.addr``
65 selects the nth sub-device. This allows you to enumerate over all
66 sub-devices.
67
68 On success, the ``name`` field will contain a chip name and the
69 ``flags`` field will contain ``V4L2_CHIP_FL_READABLE`` if the driver
70 supports reading registers from the device or ``V4L2_CHIP_FL_WRITABLE``
71 if the driver supports writing registers to the device.
72
73 We recommended the v4l2-dbg utility over calling this ioctl directly. It
74 is available from the LinuxTV v4l-dvb repository; see
75 `https://linuxtv.org/repo/ <https://linuxtv.org/repo/>`__ for access
76 instructions.
77
78 .. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{3.5cm}|p{6.6cm}|
79
80 .. _name-v4l2-dbg-match:
81
82 .. flat-table:: struct v4l2_dbg_match
83 :header-rows: 0
84 :stub-columns: 0
85 :widths: 1 1 2
86
87 * - __u32
88 - ``type``
89 - See :ref:`name-chip-match-types` for a list of possible types.
90 * - union {
91 - (anonymous)
92 * - __u32
93 - ``addr``
94 - Match a chip by this number, interpreted according to the ``type``
95 field.
96 * - char
97 - ``name[32]``
98 - Match a chip by this name, interpreted according to the ``type``
99 field. Currently unused.
100 * - }
101 -
102
103
104 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|
105
106 .. c:type:: v4l2_dbg_chip_info
107
108 .. flat-table:: struct v4l2_dbg_chip_info
109 :header-rows: 0
110 :stub-columns: 0
111 :widths: 1 1 2
112
113 * - struct v4l2_dbg_match
114 - ``match``
115 - How to match the chip, see :ref:`name-v4l2-dbg-match`.
116 * - char
117 - ``name[32]``
118 - The name of the chip.
119 * - __u32
120 - ``flags``
121 - Set by the driver. If ``V4L2_CHIP_FL_READABLE`` is set, then the
122 driver supports reading registers from the device. If
123 ``V4L2_CHIP_FL_WRITABLE`` is set, then it supports writing
124 registers.
125 * - __u32
126 - ``reserved[8]``
127 - Reserved fields, both application and driver must set these to 0.
128
129
130 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.5cm}|
131
132 .. _name-chip-match-types:
133
134 .. flat-table:: Chip Match Types
135 :header-rows: 0
136 :stub-columns: 0
137 :widths: 3 1 4
138
139 * - ``V4L2_CHIP_MATCH_BRIDGE``
140 - 0
141 - Match the nth chip on the card, zero for the bridge chip. Does not
142 match sub-devices.
143 * - ``V4L2_CHIP_MATCH_SUBDEV``
144 - 4
145 - Match the nth sub-device.
146
147 Return Value
148 ============
149
150 On success 0 is returned, on error -1 and the ``errno`` variable is set
151 appropriately. The generic error codes are described at the
152 :ref:`Generic Error Codes <gen-errors>` chapter.
153
154 EINVAL
155 The ``match_type`` is invalid or no device could be matched.
156

3. 한국어 전문 번역

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

이름, 호출 형식과 인자

1-30

`VIDIOC_DBG_G_CHIP_INFO`는 TV 카드에 존재하는 칩을 식별하는 디버그 ioctl입니다. 호출 형식은 `int ioctl(int fd, VIDIOC_DBG_G_CHIP_INFO, struct v4l2_dbg_chip_info *argp)`입니다.

`fd`는 `open()`이 반환한 파일 디스크립터이며 `argp`는 선택 조건과 결과를 담는 `struct v4l2_dbg_chip_info`를 가리킵니다.

.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: V4L

.. _VIDIOC_DBG_G_CHIP_INFO:

****************************
ioctl VIDIOC_DBG_G_CHIP_INFO
****************************

Name
====

VIDIOC_DBG_G_CHIP_INFO - Identify the chips on a TV card

Synopsis
========

.. c:macro:: VIDIOC_DBG_G_CHIP_INFO

``int ioctl(int fd, VIDIOC_DBG_G_CHIP_INFO, struct v4l2_dbg_chip_info *argp)``

Arguments
=========

``fd``
    File descriptor returned by :c:func:`open()`.

``argp``
    Pointer to struct :c:type:`v4l2_dbg_chip_info`.

실험적 인터페이스와 칩 열거

31-76

이 인터페이스는 실험적이며 앞으로 바뀔 수 있습니다. 드라이버 디버깅용 테스트 프로그램이 TV 카드의 칩 구성을 조회할 때만 사용해야 하며 일반 응용 프로그램은 사용하면 안 됩니다. 칩별 결함을 찾았다면 linux-media 메일링 리스트에 알려 드라이버에서 수정되도록 해야 합니다.

커널은 `CONFIG_VIDEO_ADV_DEBUG` 옵션을 켜서 빌드해야 이 ioctl을 제공합니다. 응용 프로그램은 `match.type`과 `match.addr` 또는 `match.name`을 초기화합니다. 성공하면 드라이버가 선택된 칩의 이름을 `name`에, 레지스터 접근 능력을 `flags`에 저장합니다.

`V4L2_CHIP_MATCH_BRIDGE`에서는 `match.addr`가 TV 카드의 n번째 bridge 칩을 선택합니다. 0부터 하나씩 증가시키며 호출하다 `EINVAL`이 나오면 열거가 끝납니다. 0은 PCI나 USB 버스에 직접 연결된 bridge 칩 자체이고, 0보다 큰 값은 AC97 레지스터 블록 같은 bridge 내부의 특정 부분을 가리킬 수 있습니다.

`V4L2_CHIP_MATCH_SUBDEV`에서는 `match.addr`가 n번째 sub-device를 선택하므로 같은 방식으로 모든 sub-device를 열거할 수 있습니다. 성공 시 `V4L2_CHIP_FL_READABLE`은 레지스터 읽기 지원, `V4L2_CHIP_FL_WRITABLE`은 쓰기 지원을 뜻합니다.

ioctl을 직접 호출하기보다 LinuxTV v4l-dvb 저장소의 `v4l2-dbg` 도구를 사용하는 것이 권장됩니다.

칩 열거 절차
match.type 선택match.addr = 0VIDIOC_DBG_G_CHIP_INFO 호출name과 flags 기록addr 증가 또는 EINVAL에서 종료

주소 0부터 EINVAL까지 반복해 칩 목록을 얻습니다.

Description
===========

.. note::

    This is an :ref:`experimental` interface and may
    change in the future.

For driver debugging purposes this ioctl allows test applications to
query the driver about the chips present on the TV card. Regular
applications must not use it. When you found a chip specific bug, please
contact the linux-media mailing list
(`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__)
so it can be fixed.

Additionally the Linux kernel must be compiled with the
``CONFIG_VIDEO_ADV_DEBUG`` option to enable this ioctl.

To query the driver applications must initialize the ``match.type`` and
``match.addr`` or ``match.name`` fields of a struct
:c:type:`v4l2_dbg_chip_info` and call
:ref:`VIDIOC_DBG_G_CHIP_INFO` with a pointer to this structure. On success
the driver stores information about the selected chip in the ``name``
and ``flags`` fields.

When ``match.type`` is ``V4L2_CHIP_MATCH_BRIDGE``, ``match.addr``
selects the nth bridge 'chip' on the TV card. You can enumerate all
chips by starting at zero and incrementing ``match.addr`` by one until
:ref:`VIDIOC_DBG_G_CHIP_INFO` fails with an ``EINVAL`` error code. The number
zero always selects the bridge chip itself, e. g. the chip connected to
the PCI or USB bus. Non-zero numbers identify specific parts of the
bridge chip such as an AC97 register block.

When ``match.type`` is ``V4L2_CHIP_MATCH_SUBDEV``, ``match.addr``
selects the nth sub-device. This allows you to enumerate over all
sub-devices.

On success, the ``name`` field will contain a chip name and the
``flags`` field will contain ``V4L2_CHIP_FL_READABLE`` if the driver
supports reading registers from the device or ``V4L2_CHIP_FL_WRITABLE``
if the driver supports writing registers to the device.

We recommended the v4l2-dbg utility over calling this ioctl directly. It
is available from the LinuxTV v4l-dvb repository; see
`https://linuxtv.org/repo/ <https://linuxtv.org/repo/>`__ for access
instructions.

v4l2_dbg_match 구조체

77-105
struct v4l2_dbg_match
형식필드의미
`__u32``type`칩 일치 유형을 지정하며 Chip Match Types 표의 값을 사용
union익명주소 또는 이름 중 하나를 담는 익명 union
`__u32``addr``type`의 의미에 따라 해석되는 칩 번호
`char[32]``name``type`에 따라 이름으로 일치시키는 필드이며 현재는 사용하지 않음

칩 선택 방식과 현재 사용 여부를 정리합니다.

현재 이름 기반 일치는 사용되지 않으므로 실제 열거에서는 `type`과 `addr` 조합을 사용합니다. 같은 구조체가 칩 정보 조회와 레지스터 접근 ioctl에 공통으로 쓰입니다.


.. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{3.5cm}|p{6.6cm}|

.. _name-v4l2-dbg-match:

.. flat-table:: struct v4l2_dbg_match
    :header-rows:  0
    :stub-columns: 0
    :widths:       1 1 2

    * - __u32
      - ``type``
      - See :ref:`name-chip-match-types` for a list of possible types.
    * - union {
      - (anonymous)
    * - __u32
      - ``addr``
      - Match a chip by this number, interpreted according to the ``type``
	field.
    * - char
      - ``name[32]``
      - Match a chip by this name, interpreted according to the ``type``
	field. Currently unused.
    * - }
      -


.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|

v4l2_dbg_chip_info 구조체

106-129
struct v4l2_dbg_chip_info
형식필드의미
`struct v4l2_dbg_match``match`조회할 칩을 일치시키는 조건
`char[32]``name`드라이버가 반환하는 칩 이름
`__u32``flags``V4L2_CHIP_FL_READABLE` 및 `V4L2_CHIP_FL_WRITABLE` 지원 표시
`__u32[8]``reserved`예약 필드이며 응용 프로그램과 드라이버 모두 0으로 설정

응용 프로그램의 선택 조건과 드라이버의 조회 결과입니다.

.. c:type:: v4l2_dbg_chip_info

.. flat-table:: struct v4l2_dbg_chip_info
    :header-rows:  0
    :stub-columns: 0
    :widths:       1 1 2

    * - struct v4l2_dbg_match
      - ``match``
      - How to match the chip, see :ref:`name-v4l2-dbg-match`.
    * - char
      - ``name[32]``
      - The name of the chip.
    * - __u32
      - ``flags``
      - Set by the driver. If ``V4L2_CHIP_FL_READABLE`` is set, then the
	driver supports reading registers from the device. If
	``V4L2_CHIP_FL_WRITABLE`` is set, then it supports writing
	registers.
    * - __u32
      - ``reserved[8]``
      - Reserved fields, both application and driver must set these to 0.

칩 일치 유형

130-146
Chip Match Types
상수의미
`V4L2_CHIP_MATCH_BRIDGE`0카드의 n번째 비-sub-device 칩; 0은 bridge 또는 host 칩
`V4L2_CHIP_MATCH_SUBDEV`4n번째 sub-device

bridge와 sub-device 열거 공간을 구분합니다.

.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.5cm}|

.. _name-chip-match-types:

.. flat-table:: Chip Match Types
    :header-rows:  0
    :stub-columns: 0
    :widths:       3 1 4

    * - ``V4L2_CHIP_MATCH_BRIDGE``
      - 0
      - Match the nth chip on the card, zero for the bridge chip. Does not
	match sub-devices.
    * - ``V4L2_CHIP_MATCH_SUBDEV``
      - 4
      - Match the nth sub-device.

반환값과 오류

147-155

성공하면 0을 반환하고 실패하면 -1과 적절한 `errno`를 반환합니다. `EINVAL`은 `match_type`이 유효하지 않거나 조건에 맞는 장치가 없다는 뜻이며, 순차 열거에서는 목록의 끝을 나타내기도 합니다.

Return Value
============

On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.

EINVAL
    The ``match_type`` is invalid or no device could be matched.