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