media: media-ioc-g-topology.rst: fix 'reserved' sizes
[linux-block.git] / Documentation / media / uapi / mediactl / media-ioc-enum-entities.rst
CommitLineData
5377d91f
MH
1.. -*- coding: utf-8; mode: rst -*-
2
d2c68150 3.. _media_ioc_enum_entities:
5377d91f
MH
4
5*****************************
6ioctl MEDIA_IOC_ENUM_ENTITIES
7*****************************
8
15e7d615 9Name
586027ce 10====
5377d91f 11
586027ce 12MEDIA_IOC_ENUM_ENTITIES - Enumerate entities and their properties
5377d91f 13
15e7d615
MCC
14
15Synopsis
5377d91f
MH
16========
17
5ccbb182
MCC
18.. c:function:: int ioctl( int fd, MEDIA_IOC_ENUM_ENTITIES, struct media_entity_desc *argp )
19 :name: MEDIA_IOC_ENUM_ENTITIES
5377d91f 20
586027ce 21
15e7d615 22Arguments
5377d91f
MH
23=========
24
25``fd``
26 File descriptor returned by :ref:`open() <media-func-open>`.
27
5377d91f
MH
28``argp``
29
30
15e7d615 31Description
5377d91f
MH
32===========
33
34To query the attributes of an entity, applications set the id field of a
e8be7e97 35struct :c:type:`media_entity_desc` structure and
5377d91f
MH
36call the MEDIA_IOC_ENUM_ENTITIES ioctl with a pointer to this
37structure. The driver fills the rest of the structure or returns an
38EINVAL error code when the id is invalid.
39
d2c68150
MCC
40.. _media-ent-id-flag-next:
41
5377d91f
MH
42Entities can be enumerated by or'ing the id with the
43``MEDIA_ENT_ID_FLAG_NEXT`` flag. The driver will return information
44about the entity with the smallest id strictly larger than the requested
cdb4af0f 45one ('next entity'), or the ``EINVAL`` error code if there is none.
5377d91f
MH
46
47Entity IDs can be non-contiguous. Applications must *not* try to
48enumerate entities by calling MEDIA_IOC_ENUM_ENTITIES with increasing
49id's until they get an error.
50
51
e8be7e97 52.. c:type:: media_entity_desc
5377d91f 53
1367f4ee 54.. tabularcolumns:: |p{1.5cm}|p{1.7cm}|p{1.6cm}|p{1.5cm}|p{11.2cm}|
5bd4bb78 55
5377d91f
MH
56.. flat-table:: struct media_entity_desc
57 :header-rows: 0
58 :stub-columns: 0
2ceb5d7b 59 :widths: 1 1 1 1 8
5377d91f
MH
60
61
62 - .. row 1
63
64 - __u32
65
66 - ``id``
67
0579e6e3
MCC
68 -
69 -
5377d91f 70 - Entity id, set by the application. When the id is or'ed with
0579e6e3
MCC
71 ``MEDIA_ENT_ID_FLAG_NEXT``, the driver clears the flag and returns
72 the first entity with a larger id.
5377d91f
MH
73
74 - .. row 2
75
76 - char
77
8968da9b 78 - ``name``\ [32]
5377d91f 79
0579e6e3
MCC
80 -
81 -
5377d91f
MH
82 - Entity name as an UTF-8 NULL-terminated string.
83
84 - .. row 3
85
86 - __u32
87
88 - ``type``
89
0579e6e3
MCC
90 -
91 -
5377d91f
MH
92 - Entity type, see :ref:`media-entity-type` for details.
93
94 - .. row 4
95
96 - __u32
97
98 - ``revision``
99
0579e6e3
MCC
100 -
101 -
5377d91f
MH
102 - Entity revision. Always zero (obsolete)
103
104 - .. row 5
105
106 - __u32
107
108 - ``flags``
109
0579e6e3
MCC
110 -
111 -
5377d91f
MH
112 - Entity flags, see :ref:`media-entity-flag` for details.
113
114 - .. row 6
115
116 - __u32
117
118 - ``group_id``
119
0579e6e3
MCC
120 -
121 -
5377d91f
MH
122 - Entity group ID. Always zero (obsolete)
123
124 - .. row 7
125
126 - __u16
127
128 - ``pads``
129
0579e6e3
MCC
130 -
131 -
5377d91f
MH
132 - Number of pads
133
134 - .. row 8
135
136 - __u16
137
138 - ``links``
139
0579e6e3
MCC
140 -
141 -
5377d91f 142 - Total number of outbound links. Inbound links are not counted in
0579e6e3 143 this field.
5377d91f
MH
144
145 - .. row 9
146
84694edc
HV
147 - __u32
148
149 - ``reserved[4]``
150
151 -
152 -
153 - Reserved for future extensions. Drivers and applications must set
154 the array to zero.
5377d91f
MH
155
156 - .. row 10
157
84694edc
HV
158 - union
159
160 - .. row 11
161
0579e6e3 162 -
5377d91f
MH
163 - struct
164
165 - ``dev``
166
0579e6e3 167 -
5377d91f
MH
168 - Valid for (sub-)devices that create a single device node.
169
84694edc 170 - .. row 12
5377d91f 171
0579e6e3
MCC
172 -
173 -
5377d91f
MH
174 - __u32
175
176 - ``major``
177
178 - Device node major number.
179
84694edc 180 - .. row 13
5377d91f 181
0579e6e3
MCC
182 -
183 -
5377d91f
MH
184 - __u32
185
186 - ``minor``
187
188 - Device node minor number.
189
84694edc 190 - .. row 14
5377d91f 191
0579e6e3 192 -
5377d91f
MH
193 - __u8
194
8968da9b 195 - ``raw``\ [184]
5377d91f 196
0579e6e3
MCC
197 -
198 -
5377d91f
MH
199
200
15e7d615 201Return Value
5377d91f
MH
202============
203
204On success 0 is returned, on error -1 and the ``errno`` variable is set
205appropriately. The generic error codes are described at the
206:ref:`Generic Error Codes <gen-errors>` chapter.
207
208EINVAL
e8be7e97 209 The struct :c:type:`media_entity_desc` ``id``
5377d91f 210 references a non-existing entity.